Stored Maps¶
Stored maps turn existing computed results into raster or polygon products. They do not run a hydraulic simulation. Supply a valid result HDF, the intended terrain association, map types and a profile or output timestep supported by the method.
| Entry point | Use | Return |
|---|---|---|
RasMap.store_all_maps |
Canonical orchestration across its documented modes | Report dictionary |
RasProcess.store_maps |
Selected products for one plan/profile | Dictionary of map types to path lists |
RasProcess.store_maps_at_timesteps |
Selected output times | Nested dictionaries of product paths |
RasProcess.store_maps_at_steady_profiles |
Selected steady profiles in one helper launch | DataFrame |
estimate_store_map_resources, profile_store_maps |
Resource estimate or an actual profiled export | Typed estimate/profile result |
| Result registration and calculated layers | RASMapper result tree and expressions | XML / .rasscript edits; does not itself produce a stored raster |
| Raster batch/composite methods | Existing maps or selected plans | Export DataFrame or raster path |
The headless RasProcess.store_maps() implementation uses the native
RasStoreMapHelper.exe; the namespace also wraps other RasProcess operations.
Native export needs the matching installed HEC-RAS components, with Windows or
an explicitly configured supported Wine environment. RasMap also retains GUI
postprocessing: inspect the chosen mode's requirements before unattended use.
The compatibility RasProcess.store_all_maps() delegates to
RasMap.store_all_maps(mode="all_plans").
Use returned product evidence and expected output files to check completion. A layer visible in the RASMapper tree is not proof that its raster was generated. For depth-comparison products see Benefits analysis; for terrain surface export see Terrain, which is distinct from result mapping.
601 — headless stored maps contains retained execution outputs. 125 — arrival and duration maps currently has no retained code-cell outputs; use it as a workflow example, not execution evidence.
A separate retained Ether Hollow control qualifies native HEC-RAS 7.0.1
arrival, duration and percent rasters with horizontal rendering, one explicitly
selected terrain, a 0.5-foot wetness threshold and five regular output times.
Across 21,292 wet pixels, percent matches the fraction of wet stored samples;
arrival matches the first wet output time, and duration matches the observed
single-period time support. All product grids match the registered terrain.
The opt-in tests/test_stored_maps_native_contract.py checks these contracts
against hash-pinned external fixtures. This evidence does not execute notebook
125 or qualify sloping rendering, irregular intervals, initially wet conditions,
multiple wet periods, threshold equality or general recession semantics.
Native inundation boundary¶
Pass inundation_boundary=True to request RAS Mapper's Inundation Boundary
stored layer. Disable the three default raster products for a boundary-only export:
from ras_commander import RasProcess
products = RasProcess.store_maps(
"02", profile="Max", render_mode="sloping",
wse=False, depth=False, velocity=False,
inundation_boundary=True,
output_path="stored-boundary",
)
boundaries = products.get("inundation_boundary", []) # list[Path] of .shp files
This uses native RASResultsMap storage through the packaged helper:
MapType="depth", OutputMode="Stored Polygon Specified Depth", and
ContourPolygonValue="0". In HEC-RAS 7.0.1, this combination is recognized
by the native IsIndundationBoundaryMap property. There is no separate
MapTypes.InundationBoundary member in that runtime. It does not polygonize
an exported depth raster in Python.
HEC's RAS Mapper User's Manual 6.6, Managing Results Maps — Inundation Boundary describes this as a stored polygon at the zero-depth contour for the selected water-surface profile and associated terrain. Depth contours at other values are a separate Depth map configuration; this flag selects the zero contour.
The result dictionary contains primary SHP paths. Native names can include
the contour value, for example Inundation Boundary (Max Value_0).shp.
output_path moves the freshly generated companion files, including SHX, DBF,
and PRJ when present. The call restores the original .rasmap on success or
failure. Existing raster defaults and return types are unchanged.
The collector requires a fresh SHP/SHX/DBF bundle with nonempty polygon records.
Missing, empty, truncated, incomplete, or unchanged products are omitted with
a warning; any files written remain available for inspection. A helper failure
raises RuntimeError. These structure checks do not assess polygon topology
or hydraulic accuracy. Inspect the returned paths before using the product.
Use profile="Max", "Min", or an available output timestamp. Boundary
generation uses the ordered serial helper path; explicit parallel workers
are unsupported. RasMap.store_all_maps(mode="selected",
map_types=["inundation_boundary"]) routes to the same implementation.
The steady-profile entry point retains its existing final-selected-profile
boundary behavior and DataFrame return. Other depth contours, contour bands,
and the Mapper wet/dry editing layers are outside this flag's scope.
The opt-in tests/test_native_inundation_boundary.py copies a computed public
project, exports maximum and middle-timestep boundaries, checks readable,
valid, nonempty polygons and CRS, and verifies source-file hashes and .rasmap
restoration. Set RAS_NATIVE_BOUNDARY_PROJECT to the source .prj,
RAS_NATIVE_BOUNDARY_PLAN to its plan number (default 02), and
RAS_NATIVE_BOUNDARY_VERSION to an installed runtime (default 7.0.1).
Use a short scratch directory with pytest's --basetemp option. Runtime
qualification for this change covers sloping rendering with Windows HEC-RAS
7.0.1 on the public Davis Storm System. Both profiles produced valid,
nonempty multipart polygon features in EPSG:2871. A horizontal-rendering
attempt on that copy reported a native Store-Map fatal error; its cause is
unresolved. This evidence does not qualify horizontal boundary exports,
other runtime versions, or Linux/Wine boundary exports.
Orchestration, result registration and calculated layers¶
Class for parsing and accessing information from HEC-RAS mapper configuration files (.rasmap).
This class provides methods to extract paths to terrain, soil, land cover data, and various project settings from the .rasmap file associated with a HEC-RAS project. It also includes functionality to automate the post-processing of stored maps.
postprocess_stored_maps
staticmethod
¶
postprocess_stored_maps(plan_number: Union[str, List[str]], specify_terrain: Optional[str] = None, layers: Union[str, List[str]] = None, ras_object: Optional[Any] = None, auto_click_compute: bool = True) -> bool
Automates the generation of stored floodplain map outputs (e.g., .tif files).
This function modifies the plan and .rasmap files to generate floodplain maps for one or more plans, then restores the original files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_number
|
Union[str, List[str]]
|
Plan number(s) to generate maps for. |
required |
specify_terrain
|
Optional[str]
|
The name of a specific terrain to use. |
None
|
layers
|
Union[str, List[str]]
|
A list of map layers to generate. Defaults to ['WSEL', 'Velocity', 'Depth']. |
None
|
ras_object
|
Optional[Any]
|
The RAS project object. |
None
|
auto_click_compute
|
bool
|
If True, uses GUI automation to automatically click "Run > Unsteady Flow Analysis" and "Compute" button. If False, just opens HEC-RAS and waits for manual execution. Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the process completed successfully, False otherwise. |
Notes
- auto_click_compute=True: Automated GUI workflow (clicks menu and Compute button)
- auto_click_compute=False: Manual workflow (user must click Compute)
- Automatically calls ensure_rasmap_compatible() to upgrade 5.0.7→6.x .rasmap files
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 | |
store_all_maps
staticmethod
¶
store_all_maps(plan_number: Optional[Union[str, int, float, Sequence[Union[str, int, float]]]] = None, render_mode: str = None, ras_object: Optional[Any] = None, timeout: int = 600, *, mode: str = 'auto', output_folder: Optional[str] = None, output_path: Optional[Union[str, Path]] = None, profile: str = 'Max', profiles: Optional[Union[str, int, Sequence[Union[str, int]]]] = None, timesteps: Optional[Union[int, str, datetime, Sequence[Union[int, str, datetime]]]] = None, max_timesteps: Optional[int] = None, map_types: Optional[Union[str, Sequence[str]]] = None, wse: Optional[bool] = None, depth: Optional[bool] = None, velocity: Optional[bool] = None, froude: Optional[bool] = None, shear_stress: Optional[bool] = None, depth_x_velocity: Optional[bool] = None, depth_x_velocity_sq: Optional[bool] = None, inundation_boundary: Optional[bool] = None, arrival_time: Optional[bool] = None, duration: Optional[bool] = None, percent_inundated: Optional[bool] = None, arrival_depth: float = 0.0, clear_existing: bool = True, fix_georef: bool = True, ras_version: Optional[str] = None, terrain_name: Optional[str] = None, benefit_area: Optional[BenefitAreaConfig] = None, performance: Optional[StoreMapPerformanceOptions] = None, raise_on_error: bool = False) -> Dict[str, Any]
Generate RASMapper stored maps through one canonical API.
mode selects the operation without requiring a second
store_all_maps implementation:
"configured"runs ras-commander's packaged RAS Mapper helper for every stored map already configured in the.rasmap. This is the compatibility behavior of historicRasMap.store_all_maps(plan_number)calls."native"is a deprecated alias for"configured". It does not invokeRasProcess.exe: that executable does not honor the required stored-map interpolation/render-mode behavior."selected"configures and generates selected map products for one or more plans.performance=StoreMapPerformanceOptions(...)enables memory-admitted map-level parallelism."timesteps"generates selected products for requested output timesteps."steady_profiles"configures every selected steady profile in one XML transaction and invokes aggregateStoreAllMapsonce per plan."all_plans"applies the selected-map configuration to every project plan with an HDF result."auto"preserves a plain historic call as"configured", uses"all_plans"whenplan_numberis omitted, and otherwise selects"selected"or"timesteps"when advanced options are supplied.
The result always contains success, resolved mode, plans,
and render_mode. Configured plan results add files_by_type;
timestep results add a nested timesteps mapping. File paths are
strings so the summary is directly JSON serializable.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_number
|
Optional[Union[str, int, float, Sequence[Union[str, int, float]]]]
|
One flexible plan number (for example |
None
|
render_mode
|
str
|
Optional water-surface rendering override. |
None
|
ras_object
|
RasPrj
|
Initialized project object; defaults to the active project. |
None
|
timeout
|
int
|
Per-helper timeout in seconds. |
600
|
mode
|
str
|
|
'auto'
|
output_folder
|
Optional[str]
|
Relative |
None
|
output_path
|
Optional[Union[str, Path]]
|
Destination directory to which generated products are
moved. Multi-plan modes create |
None
|
profile
|
str
|
|
'Max'
|
profiles
|
Optional[Union[str, int, Sequence[Union[str, int]]]]
|
Steady-profile selectors for |
None
|
timesteps
|
Optional[Union[int, str, datetime, Sequence[Union[int, str, datetime]]]]
|
Timestep selectors for |
None
|
max_timesteps
|
Optional[int]
|
Optional cap applied after timestep selection. |
None
|
map_types
|
Optional[Union[str, Sequence[str]]]
|
One product name or a sequence of names. Exactly the
listed products are generated. Do not combine with individual
raster/product flags, except |
None
|
wse
|
Optional[bool]
|
Individual Water Surface Elevation product flag. Once any individual product flag is given, only flags set to True are generated. |
None
|
depth
|
Optional[bool]
|
Individual Depth product flag. |
None
|
velocity
|
Optional[bool]
|
Individual Velocity product flag. |
None
|
froude
|
Optional[bool]
|
Individual Froude number product flag. |
None
|
shear_stress
|
Optional[bool]
|
Individual Shear Stress product flag. |
None
|
depth_x_velocity
|
Optional[bool]
|
Individual depth-times-velocity product flag. |
None
|
depth_x_velocity_sq
|
Optional[bool]
|
Individual depth-times-velocity-squared product flag. |
None
|
arrival_time
|
Optional[bool]
|
Individual Arrival Time product flag. |
None
|
duration
|
Optional[bool]
|
Individual Duration product flag. |
None
|
percent_inundated
|
Optional[bool]
|
Individual Percent Inundated product flag. |
None
|
inundation_boundary
|
Optional[bool]
|
Individual inundation boundary polygon flag.
May also be passed together with
|
None
|
arrival_depth
|
float
|
Threshold for whole-simulation configured products. |
0.0
|
clear_existing
|
bool
|
Clear existing stored maps before adding new ones. |
True
|
fix_georef
|
bool
|
Apply georeferencing fixes to generated rasters. |
True
|
ras_version
|
Optional[str]
|
Optional installed mapping-runtime version. |
None
|
terrain_name
|
Optional[str]
|
Registered terrain selection for non-timestep modes. |
None
|
benefit_area
|
Optional[BenefitAreaConfig]
|
Optional single-plan benefit-area configuration. |
None
|
performance
|
Optional[StoreMapPerformanceOptions]
|
Typed map-helper execution and memory policy. |
None
|
raise_on_error
|
bool
|
Re-raise a per-plan runtime failure instead of
retaining it in the summary. For steady_profiles, a plan whose
StoreAllMaps run omitted some requested products is reported
with |
False
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If the selected mode cannot honor an option, no plans are available, or no map product is selected. |
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 | |
get_results_folder
staticmethod
¶
Get the folder path containing raster results for a specified plan.
HEC-RAS creates output folders based on the plan's Short Identifier. Windows folder naming replaces special characters with underscores.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_number
|
Union[str, int, float]
|
Plan number (accepts flexible formats like 1, "01", "001"). |
required |
ras_object
|
RasPrj
|
Optional RAS object instance. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to the mapping output folder. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the plan number is not found or output folder doesn't exist. |
Examples:
>>> folder = RasMap.get_results_folder("01")
>>> folder = RasMap.get_results_folder(1)
>>> folder = RasMap.get_results_folder("08", ras_object=my_project)
Notes
- Normalizes plan number to two-digit format ("01", "02", etc.)
- Retrieves Short Identifier from plan_df
- Normalizes Short ID for Windows folder naming (special chars -> underscores)
- Searches project folder for matching output directory
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 | |
get_results_raster
staticmethod
¶
get_results_raster(plan_number: Union[str, int, float], variable_name: str, ras_object=None) -> Path
Get the .vrt file path for a specified plan and variable name.
This function locates VRT (Virtual Raster) files exported by RASMapper for a specific hydraulic variable (e.g., WSE, Depth, Velocity).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_number
|
Union[str, int, float]
|
Plan number (accepts flexible formats). |
required |
variable_name
|
str
|
Variable name to search for in VRT filenames (e.g., "WSE", "Depth", "Velocity"). |
required |
ras_object
|
RasPrj
|
Optional RAS object instance. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Path to the matching .vrt file. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no matching files or multiple matching files are found. |
Examples:
>>> vrt = RasMap.get_results_raster("01", "WSE")
>>> vrt = RasMap.get_results_raster(1, "Depth")
>>> vrt = RasMap.get_results_raster("08", "WSE (Max)", ras_object=my_project)
Notes
- Uses get_results_folder() to locate the output directory
- Searches for .vrt files containing the variable_name (case-insensitive)
- If multiple files match, lists all matches and raises an error
- User should make variable_name more specific to narrow results
- VRT files are lightweight virtual rasters that reference underlying .tif tiles
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 | |
scan_results_folders
staticmethod
¶
Scan RAS project folder for results folders containing raster files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ras_folder
|
Path
|
Path to HEC-RAS project folder containing .prj file |
required |
Returns:
| Type | Description |
|---|---|
Dictionary mapping folder names to folder information
|
|
{folder_name
|
{'path': Path, 'has_vrt': bool, 'has_tif': bool}} |
Examples:
>>> folders = RasMap.scan_results_folders(Path("/path/to/project"))
>>> for name, info in folders.items():
... print(f"{name}: {info['path']}")
Source code in ras_commander/RasMap.py
find_results_folder
staticmethod
¶
Find results folder for a plan Short ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ras_folder
|
Path
|
Path to HEC-RAS project folder |
required |
short_id
|
str
|
Plan Short Identifier (from plan file) |
required |
Returns:
| Type | Description |
|---|---|
Optional[Path]
|
Path to results folder, or None if not found |
Examples:
Source code in ras_commander/RasMap.py
resolve_raster_paths
staticmethod
¶
Resolve WSE and Depth raster paths from results folder.
Priority order: 1. Unsteady flow VRT files (e.g., "Depth (Max).vrt") 2. Steady flow VRT files (e.g., "Depth.vrt") 3. Unsteady flow TIF files (e.g., "Depth (Max).tif") 4. Steady flow TIF files (e.g., "Depth.tif")
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results_folder
|
Path
|
Path to RASMapper results folder |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Optional[Path]]
|
Dictionary with 'wse' and 'depth' paths (or None if not found) |
Examples:
>>> rasters = RasMap.resolve_raster_paths(Path("/path/to/project/H100_CP"))
>>> wse_path = rasters['wse']
>>> depth_path = rasters['depth']
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 | |
find_steady_raster
staticmethod
¶
find_steady_raster(results_folder: Path, profile_name: str, raster_type: str) -> Optional[Path]
Find steady state raster for a specific profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results_folder
|
Path
|
Path to RASMapper results folder |
required |
profile_name
|
str
|
Profile name (e.g., "1Pct", "10Pct", "50Pct") |
required |
raster_type
|
str
|
Type of raster ('WSE' or 'Depth') |
required |
Returns:
| Type | Description |
|---|---|
Optional[Path]
|
Path to raster file, or None if not found |
Examples:
>>> raster = RasMap.find_steady_raster(Path("/path/to/project/H100_CP"), "10Pct", "WSE")
Source code in ras_commander/RasMap.py
list_results_plans
staticmethod
¶
List all plan result layers in the RASMapper configuration file.
Enumerates all <Layer Type="RASResults"> entries under the <Results>
section of the .rasmap file. These are the valid host plans for
calculated layers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ras_object
|
RasPrj
|
Optional RasPrj object instance. |
None
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of dicts with keys:
- |
Examples:
>>> from ras_commander import init_ras_project, RasMap
>>> init_ras_project("/path/to/project", "7.0")
>>> plans = RasMap.list_results_plans()
>>> for p in plans:
... print(f"{p['name']} - {p['filename']}")
Source code in ras_commander/RasMap.py
ensure_results_plan_layer
staticmethod
¶
ensure_results_plan_layer(plan_number_or_path: Union[str, int, float, Path], *, name: Optional[str] = None, checked: bool = True, expanded: bool = True, ras_object=None) -> Dict[str, Any]
Ensure a plan HDF is registered in the RASMapper Results tree.
This is useful after cloning and computing a plan programmatically, when
command-line execution creates <project>.p##.hdf but does not add a
corresponding RASResults layer to the project .rasmap.
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 | |
list_results_map_layers
staticmethod
¶
List RASResultsMap child layers under RASMapper result plans.
Returns dictionaries with the parent result plan name, layer name,
visibility, and raw MapParameters attributes.
Source code in ras_commander/RasMap.py
add_results_map_layer
staticmethod
¶
add_results_map_layer(host_plan_name: str, layer_name: str, map_type: str, *, terrain_name: Optional[str] = None, profile_index: int = 2147483647, profile_name: str = 'Max', checked: bool = True, replace_existing: bool = True, ras_object=None) -> Dict[str, Any]
Add a RASResultsMap child layer under an existing RASMapper result plan.
This is useful for tutorial workflows that need first-class map layers
such as Depth * Velocity before comparing floodway encroachment
results.
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 | |
list_calculated_layers
staticmethod
¶
List all calculated layers across all plan results in the RASMapper configuration.
Enumerates all <Layer Type="CalculatedLayer"> entries nested within
<Layer Type="RASResults"> blocks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ras_object
|
RasPrj
|
Optional RasPrj object instance. |
None
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List of dicts with keys:
- |
Examples:
>>> from ras_commander import init_ras_project, RasMap
>>> init_ras_project("/path/to/project", "7.0")
>>> layers = RasMap.list_calculated_layers()
>>> for l in layers:
... print(f"{l['name']} (under {l['parent_plan']})")
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 | |
add_calculated_layer
staticmethod
¶
add_calculated_layer(layer_name: str, host_plan_name: str, script_content: str, raster_maps: List[Dict[str, str]], terrain_names: List[str], checked: bool = True, profile_index: int = 0, ras_object=None) -> bool
Add a calculated layer to the RASMapper configuration and write its .rasscript file.
Creates a .rasscript file in the Calculated Layers/ subdirectory and
registers it as a <Layer Type="CalculatedLayer"> under the specified host
plan's <Layer Type="RASResults"> block. Includes a default viewport-dynamic
diverging color ramp (blue=benefit, red=adverse).
If a calculated layer with the same name already exists in the host plan, it is
replaced (matching the add_terrain_layer convention).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_name
|
str
|
Display name for the calculated layer. |
required |
host_plan_name
|
str
|
Name of the RASResults plan to nest this layer under.
Must match a |
required |
script_content
|
str
|
Full VB.NET |
required |
raster_maps
|
List[Dict[str, str]]
|
List of dicts defining input raster maps. Each dict should have:
- |
required |
terrain_names
|
List[str]
|
List of terrain layer names (order must match inputTiles indices in the script). |
required |
checked
|
bool
|
Whether the layer is visible in RASMapper. Default True. |
True
|
profile_index
|
int
|
ProfileIndex attribute for the calculated layer. Default 0. |
0
|
ras_object
|
RasPrj
|
Optional RasPrj object instance. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the layer was successfully added. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the .rasmap file does not exist. |
ValueError
|
If |
Examples:
>>> from ras_commander import init_ras_project, RasMap
>>> init_ras_project("/path/to/project", "7.0")
>>> RasMap.add_calculated_layer(
... layer_name="CompareWSE_10yr_Reg",
... host_plan_name="Prop_10yr_Reg_BO",
... script_content=script_text,
... raster_maps=[
... {"result": "Exist_10yr_Reg_BO"},
... {"result": "Prop_10yr_Reg_BO"},
... ],
... terrain_names=["Bathy_QESDrone_", "Terrain_Proposed_20260313"],
... )
Notes
- Creates the
Calculated Layersdirectory if it doesn't exist. - Replaces any existing calculated layer with the same name in the host plan.
- The .rasscript file is written with UTF-8 encoding.
- inputTiles indices in the script must match the order of RasterMap then Terrain children in the XML.
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 | |
remove_calculated_layer
staticmethod
¶
remove_calculated_layer(layer_name: str, host_plan_name: Optional[str] = None, delete_script: bool = False, ras_object=None) -> bool
Remove a calculated layer from the RASMapper configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
layer_name
|
str
|
Name of the calculated layer to remove. |
required |
host_plan_name
|
Optional[str]
|
If provided, only search within that specific RASResults block. If None, searches all RASResults blocks and removes the first match. |
None
|
delete_script
|
bool
|
If True, also delete the |
False
|
ras_object
|
RasPrj
|
Optional RasPrj object instance. |
None
|
Returns:
| Type | Description |
|---|---|
bool
|
True if the layer was found and removed, False if not found. |
Examples:
>>> from ras_commander import init_ras_project, RasMap
>>> init_ras_project("/path/to/project", "7.0")
>>> RasMap.remove_calculated_layer("CompareWSE_10yr_Reg", delete_script=True)
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 | |
add_wse_comparison_layers
staticmethod
¶
add_wse_comparison_layers(plan_pairs: List[Dict[str, str]], exist_terrain: str, prop_terrain: str, layer_name_template: str = 'CompareWSE_{tag}', host_plan: str = 'proposed', ras_object=None) -> List[str]
Add WSE comparison calculated layers for multiple existing/proposed plan pairs.
Generates .rasscript files and registers calculated layers for each pair.
The formula is Proposed WSE - Existing WSE:
- Positive values = WSE raised by project (rise / adverse impact)
- Negative values = WSE lowered by project (drop / benefit)
When a cell is dry in one plan, the terrain elevation for that plan's scenario is used as the WSE fallback.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_pairs
|
List[Dict[str, str]]
|
List of dicts, each with keys:
- |
required |
exist_terrain
|
str
|
Terrain layer name for existing conditions (dry-cell fallback). |
required |
prop_terrain
|
str
|
Terrain layer name for proposed conditions (dry-cell fallback). |
required |
layer_name_template
|
str
|
Format string for layer names. Must contain |
'CompareWSE_{tag}'
|
host_plan
|
str
|
Which plan to host the calculated layer under — |
'proposed'
|
ras_object
|
RasPrj
|
Optional RasPrj object instance. |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
Names of successfully created layers. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If a referenced plan name is not found in the Results section, or if a terrain name is not found in the Terrains section. |
Examples:
>>> from ras_commander import init_ras_project, RasMap
>>> ras = init_ras_project("/path/to/project", "7.0")
>>> created = RasMap.add_wse_comparison_layers(
... plan_pairs=[
... {"exist_plan": "Exist_10yr_Reg_BO", "prop_plan": "Prop_10yr_Reg_BO", "tag": "10yr_Reg"},
... {"exist_plan": "Exist_10yr_Loc_BO", "prop_plan": "Prop_10yr_Loc_BO", "tag": "10yr_Loc"},
... {"exist_plan": "Exist_100yr_Reg_BO", "prop_plan": "Prop_100yr_Reg_BO", "tag": "100yr_Reg"},
... ],
... exist_terrain="Bathy_QESDrone_",
... prop_terrain="Terrain_Proposed_20260313",
... )
>>> print(f"Created {len(created)} comparison layers")
Notes
- Each plan pair generates one
.rasscriptfile and one rasmap XML entry. - Layers are hosted under the proposed plan by default (
host_plan="proposed"). - Uses Max profile (ProfileIndex=2147483647) with Fixed Profile animation.
- Includes a viewport-dynamic diverging color ramp by default.
Source code in ras_commander/RasMap.py
| Python | |
|---|---|
6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 | |
Headless mapping, resources and raster products¶
Native command failures¶
The packaged RasStoreMapHelper.exe runs installed RAS Mapper library commands.
Aggregate exports use StoreAllMapsCommand; independent map exports use the
StoreMapCommand factories followed by headless native map storage. Both routes
use the same Commander helper executable, not different mapping engines.
Native aggregate commands can report a fatal error through their progress
reporter and return without throwing. Commander captures these messages, returns
a nonzero helper exit code, and raises an error from RasProcess.store_maps().
Files left by a failed command are not evidence of a completed export. The helper
does not retry automatically or repair missing pixel values.
In Windows HEC-RAS 7.0.1 tests of the public Davis pipe-network example, aggregate
horizontal Max exports intermittently failed during pipe-rendering cache updates
inside RASPipeNetworks.RenderMeshPipeRenderOptions.SetLastMesh. The captured
exception reached DataRow mutation from parallel pipe rasterization. Failed
exports could leave all-nodata TIFFs without georeferencing. The project PRJ,
result HDF and terrain agreed on EPSG:2871; explicit projection initialization
still reproduced the failure, as did exports with Python georeferencing repair
disabled.
A diagnostic control restricted inherited process affinity to one logical CPU:
all 20 aggregate calls completed, and all 10 calls with georeferencing repair
enabled exactly matched the Rust comparison on 4,883 wet pixels after a strict
depth greater than 0.5 ft filter. Four-CPU diagnostic controls failed in 5 of
8 calls, including a separate control with explicit projection initialization.
These observations support a native concurrency defect; they do not establish
a general repair. max_workers=1 limits helper processes, not native internal
threads. Commander does not automatically apply this Windows affinity control,
and independent exports are not a guaranteed workaround.
Sloping render options¶
RasProcess.store_maps(render_mode=None) reads the project's current render
configuration through RasMap.get_water_surface_render_mode(). For
slopingPretty, the helper receives both reduce_shallow_to_horizontal and
use_depth_weighted_faces; it does not replace explicit settings with helper
defaults. Bare mode names retain their existing default behavior.
Configure these flags with RasMap.set_water_surface_render_mode() before
calling store_maps(render_mode=None). Setting the configuration is a persistent
project edit. The stored-map call restores the configuration present at its own
entry, including the selected flags; it does not undo a preceding setter call.
These options affect native sloping interpolation and are distinct from the
optional pixel depth cutoff applied after mapping. See HEC's
Mapping Options
for the two sloping modes and their display controls.
Static class for automating HEC-RAS operations via RasProcess.exe CLI.
This class provides methods to: - Find RasProcess.exe in standard HEC-RAS installation paths - Generate stored maps using StoreAllMaps command - Configure stored maps in .rasmap files - Fix georeferencing issues in generated TIFs - Run on Linux via Wine (auto-detected, no code changes needed)
All methods are static and follow the ras-commander pattern of accepting an optional ras_object parameter for multi-project support.
Example (Windows - unchanged): >>> from ras_commander import init_ras_project, RasProcess >>> init_ras_project("path/to/project", "7.0") >>> results = RasProcess.store_maps( ... plan_number="01", ... output_folder="Maps", ... wse=True, ... depth=True, ... velocity=True ... )
Example (Linux with Wine): >>> from ras_commander import init_ras_project, RasProcess >>> # Auto-detects Linux and uses default Wine prefix >>> init_ras_project("/path/to/project", "7.0") >>> results = RasProcess.store_maps(plan_number="01") >>> >>> # Or configure Wine explicitly: >>> RasProcess.configure_wine( ... wine_prefix="/opt/hecras-wine", ... ras_install_dir="/opt/hecras-wine/drive_c/HEC-RAS/6.6" ... )
get_store_maps_runtime_provenance
staticmethod
¶
Return content identities for the actual StoreMaps runtime.
Source code in ras_commander/RasProcess.py
configure_wine
staticmethod
¶
configure_wine(wine_prefix: Union[str, Path] = None, wine_executable: str = 'wine', ras_install_dir: Union[str, Path] = None) -> WineConfig
Configure Wine environment for Linux execution.
Call this once before using RasProcess on Linux if the defaults don't match your setup. If not called, auto-detection is used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wine_prefix
|
Union[str, Path]
|
Path to WINEPREFIX (default: auto-detect from WINE_PREFIX_PATHS) |
None
|
wine_executable
|
str
|
Wine binary name or path used to launch
Windows executables under Wine. Auxiliary tools
such as |
'wine'
|
ras_install_dir
|
Union[str, Path]
|
Path to directory containing RasProcess.exe and DLLs. Can be a Linux path (under drive_c/) or left None for auto-detect. |
None
|
Returns:
| Type | Description |
|---|---|
WineConfig
|
WineConfig instance that was set. |
Example
RasProcess.configure_wine( ... wine_prefix="/opt/hecras-wine", ... ras_install_dir="/opt/hecras-wine/drive_c/HEC-RAS" ... )
Source code in ras_commander/RasProcess.py
check_wine_environment
staticmethod
¶
Verify the Wine environment is properly configured for RasProcess.
Uses the configured wine_executable when one was provided via
configure_wine().
Returns a dict with status of each component: - wine_found: bool - wine_version: str or None - wine_prefix: str or None - dotnet48: bool (checks for .NET 4.8 marker files) - gdiplus: bool (checks for native gdiplus override) - rasprocess_found: bool - hdf5_found: bool
Example
status = RasProcess.check_wine_environment() if all(status.values()): ... print("Wine environment ready!") else: ... print("Missing:", [k for k,v in status.items() if not v])
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 | |
setup_wine_environment
staticmethod
¶
setup_wine_environment(wine_prefix: Union[str, Path] = '/opt/hecras-wine', ras_version: str = '7.0') -> None
Print setup instructions for the Wine environment.
This does NOT automatically install — it prints the commands needed. Actual installation requires root/sudo and takes ~20 minutes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wine_prefix
|
Union[str, Path]
|
Target Wine prefix path |
'/opt/hecras-wine'
|
ras_version
|
str
|
HEC-RAS version to configure for |
'7.0'
|
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | |
find_rasprocess
staticmethod
¶
Find RasProcess.exe beside an explicit executable or discovered runtime.
On Windows, resolves the requested release before searching Program Files. On Linux, searches within the Wine prefix drive_c/ directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ras_version
|
Optional[Union[str, Path]]
|
Release (e.g., "7.0.2"), executable path, or install directory. If None, searches all known paths. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[Path]
|
Path to RasProcess.exe if found, None otherwise. |
Optional[Path]
|
On Linux, returns the Linux filesystem path (under drive_c/). |
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 | |
get_plan_timestamps
staticmethod
¶
Get available output timestamps for a plan in RASMapper format.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_number
|
str
|
Plan number (e.g., "01", "06") |
required |
ras_object
|
RasPrj
|
Optional RAS object instance |
None
|
Returns:
| Type | Description |
|---|---|
List of timestamp strings in format "DDMMMYYYY HH
|
MM:SS" (e.g., "10SEP2018 02:30:00") |
Source code in ras_commander/RasProcess.py
estimate_store_map_resources
staticmethod
¶
estimate_store_map_resources(plan_number: str, map_types: Sequence[str] = ('wse', 'depth', 'velocity'), *, terrain_name: Optional[str] = None, performance: Optional[StoreMapPerformanceOptions] = None, ras_object=None) -> StoreMapResourceEstimate
Estimate StoreMap worker limits without modifying the project.
The estimate is deliberately conservative and reports its formula and
limiters. It does not edit the .rasmap, create output directories, or
launch HEC-RAS helpers. An explicit native job cap plans combined
private commit plus the OS reserve and verifies the pinned runtime
identity; the actual helper cap is probed only by store_maps.
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 | |
profile_store_maps
staticmethod
¶
profile_store_maps(plan_number: str, output_path: Union[str, Path], report_path: Optional[Union[str, Path]] = None, *, map_types: Sequence[str] = ('wse', 'depth', 'velocity'), performance: Optional[StoreMapPerformanceOptions] = None, profile: str = 'Max', render_mode: Optional[str] = None, fix_georef: bool = True, ras_object=None, ras_version: Optional[str] = None, timeout: int = 7200, sample_interval_seconds: float = 0.2, include_output_signatures: bool = True) -> StoreMapProfileResult
Profile one stored-map configuration and write a JSON report.
The process-tree sampler records CPU, physical/private memory, Windows commit headroom, I/O bytes and I/O operation counts by executable. The report also captures the pre-run resource estimate and blockwise raster signatures so configurations can be compared for output equivalence.
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 | |
store_benefit_area
staticmethod
¶
store_benefit_area(post_plan_number: str, config: BenefitAreaConfig, *, output_path: Union[str, Path] = None, profile: str = 'Max', render_mode: str = None, terrain_name: Optional[str] = None, include_wse: Optional[bool] = None, post_depth: bool = True, post_velocity: bool = False, post_froude: bool = False, post_shear_stress: bool = False, post_depth_x_velocity: bool = False, post_depth_x_velocity_sq: bool = False, post_inundation_boundary: bool = False, post_arrival_time: bool = False, post_duration: bool = False, post_percent_inundated: bool = False, arrival_depth: float = 0.0, clear_existing: bool = True, fix_georef: bool = True, ras_object=None, ras_version: str = None, timeout: int = 600, _log_summary: bool = True) -> Dict[str, List[Path]]
Generate paired Depth maps and derive one BenefitArea product.
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 | |
store_maps
staticmethod
¶
store_maps(plan_number: str, output_folder: str = None, output_path: Union[str, Path] = None, profile: str = 'Max', render_mode: str = None, wse: Optional[bool] = None, depth: Optional[bool] = None, velocity: Optional[bool] = None, froude: bool = False, shear_stress: bool = False, depth_x_velocity: bool = False, depth_x_velocity_sq: bool = False, inundation_boundary: bool = False, arrival_time: bool = False, duration: bool = False, percent_inundated: bool = False, arrival_depth: float = 0.0, clear_existing: bool = True, fix_georef: bool = True, ras_object=None, ras_version: str = None, timeout: int = 600, _log_summary: bool = True, terrain_name: Optional[str] = None, benefit_area: Optional[BenefitAreaConfig] = None, *, performance: Optional[StoreMapPerformanceOptions] = None, max_workers: Any = _PERFORMANCE_UNSET, memory_per_worker_mb: Any = _PERFORMANCE_UNSET, reserve_memory_mb: Any = _PERFORMANCE_UNSET) -> Dict[str, List[Path]]
Generate stored maps for a plan using RasStoreMapHelper.exe.
This method: 1. Configures stored maps in the .rasmap file 2. Runs the packaged mapper helper and HEC-RAS mapping libraries 3. Optionally fixes georeferencing on output TIFs
Works on both Windows (native) and Linux (via Wine, auto-detected).
Output Path Behavior
The compatible single-worker path runs StoreAllMaps in
<project_folder>/<Plan ShortID>/. The parallel path uses the
packaged helper's headless StoreMap implementation with unique
output bases in that same folder. When output_path is supplied,
this method moves only files created or changed by the current call
to the requested directory. The helper initializes terrain SRS
state explicitly, avoiding the raw RasProcess.exe StoreMap
SetProjectionInfo() failure on multi-terrain projects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_number
|
str
|
Plan number (e.g., "01", "06") |
required |
output_folder
|
str
|
Output folder name used in .rasmap StoredFilename paths (default: plan name from rasmap). This does NOT control where the HEC-RAS mapping command writes files — see output_path. |
None
|
output_path
|
Union[str, Path]
|
Custom output directory for generated rasters (str
or Path). If provided, |
None
|
profile
|
str
|
Profile to map - "Max", "Min", or specific timestamp string |
'Max'
|
render_mode
|
str
|
Water surface rendering mode to set before generating
maps. Options: "horizontal", "sloping", "slopingPretty".
For slopingPretty, flags can be given as
"slopingPretty: |
None
|
wse
|
Optional[bool]
|
Generate Water Surface Elevation map. Defaults to True for
ordinary stored-map generation and False for BenefitArea unless
|
None
|
depth
|
Optional[bool]
|
Generate Depth map (default: True). BenefitArea always requires Depth and rejects False. |
None
|
velocity
|
Optional[bool]
|
Generate Velocity map. Defaults to True for ordinary stored-map generation and False for BenefitArea. |
None
|
froude
|
bool
|
Generate Froude number map (default: False) |
False
|
shear_stress
|
bool
|
Generate Shear Stress map (default: False) |
False
|
depth_x_velocity
|
bool
|
Generate D*V hazard map (default: False) |
False
|
depth_x_velocity_sq
|
bool
|
Generate D*V² impact map (default: False) |
False
|
inundation_boundary
|
bool
|
Generate RAS Mapper's native Inundation Boundary
stored polygon at the zero-depth contour (default: False).
Uses MapType="depth", OutputMode="Stored Polygon Specified Depth"
and ContourPolygonValue=0, not a raster polygonization step.
Returned under |
False
|
arrival_time
|
bool
|
Generate flood Arrival Time map in hours (default: False).
Whole-simulation product; ignores the |
False
|
duration
|
bool
|
Generate inundation Duration map in hours (default: False).
Whole-simulation product; ignores the |
False
|
percent_inundated
|
bool
|
Generate Percent Time Inundated map (default: False).
Whole-simulation product; ignores the |
False
|
arrival_depth
|
float
|
Wet/dry depth threshold (model vertical units) for arrival_time / duration / percent_inundated maps (default: 0.0). Appears in output filenames, e.g. "Arrival Time (0.1ft hrs)". |
0.0
|
terrain_name
|
Optional[str]
|
Registered RAS Mapper terrain to select exclusively while generating maps. BenefitArea requires this terrain to resolve to the single GeoTIFF in its configuration. |
None
|
benefit_area
|
Optional[BenefitAreaConfig]
|
Optional BenefitArea configuration. When provided,
|
None
|
clear_existing
|
bool
|
Clear existing stored maps before adding new ones (default: True) |
True
|
fix_georef
|
bool
|
Apply georeferencing fix to output TIFs (default: True) |
True
|
ras_object
|
RasPrj
|
Optional RAS object instance |
None
|
ras_version
|
str
|
Optional specific HEC-RAS mapping-runtime version |
None
|
timeout
|
int
|
Command timeout in seconds (default: 600) |
600
|
performance
|
Optional[StoreMapPerformanceOptions]
|
Keyword-only StoreMap execution and resource policy.
The default preserves serial StoreAllMaps behavior. Use
|
None
|
max_workers
|
Any
|
Deprecated keyword-only worker-count migration alias. |
_PERFORMANCE_UNSET
|
memory_per_worker_mb
|
Any
|
Deprecated keyword-only per-worker memory alias. |
_PERFORMANCE_UNSET
|
reserve_memory_mb
|
Any
|
Deprecated keyword-only reserved-memory alias. Do not combine them with
|
_PERFORMANCE_UNSET
|
Returns:
| Type | Description |
|---|---|
Dict[str, List[Path]]
|
Dict mapping map type names to lists of generated file paths. |
Dict[str, List[Path]]
|
Paths point to |
Dict[str, List[Path]]
|
there after generation), otherwise to the default Plan ShortID |
Dict[str, List[Path]]
|
folder. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the mapper helper or required files are not found |
RuntimeError
|
If the HEC-RAS mapping command fails |
Example
Default output (writes to ./PlanShortID/)¶
results = RasProcess.store_maps( ... plan_number="01", ... profile="Max", ... wse=True, ... depth=True ... )
Custom output path¶
results = RasProcess.store_maps( ... plan_number="01", ... output_path="C:/MyProject/CustomMaps", ... profile="Max", ... wse=True, ... depth=True, ... velocity=True ... ) print(results['wse']) [Path('C:/MyProject/CustomMaps/WSE (Max).Terrain.tif')]
Automatically use safe map-level process parallelism¶
results = RasProcess.store_maps( ... plan_number="01", ... performance=StoreMapPerformanceOptions(max_workers=None), ... )
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 | |
store_maps_at_steady_profiles
staticmethod
¶
store_maps_at_steady_profiles(plan_number: str, profiles: Optional[Union[str, int, Sequence[Union[str, int]]]] = None, output_path: Union[str, Path] = None, map_types: Union[str, Sequence[str]] = ('depth',), render_mode: str = None, clear_existing: bool = True, fix_georef: bool = True, ras_object=None, ras_version: str = None, timeout: int = 1800, *, terrain_name: Optional[str] = None, inundation_boundary: bool = True, raise_on_missing: bool = True, performance: Optional[StoreMapPerformanceOptions] = None) -> pd.DataFrame
Generate all selected steady-profile maps with one helper launch.
Profiles are resolved from the result HDF in exact HDF order. None
selects every profile; exact names and zero-based indexes may be mixed
in a sequence. The request order is preserved and no selector falls
back to Max.
Every profile/product layer is configured in one .rasmap XML
transaction, then aggregate StoreAllMaps is invoked exactly once.
By default, one inundation boundary is also generated for the final
selected profile. This means the highest profile for ras2fim's
ascending ladders, but no hydraulic ordering is inferred here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_number
|
str
|
Steady plan number. |
required |
profiles
|
Optional[Union[str, int, Sequence[Union[str, int]]]]
|
|
None
|
output_path
|
Union[str, Path]
|
Optional destination for all newly generated files. |
None
|
map_types
|
Union[str, Sequence[str]]
|
Profile-dependent product key(s). Defaults to Depth. |
('depth',)
|
render_mode
|
str
|
Optional water-surface render-mode override. |
None
|
clear_existing
|
bool
|
Remove existing stored-map layers for this plan in the temporary configuration. |
True
|
fix_georef
|
bool
|
Apply the existing terrain georeferencing repair to generated TIFF tiles. |
True
|
ras_object
|
RasPrj
|
Optional initialized project object. |
None
|
ras_version
|
str
|
Optional installed HEC-RAS mapping-runtime version. |
None
|
timeout
|
int
|
Aggregate helper timeout in seconds. |
1800
|
terrain_name
|
Optional[str]
|
Optional registered RASMapper terrain to select. |
None
|
inundation_boundary
|
bool
|
Generate one polygon for the final selected
profile. Defaults to True. RASMapper names the polygon
|
True
|
raise_on_missing
|
bool
|
When True (default), raise
:class: |
True
|
performance
|
Optional[StoreMapPerformanceOptions]
|
Per-helper GDAL threads, GDAL cache and native CPU
controls. Aggregate steady export uses one helper; scheduler
and memory-admission fields must retain their defaults and
are not applied by this aggregate route. Wine helpers inherit
one CPU and accept |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame with one row per logical profile/product and stable |
DataFrame
|
columns registered as |
DataFrame
|
mod: |
DataFrame
|
|
DataFrame
|
|
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If required project, HDF, mapper, runtime, or terrain files are missing. |
ValueError
|
If the plan, selectors, products, or output filenames are invalid or ambiguous. |
RuntimeError
|
If StoreAllMaps fails. |
StoredMapProductsIncompleteError
|
If |
TimeoutExpired
|
If the aggregate StoreAllMaps helper
exceeds |
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 | |
store_maps_at_timesteps
staticmethod
¶
store_maps_at_timesteps(plan_number: str, output_path: Union[str, Path] = None, timesteps: Optional[Union[int, str, datetime, List[Union[int, str, datetime]]]] = None, max_timesteps: Optional[int] = None, wse: bool = False, depth: bool = True, velocity: bool = False, froude: bool = False, shear_stress: bool = False, depth_x_velocity: bool = False, depth_x_velocity_sq: bool = False, render_mode: str = None, clear_existing: bool = True, fix_georef: bool = True, ras_object=None, ras_version: str = None, timeout: int = 600, *, performance: Optional[StoreMapPerformanceOptions] = None, max_workers: Any = _PERFORMANCE_UNSET, memory_per_worker_mb: Any = _PERFORMANCE_UNSET, reserve_memory_mb: Any = _PERFORMANCE_UNSET) -> Dict[str, Dict[str, List[Path]]]
Generate stored maps for one or more output timesteps.
This convenience wrapper routes each selected timestep through
store_maps(profile=<timestamp>) so callers can export a sequence of
rasters suitable for animation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plan_number
|
str
|
Plan number (e.g., "02"). |
required |
output_path
|
Union[str, Path]
|
Optional directory for generated rasters. |
None
|
timesteps
|
Optional[Union[int, str, datetime, List[Union[int, str, datetime]]]]
|
Optional timestep selector. Items may be zero-based integer indices, exact RASMapper timestamp strings, or datetimes. If omitted, all available output timesteps are used. |
None
|
max_timesteps
|
Optional[int]
|
Optional cap applied after timestep selection. |
None
|
wse
|
bool
|
Generate WSE maps (default: False). |
False
|
depth
|
bool
|
Generate Depth maps (default: True). |
True
|
velocity
|
bool
|
Generate Velocity maps (default: False). |
False
|
froude
|
bool
|
Generate Froude maps (default: False). |
False
|
shear_stress
|
bool
|
Generate Shear Stress maps (default: False). |
False
|
depth_x_velocity
|
bool
|
Generate depth-times-velocity maps (default: False). |
False
|
depth_x_velocity_sq
|
bool
|
Generate depth-times-velocity-squared maps (default: False). |
False
|
render_mode
|
str
|
Rendering mode passed through to |
None
|
clear_existing
|
bool
|
Clear existing stored maps, passed to |
True
|
fix_georef
|
bool
|
Georeferencing fix flag passed to |
True
|
ras_object
|
RasPrj
|
Project object passed to |
None
|
ras_version
|
str
|
Mapping-runtime version passed to |
None
|
timeout
|
int
|
Per-call timeout in seconds passed to |
600
|
performance
|
Optional[StoreMapPerformanceOptions]
|
StoreMap execution and memory policy for every timestep. |
None
|
max_workers
|
Any
|
Deprecated keyword-only worker-count migration alias. |
_PERFORMANCE_UNSET
|
memory_per_worker_mb
|
Any
|
Deprecated keyword-only per-worker memory alias. |
_PERFORMANCE_UNSET
|
reserve_memory_mb
|
Any
|
Deprecated keyword-only reserved-memory alias. |
_PERFORMANCE_UNSET
|
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, List[Path]]]
|
Dict keyed by RASMapper timestamp string. Each value is the |
Dict[str, Dict[str, List[Path]]]
|
|
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 | |
store_all_maps
staticmethod
¶
store_all_maps(output_folder: str = None, output_path: Union[str, Path] = None, profile: str = 'Max', wse: bool = True, depth: bool = True, velocity: bool = True, froude: bool = False, shear_stress: bool = False, depth_x_velocity: bool = False, depth_x_velocity_sq: bool = False, fix_georef: bool = True, ras_object=None, ras_version: str = None, timeout: int = 1800, *, performance: Optional[StoreMapPerformanceOptions] = None, max_workers: Any = _PERFORMANCE_UNSET, memory_per_worker_mb: Any = _PERFORMANCE_UNSET, reserve_memory_mb: Any = _PERFORMANCE_UNSET) -> Dict[str, Dict[str, List[Path]]]
Compatibility alias for RasMap.store_all_maps(mode="all_plans").
New code should use the canonical RasMap.store_all_maps() entry
point, which exposes native, selected-map, timestep, and all-plan
modes. This method preserves the historical RasProcess return shape.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_folder
|
str
|
Base output folder (plan name appended). If None, uses plan titles. |
None
|
output_path
|
Union[str, Path]
|
Custom output directory. If provided, a subdirectory per plan
is created (e.g., |
None
|
profile
|
str
|
Profile to map - "Max", "Min", or specific timestamp |
'Max'
|
wse
|
bool
|
Generate WSE maps (default: True) |
True
|
depth
|
bool
|
Generate Depth maps (default: True) |
True
|
velocity
|
bool
|
Generate Velocity maps (default: True) |
True
|
froude
|
bool
|
Generate Froude maps (default: False) |
False
|
shear_stress
|
bool
|
Generate Shear Stress maps (default: False) |
False
|
depth_x_velocity
|
bool
|
Generate D*V maps (default: False) |
False
|
depth_x_velocity_sq
|
bool
|
Generate D*V² maps (default: False) |
False
|
fix_georef
|
bool
|
Apply georeferencing fix (default: True) |
True
|
ras_object
|
RasPrj
|
Optional RAS object instance |
None
|
ras_version
|
str
|
Optional specific HEC-RAS version |
None
|
timeout
|
int
|
Timeout per plan in seconds (default: 1800) |
1800
|
performance
|
Optional[StoreMapPerformanceOptions]
|
StoreMap execution and memory policy for every plan. |
None
|
max_workers
|
Any
|
Deprecated keyword-only worker-count migration alias. |
_PERFORMANCE_UNSET
|
memory_per_worker_mb
|
Any
|
Deprecated keyword-only per-worker memory alias. |
_PERFORMANCE_UNSET
|
reserve_memory_mb
|
Any
|
Deprecated keyword-only reserved-memory alias. |
_PERFORMANCE_UNSET
|
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, List[Path]]]
|
Dict mapping plan numbers to their generated files dict. |
Example
summary = RasMap.store_all_maps(mode="all_plans", profile="Max") for plan, plan_result in summary["plans"].items(): ... print(plan, plan_result["success"])
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 | |
run_command
staticmethod
¶
run_command(command_xml: str, ras_version: str = None, timeout: int = 600) -> subprocess.CompletedProcess
Run a raw RasProcess.exe command from XML string.
This is a low-level method for running arbitrary RasProcess commands. See rasmapper_docs/16_rasprocess_cli_reference.md for available commands.
Works on both Windows (native) and Linux (via Wine).
Warning
StoreAllMaps commands always write to
<project>/<Plan ShortID>/ and cannot be redirected.
To control the output directory, use store_maps(output_path=...)
which runs StoreAllMaps then moves files to the requested path.
Individual StoreMap commands with absolute OutputBaseFilename
crash on multi-terrain projects (NullReferenceException in
SetProjectionInfo). store_maps(max_workers=...) uses the
packaged mapper helper's separate headless implementation, which
initializes SRS state explicitly instead of using this raw command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
command_xml
|
str
|
XML command string |
required |
ras_version
|
str
|
Optional specific HEC-RAS version |
None
|
timeout
|
int
|
Command timeout in seconds |
600
|
Returns:
| Type | Description |
|---|---|
CompletedProcess
|
subprocess.CompletedProcess with stdout/stderr |
Example
xml = ''' ...
... ''' result = RasProcess.run_command(xml)depth ...C:/project/plan.p01.hdf ...Max ...C:/project/Maps/depth_max ...
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 | |
apply_depth_threshold
staticmethod
¶
apply_depth_threshold(input_tiff: Union[str, Path], output_tiff: Union[str, Path], min_depth: float = 0.0, reproject_wgs84: bool = False, ras_object=None) -> Dict[str, Any]
Apply depth threshold to a GeoTIFF and optionally reproject to WGS84.
Cells with values below min_depth are set to NoData. Optionally reprojects the raster to EPSG:4326 (WGS84).
Parameters¶
input_tiff : str or Path Path to input GeoTIFF output_tiff : str or Path Path for output GeoTIFF min_depth : float, default 0.0 Minimum depth threshold. Cells below this value become NoData. reproject_wgs84 : bool, default False If True, reproject output to EPSG:4326 (WGS84) ras_object : optional Custom RAS object (unused, for API consistency)
Returns¶
dict Report with keys: input, output, cells_total, cells_filtered, cells_remaining, reprojected
Example¶
result = RasProcess.apply_depth_threshold( ... 'depth_max.tif', 'depth_filtered.tif', min_depth=0.75 ... ) print(f"Filtered {result['cells_filtered']} cells below 0.75 ft")
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 | |
batch_export_rasters
staticmethod
¶
batch_export_rasters(plan_numbers: List[str], output_dir: Union[str, Path], min_depth: float = 0.0, reproject_wgs84: bool = False, naming_template: str = '{plan}_{map_type}', profile: str = 'Max', ras_object=None, ras_version: str = None, timeout: int = 600) -> pd.DataFrame
Batch export depth rasters for multiple plans with post-processing.
Wraps store_maps() for multiple plans, then applies depth threshold filtering and optional WGS84 reprojection.
Parameters¶
plan_numbers : list of str Plan numbers to export (e.g., ['01', '02', '03']) output_dir : str or Path Directory for processed output rasters min_depth : float, default 0.0 Minimum depth threshold. Cells below this become NoData. reproject_wgs84 : bool, default False If True, reproject outputs to EPSG:4326 naming_template : str, default '{plan}_{map_type}' Template for output file names. Supports {plan}, {map_type}. profile : str, default 'Max' Profile to export ('Max', 'Min', or timestamp) ras_object : optional Custom RAS object to use instead of the global one ras_version : str, optional HEC-RAS version for RasProcess.exe timeout : int, default 600 Timeout for each store_maps call
Returns¶
pd.DataFrame Report with columns: plan, map_type, source, output, cells_filtered, status
Example¶
report = RasProcess.batch_export_rasters( ... plan_numbers=['01', '02', '03'], ... output_dir='./exported_rasters', ... min_depth=0.75, ... reproject_wgs84=True ... ) print(report[['plan', 'cells_filtered', 'status']])
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 | |
composite_rasters
staticmethod
¶
composite_rasters(input_tiffs: List[Union[str, Path]], output_path: Union[str, Path], method: str = 'max', extent_mode: str = 'intersection', ras_object=None) -> Path
Composite multiple rasters using max, min, or mean method.
Parameters¶
input_tiffs : list of str or Path Paths to input GeoTIFF files output_path : str or Path Path for output composite raster method : str, default 'max' Compositing method: 'max', 'min', or 'mean' extent_mode : str, default 'intersection' How to handle differing extents: 'intersection' or 'union' ras_object : optional Custom RAS object (unused, for API consistency)
Returns¶
Path Path to the composite raster
Example¶
composite = RasProcess.composite_rasters( ... ['plan01_depth.tif', 'plan02_depth.tif', 'plan03_depth.tif'], ... 'composite_max_depth.tif', ... method='max' ... )
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 | |
composite_rasters_from_plans
staticmethod
¶
composite_rasters_from_plans(plan_numbers: List[str], map_type: str = 'depth', output_path: Union[str, Path] = None, method: str = 'max', ras_object=None) -> Path
Composite stored map TIFs from multiple plans.
Finds stored map GeoTIFFs for each plan in the project folder, then delegates to composite_rasters().
Parameters¶
plan_numbers : list of str Plan numbers to composite (e.g., ['01', '02', '03']) map_type : str, default 'depth' Map type to composite (e.g., 'depth', 'wse', 'velocity') output_path : str or Path, optional Path for output composite. If None, auto-generated in project folder. method : str, default 'max' Compositing method: 'max', 'min', or 'mean' ras_object : optional Custom RAS object to use instead of the global one
Returns¶
Path Path to the composite raster
Example¶
composite = RasProcess.composite_rasters_from_plans( ... plan_numbers=['01', '02', '03'], ... map_type='depth', ... method='max' ... ) print(f"Composite saved to: {composite}")
Source code in ras_commander/RasProcess.py
| Python | |
|---|---|
6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 | |