Plan Parameter Operations¶
# =============================================================================
# DEVELOPMENT MODE TOGGLE
# =============================================================================
USE_LOCAL_SOURCE = False # <-- TOGGLE THIS
if USE_LOCAL_SOURCE:
import sys
from pathlib import Path
local_path = str(Path.cwd().parent)
if local_path not in sys.path:
sys.path.insert(0, local_path)
print(f"LOCAL SOURCE MODE: Loading from {local_path}/ras_commander")
else:
print("PIP PACKAGE MODE: Loading installed ras-commander")
# Import ras-commander
from ras_commander import RasCmdr, RasExamples, RasPlan, RasUnsteady, init_ras_project, ras
# Additional imports
import os
import numpy as np
import pandas as pd
from IPython import display
import matplotlib.pyplot as plt
from datetime import datetime, timedelta
# Verify which version loaded
import ras_commander
print(f"Loaded: {ras_commander.__file__}")
Prerequisites¶
Before running this notebook, ensure you have:
- ras-commander installed:
pip install ras-commander - Python 3.10+: Check with
python --version - HEC-RAS 6.3+: Required for plan computation
- Basic understanding of plan files: See 103_plan_and_geometry_operations.ipynb
What You'll Learn¶
This notebook provides detailed control over HEC-RAS plan parameters:
- Runtime Flags: Control which calculations HEC-RAS performs
- Simulation Intervals: Set output frequency and computation timesteps
- Descriptions: Read and write descriptions for plans, geometry, flow, and unsteady files
- Simulation Dates: Set start/end times for unsteady simulations
- DataFrame Access: Access descriptions directly from project DataFrames
Related Notebooks¶
- 103_plan_and_geometry_operations.ipynb - Plan cloning fundamentals
- 110_single_plan_execution.ipynb - Execute parameterized plans
- 101_project_initialization.ipynb - Project structure basics
Key Concept: Direct Plan File Editing¶
ras-commander modifies .p## files directly using text parsing. This provides:
- Speed: No GUI automation required
- Precision: Exact control over parameters
- Auditability: Changes tracked in version control
Important: Always verify changes by opening plan in HEC-RAS GUI before execution.
Parameters¶
Configure these values to customize the notebook for your project.
# =============================================================================
# PARAMETERS - Edit these to customize the notebook
# =============================================================================
from pathlib import Path
# Project Configuration
PROJECT_NAME = "Muncie" # Example project to extract
RAS_VERSION = "7.0" # HEC-RAS version (6.3, 6.5, 6.6, etc.)
Understanding Plan Files in HEC-RAS¶
Before we dive into the operations, let's understand what HEC-RAS plan files are and why they're important:
What is a Plan File?¶
A HEC-RAS plan file (.p*) is a configuration file that defines how a hydraulic simulation will run. It links together:
- Geometry: River channel and floodplain physical characteristics (
.g*files) - Flow Data: Inflow conditions, either steady (
.f*) or unsteady (.u*) - Simulation Parameters: Time steps, computational methods, and output settings
Key Components of Plan Files¶
Plan files contain many parameters that control simulation behavior:
- Simulation Type: Steady, unsteady, sediment transport, water quality
- Computation Intervals: Time steps for calculations
- Output Intervals: How frequently results are saved
- Run Flags: Which modules to execute (preprocessor, postprocessor, etc.)
- Simulation Period: Start and end dates for unsteady simulations
- Computation Methods: Numerical schemes and solver settings
- Resource Allocation: Number of CPU cores to use
Why Automate Plan Operations?¶
Automating plan operations with RAS Commander allows you to:
- Batch Processing: Run multiple scenarios with different parameters
- Sensitivity Analysis: Systematically vary parameters to assess their impact
- Calibration: Adjust parameters to match observed data
- Consistency: Ensure standardized settings across multiple models
- Documentation: Programmatically track simulation configurations
Now, let's download and extract an example project to work with.
# Extract the Bald Eagle Creek example project using static method
bald_eagle_path = RasExamples.extract_project("Balde Eagle Creek", suffix="09")
print(f"Extracted project to: {bald_eagle_path}")
# Verify the path exists
print(f"Bald Eagle Creek project exists: {bald_eagle_path.exists()}")
2026-01-11 20:50:28 - ras_commander.RasExamples - INFO - Found zip file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\Example_Projects_6_6.zip
2026-01-11 20:50:28 - ras_commander.RasExamples - INFO - Loading project data from CSV...
2026-01-11 20:50:28 - ras_commander.RasExamples - INFO - Loaded 68 projects from CSV.
2026-01-11 20:50:28 - ras_commander.RasExamples - INFO - ----- RasExamples Extracting Project -----
2026-01-11 20:50:28 - ras_commander.RasExamples - INFO - Extracting project 'Balde Eagle Creek' as 'Balde Eagle Creek_09'
2026-01-11 20:50:28 - ras_commander.RasExamples - INFO - Folder 'Balde Eagle Creek_09' already exists. Deleting existing folder...
2026-01-11 20:50:28 - ras_commander.RasExamples - INFO - Existing folder 'Balde Eagle Creek_09' has been deleted.
2026-01-11 20:50:29 - ras_commander.RasExamples - INFO - Successfully extracted project 'Balde Eagle Creek' to C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09
Extracted project to: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09
Bald Eagle Creek project exists: True
Step 1: Project Initialization¶
The first step in any RAS Commander workflow is initializing the HEC-RAS project. This connects the Python environment to the HEC-RAS project files.
The init_ras_project() function does the following:
- Locates the main project file (
.prj) - Reads all associated files (plans, geometries, flows)
- Creates dataframes containing project components
- Sets up the connection to the HEC-RAS executable
Let's initialize our project:
# Initialize the project (using the default global ras object)
init_ras_project(bald_eagle_path, RAS_VERSION)
print(f"Initialized project: {ras.project_name}")
# Display basic project information
print("\nProject Overview:")
print(f"Project Folder: {ras.project_folder}")
print(f"Project File: {ras.prj_file}")
print(f"Number of Plan Files: {len(ras.plan_df)}")
print(f"Number of Geometry Files: {len(ras.geom_df)}")
print(f"Number of Flow Files: {len(ras.flow_df)}")
print(f"Number of Unsteady Files: {len(ras.unsteady_df)}")
2026-01-11 20:50:29 - ras_commander.RasMap - INFO - Successfully parsed RASMapper file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.rasmap
2026-01-11 20:50:29 - ras_commander.RasPrj - INFO - Updated results_df with 2 plan(s)
Initialized project: BaldEagle
Project Overview:
Project Folder: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09
Project File: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.prj
Number of Plan Files: 2
Number of Geometry Files: 1
Number of Flow Files: 2
Number of Unsteady Files: 1
Let's also take a look at the plan files in this project:
# Display the plan files
print("Plan Files in Project:")
pd.set_option('display.max_columns', None)
ras.plan_df
Plan Files in Project:
| plan_number | unsteady_number | geometry_number | Plan Title | Program Version | Short Identifier | Simulation Date | Computation Interval | Mapping Interval | Run HTab | Run UNet | Run Sediment | Run PostProcess | Run WQNet | UNET Use Existing IB Tables | UNET D1 Cores | UNET D2 Cores | PS Cores | DSS File | Friction Slope Method | HDF_Results_Path | Geom File | Geom Path | Flow File | Flow Path | full_path | flow_type | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 01 | 02 | 01 | Unsteady with Bridges and Dam | 5.00 | UnsteadyFlow | 18FEB1999,0000,24FEB1999,0500 | 2MIN | 1HOUR | 1 | 1 | 0 | 1 | 0 | -1 | 0.0 | 0.0 | None | dss | 2 | None | 01 | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | 02 | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | Unsteady |
| 1 | 02 | None | 01 | Steady Flow Run | NaN | SteadyRun | 02/18/1999,0000,02/24/1999,0500 | 2MIN | NaN | 1 | 1 | NaN | 1 | NaN | NaN | NaN | NaN | None | dss | 1 | None | 01 | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | 02 | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | Steady |
# Get the first plan number for our examples
plan_number = ras.plan_df['plan_number'].iloc[0]
print(f"\nWe'll work with Plan: {plan_number}")
We'll work with Plan: 01
Step 3: Updating Run Flags¶
Run flags in HEC-RAS control which components of the simulation are executed. The RasPlan.update_run_flags() method allows you to modify these flags programmatically.
Key Parameters¶
plan_number_or_path(str or Path): The plan number or full path to the plan filegeometry_preprocessor(bool, optional): Whether to run the geometry preprocessorunsteady_flow_simulation(bool, optional): Whether to run the unsteady flow simulationrun_sediment(bool, optional): Whether to run sediment transport calculationspost_processor(bool, optional): Whether to run the post-processorfloodplain_mapping(bool, optional): Whether to run floodplain mappingrasect(RasPrj, optional): The RAS project object
Common Run Flags¶
- Geometry Preprocessor: Computes hydraulic tables from geometry data
True: Recompute tables (useful after geometry changes)-
False: Use existing tables (faster but may be outdated) -
Unsteady Flow Simulation: The main hydraulic calculations
True: Run unsteady flow calculations-
False: Skip unsteady flow calculations -
Sediment Transport: Simulates erosion and deposition
True: Calculate sediment transport-
False: Skip sediment transport -
Post-Processor: Calculates additional variables from results
True: Run post-processing (recommended)-
False: Skip post-processing (faster but fewer outputs) -
Floodplain Mapping: Generates inundation maps
True: Generate maps (requires terrain data)False: Skip mapping (faster)
Let's update the run flags for our plan:
# Update run flags for the plan
print(f"Updating run flags for plan {plan_number}...")
RasPlan.update_run_flags(
"01",
geometry_preprocessor=False, # This may result in a popup if preprocessor files are not present
unsteady_flow_simulation=False, # Run the main hydraulic calculations
run_sediment=False, # Skip sediment transport calculations
post_processor=False, # Run post-processing for additional outputs
floodplain_mapping=True, # Skip floodplain mapping
)
print("Run flags updated successfully")
2026-01-11 20:50:29 - ras_commander.RasPlan - INFO - Successfully updated run flags in plan file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01 (flags modified: 5)
Updating run flags for plan 01...
Run flags updated successfully
Verification: Run Flags Update¶
Success Criteria: - Plan file modified on disk - Runtime flags match requested values - No HEC-RAS warnings when opening plan
Manual Check:
# Verify flags were updated
plan_path = RasPlan.get_plan_path(plan_number)
with open(plan_path, 'r') as f:
content = f.read()
# Check for expected flags
assert 'Run HTab=-1' in content, "HTab flag not set"
assert 'Run RAS=0' in content, "RAS flag not set correctly"
Visual Inspection: 1. Open project in HEC-RAS GUI 2. Load the modified plan 3. Go to Options menu → Check runtime flags 4. Verify flags match what code set
Understanding Runtime Flags¶
| Flag | Meaning | When to Use |
|---|---|---|
| Run HTab=-1 | Compute hydraulic tables | Always for 1D models |
| Run RAS=0 | Don't run steady flow | Unsteady-only plans |
| Run Unsteady=1 | Run unsteady flow | Unsteady plans |
| Write IC File=-1 | Write initial conditions | Before unsteady runs |
See HEC-RAS User's Manual Chapter 5 for complete flag reference.
# The dataframes won't automatically update with changes, so re-init to ensure you are reading the latest version
init_ras_project(bald_eagle_path, RAS_VERSION)
# Display the plan dataframe again to show changes were effective
print("Plan Files in Project:")
ras.plan_df
2026-01-11 20:50:29 - ras_commander.RasMap - INFO - Successfully parsed RASMapper file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.rasmap
2026-01-11 20:50:29 - ras_commander.RasPrj - INFO - Updated results_df with 2 plan(s)
Plan Files in Project:
| plan_number | unsteady_number | geometry_number | Plan Title | Program Version | Short Identifier | Simulation Date | Computation Interval | Mapping Interval | Run HTab | Run UNet | Run Sediment | Run PostProcess | Run WQNet | UNET Use Existing IB Tables | UNET D1 Cores | UNET D2 Cores | PS Cores | DSS File | Friction Slope Method | HDF_Results_Path | Geom File | Geom Path | Flow File | Flow Path | full_path | flow_type | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 01 | 02 | 01 | Unsteady with Bridges and Dam | 5.00 | UnsteadyFlow | 18FEB1999,0000,24FEB1999,0500 | 2MIN | 1HOUR | 0 | 0 | 0 | 0 | 0 | -1 | 0.0 | 0.0 | None | dss | 2 | None | 01 | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | 02 | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | Unsteady |
| 1 | 02 | None | 01 | Steady Flow Run | NaN | SteadyRun | 02/18/1999,0000,02/24/1999,0500 | 2MIN | NaN | 1 | 1 | NaN | 1 | NaN | NaN | NaN | NaN | None | dss | 1 | None | 01 | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | 02 | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... | Steady |
C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01
# Print the Plan file's contents to confirm the change
# Print the plan file contents to verify the run flag changes
with open(plan_path, 'r') as f:
print(f.read())
Plan Title=Unsteady with Bridges and Dam
Program Version=5.00
Short Identifier=UnsteadyFlow
Simulation Date=18FEB1999,0000,24FEB1999,0500
Geom File=g01
Flow File=u02
Subcritical Flow
K Sum by GR= 0
Std Step Tol= 0.01
Critical Tol= 0.01
Num of Std Step Trials= 20
Max Error Tol= 0.3
Flow Tol Ratio= 0.001
Split Flow NTrial= 30
Split Flow Tol= 0.02
Split Flow Ratio= 0.02
Log Output Level= 0
Friction Slope Method= 2
Unsteady Friction Slope Method= 2
Unsteady Bridges Friction Slope Method= 1
Parabolic Critical Depth
Global Vel Dist= 0 , 0 , 0
Global Log Level= 0
CheckData=True
Encroach Param=-1 ,0,0, 0
Computation Interval=2MIN
Output Interval=1HOUR
Instantaneous Interval=2HOUR
Mapping Interval=1HOUR
Run HTab= 0
Run UNet= 0
Run Sediment= 0
Run PostProcess= 0
Run WQNet= 0
Run RASMapper= -1
UNET Theta= 1
UNET Theta Warmup= 1
UNET ZTol= 0.01
UNET ZSATol= 0.1
UNET QTol=
UNET MxIter= 20
UNET Max Iter WO Improvement= 0
UNET MaxInSteps= 0
UNET DtIC= 0
UNET DtMin= 0
UNET MaxCRTS= 20
UNET WFStab= 2
UNET SFStab= 1
UNET WFX= 1
UNET SFX= 1
UNET DSS MLevel= 4
UNET Pardiso=0
UNET DZMax Abort= 100
UNET Use Existing IB Tables=-1
UNET Froude Reduction=False
UNET Froude Limit= 0.8
UNET Froude Power= 4
UNET Time Slicing=0,0, 5
UNET Junction Losses=0
UNET D1 Cores= 0
UNET D2 Coriolis=0
UNET D2 Cores= 0
UNET D2 Theta= 1
UNET D2 Theta Warmup= 1
UNET D2 Z Tol= 0.01
UNET D2 Max Iterations= 20
UNET D2 Equation= 0
UNET D2 TotalICTime=
UNET D2 RampUpFraction=0.5
UNET D2 TimeSlices= 1
UNET D2 Eddy Viscosity=
UNET D2 BCVolumeCheck=0
UNET D2 Latitude=
UNET D1D2 MaxIter= 0
UNET D1D2 ZTol=0.01
UNET D1D2 QTol=0.1
UNET D1D2 MinQTol=1
DSS File=dss
Write IC File= 0
Write IC File at Fixed DateTime=0
IC Time=,,
Write IC File Reoccurance=
Write IC File at Sim End=0
Echo Input=False
Echo Parameters=False
Echo Output=False
Write Detailed= 0
HDF Write Warmup=0
HDF Write Time Slices=0
HDF Flush=0
HDF Compression= 1
HDF Chunk Size= 1
HDF Spatial Parts= 1
HDF Use Max Rows=0
HDF Fixed Rows= 1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,138154.4
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,137690.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,137327.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,136564.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,136202.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,135591.4
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,135068.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,134487.2
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,133881.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,133446.1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,132973.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,132363.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,131699.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,130997.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,130339.2
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,129627.5
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,128760.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,128280.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,127410.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,126741.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,126454.1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,126062.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,125704.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,125091.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,124615.5
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,124025.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,123503.5
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,123123.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,122703.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,122190.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,121754.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,121394.1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,120862.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,120421.4
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,119954.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,119473.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,118901.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,118300.5
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,117753.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,117180.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,116401.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,115584.2
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,114899.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,113985.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,112856.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,111971.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,110657.4
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,109659.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,108600.1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,107333.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,106466.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,105178.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,104647.2
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,104195.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,103854.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,103369.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,103122.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,101440.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,100657.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,99452.75
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,98206.87
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,97607.35
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,96370.43
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,94560.01
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,93391.71
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,92011.85
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,91030.01
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,90096.99
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,89060.69
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,87861.14
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,86942.04
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,85569.53
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,84724.08
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,83563.41
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,82607.89
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,81849.41
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,81084.18
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,80500.50
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,79684.28
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,78627.87
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,76643.40
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,76002.96
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,75917.82
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,75616.14
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,74650.60
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,74207.96
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,73504.24
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,72303.68
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,71400.81
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,70651.52
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,69567.33
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,68604.09
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,67326.78
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,66070.17
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,64908.02
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,63812.99
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,62746.41
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,61896.89
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,60901.09
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,59795.28
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,58836.23
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,58708.54
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,58091.91
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,57700.27
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,57250.60
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,56775.92
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,56243.79
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,55700.55
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,54696.51
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,53922.53
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,52879.19
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,51784.74
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,50720.68
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,49715.77
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,48965.94
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,48110.09
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,47453.14
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,46722.59
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,46310.48
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,45805.37
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,45233.89
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,44529.29
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,43919.30
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,42895.87
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,41806.43
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,40526.85
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,39499.37
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,38446.87
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,37962.54
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,37385.23
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,36769.88
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,36663.76
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,36339.56
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,35648.50
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,35072.37
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,34098.93
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,33498.68
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,32195.47
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,30878.12
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,29563.77
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,27226.40
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,25960.70
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,24843.25
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,24417.73
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,23872.06
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,23783.65
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,23384.79
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,22982.97
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,22386.15
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,21283.34
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,21199.93
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,20127.30
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,19036.24
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,18200.10
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,17549.23
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,16787.45
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,15407.88
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,14814.34
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,13326.74
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,12035.22
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,11865.80
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,11116.44
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,10995.73
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,10221.14
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,9258.941
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,8541.462
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,7936.130
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,6940.066
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,6267.489
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,5523.234
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,4293.710
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,3047.378
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,2731.142
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,2501.017
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,2371.827
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,1692.633
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,1212.855
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,659.942
Calibration Method= 0
Calibration Iterations= 20
Calibration Max Change=0.05
Calibration Tolerance=0.2
Calibration Maximum=1.5
Calibration Minimum=0.5
Calibration Optimization Method= 1
Calibration Window=,,,
WQ AD Non Conservative
WQ ULTIMATE=-1
WQ Max Comp Step=1HOUR
WQ Output Interval=15MIN
WQ Output Selected Increments= 0
WQ Output face flow=0
WQ Output face velocity=0
WQ Output face area=0
WQ Output face dispersion=0
WQ Output cell volume=0
WQ Output cell surface area=0
WQ Output cell continuity=0
WQ Output cumulative cell continuity=0
WQ Output face conc=0
WQ Output face dconc_dx=0
WQ Output face courant=0
WQ Output face peclet=0
WQ Output face adv mass=0
WQ Output face disp mass=0
WQ Output cell mass=0
WQ Output cell source sink temp=0
WQ Output nsm pathways=0
WQ Output nsm derived pathways=0
WQ Output MaxMinRange=-1
WQ Daily Max Min Mean=-1
WQ Daily Range=0
WQ Daily Time=0
WQ Create Restart=0
WQ Fixed Restart=0
WQ Restart Simtime=
WQ Restart Date=
WQ Restart Hour=
WQ System Summary=0
WQ Write To DSS=0
WQ Use Fixed Temperature=0
WQ Fixed Temperature=
Sorting and Armoring Iterations= 10
XS Update Threshold= 0.02
Bed Roughness Predictor= 0
Hydraulics Update Threshold= 0.02
Energy Slope Method= 1
Volume Change Method= 1
Sediment Retention Method= 0
XS Weighting Method= 0
Number of US Weighted Cross Sections= 1
Number of DS Weighted Cross Sections= 1
Upstream XS Weight=0
Main XS Weight=1
Downstream XS Weight=0
Number of DS XS's Weighted with US Boundary= 1
Upstream Boundary Weight= 1
Weight of XSs Associated with US Boundary= 0
Number of US XS's Weighted with DS Boundary= 1
Downstream Boundary Weight= 0.5
Weight of XSs Associated with DS Boundary= 0.5
Sediment Output Level= 4
Mass or Volume Output= 0
Output Increment Type= 1
Profile and TS Output Increment= 10
XS Output Flag= 0
XS Output Increment= 10
Write Gradation File= 0
Read Gradation Hotstart= 0
Gradation File Name=
Write HDF5 File= 0
Write DSS Sediment File= 0
SV Curve= 0
Specific Gage Flag= 0
Step 4: Updating Plan Intervals¶
Time intervals in HEC-RAS control the temporal resolution of simulations and outputs. The RasPlan.update_plan_intervals() method allows you to modify these intervals.
Key Parameters¶
plan_number_or_path(str or Path): The plan number or full path to the plan filecomputation_interval(str, optional): Time step for calculationsoutput_interval(str, optional): Time step for saving detailed resultsinstantaneous_interval(str, optional): Time step for peak value calculationsmapping_interval(str, optional): Time step for map outputsrasect(RasPrj, optional): The RAS project object
Valid Interval Values¶
Time intervals must be specified in HEC-RAS format:
- Seconds: 1SEC, 2SEC, 3SEC, 4SEC, 5SEC, 6SEC, 10SEC, 15SEC, 20SEC, 30SEC
- Minutes: 1MIN, 2MIN, 3MIN, 4MIN, 5MIN, 6MIN, 10MIN, 15MIN, 20MIN, 30MIN
- Hours: 1HOUR, 2HOUR, 3HOUR, 4HOUR, 6HOUR, 8HOUR, 12HOUR
- Days: 1DAY
Interval Types¶
- Computation Interval: Time step used for hydraulic calculations
- Smaller intervals: More accurate but slower
- Larger intervals: Faster but may introduce numerical errors
-
Rule of thumb: Should be small enough to capture flow changes
-
Output Interval: How frequently detailed results are saved
- Smaller intervals: More detailed results but larger files
- Larger intervals: Smaller files but less temporal resolution
-
Usually larger than computation interval
-
Instantaneous Interval: Time step for peak value calculations
- Affects when max/min values are checked
-
Usually equal to output interval
-
Mapping Interval: How frequently map data is saved
- Affects animation smoothness and file size
- Usually larger than output interval
Let's update the intervals for our plan:
# Update plan intervals
print(f"Updating intervals for plan {plan_number}...")
RasPlan.update_plan_intervals(
plan_number,
computation_interval="5SEC", # 5-second time step for calculations
output_interval="1MIN", # Save detailed results every minute
instantaneous_interval="5MIN", # Check for max/min values every 5 minutes
mapping_interval="15MIN", # Save map data every 15 minutes
)
print("Plan intervals updated successfully")
Updating intervals for plan 01...
2026-01-11 20:50:29 - ras_commander.RasPlan - INFO - Successfully updated intervals in plan file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01
Plan intervals updated successfully
Step 5: Managing Descriptions Across All File Types¶
HEC-RAS files use a standard BEGIN DESCRIPTION / END DESCRIPTION block for documentation. ras-commander provides read/write methods for all four file types: plans, geometries, steady flow, and unsteady flow.
Available Methods¶
| File Type | Read | Write |
|---|---|---|
Plan (.p##) |
RasPlan.read_plan_description() |
RasPlan.update_plan_description() |
Geometry (.g##) |
RasPlan.read_geom_description() |
RasPlan.update_geom_description() |
Steady Flow (.f##) |
RasPlan.read_flow_description() |
RasPlan.update_flow_description() |
Unsteady Flow (.u##) |
RasUnsteady.read_unsteady_description() |
RasUnsteady.update_unsteady_description() |
All methods accept either a file number (e.g., "01") or a full file path.
DataFrame Columns¶
After project initialization, descriptions are available directly in DataFrames:
- ras.plan_df['description'] - Plan descriptions
- ras.geom_df['description'] and ras.geom_df['geom_title'] - Geometry info
- ras.flow_df['description'] - Steady flow descriptions
- ras.unsteady_df['description'] - Unsteady flow descriptions
Let's demonstrate reading and writing descriptions for each file type.
# --- Plan Description ---
print("=" * 60)
print("PLAN DESCRIPTION")
print("=" * 60)
# Read the current plan description
current_description = RasPlan.read_plan_description(plan_number)
print(f"Current plan description:\n'{current_description}'\n")
# Create a new description with detailed information
new_description = f"""Modified Plan for RAS Commander Testing
Date: {datetime.now().strftime('%Y-%m-%d')}
Purpose: Demonstrating RAS Commander plan operations
Settings:
- Computation Interval: 5SEC
- Output Interval: 1MIN
- Mapping Interval: 15MIN
Notes: This plan was automatically modified using ras-commander."""
# Update the plan description
print("Updating plan description...")
result = RasPlan.update_plan_description(plan_number, new_description)
print(f"Update result: {result}")
# Verify the updated description reads back correctly
updated_description = RasPlan.read_plan_description(plan_number)
print(f"\nUpdated plan description:\n{updated_description}")
# --- Geometry Description ---
print("=" * 60)
print("GEOMETRY DESCRIPTION")
print("=" * 60)
# Read current geometry description (geometry number "01")
geom_desc = RasPlan.read_geom_description("01")
print(f"Current geometry description:\n'{geom_desc}'\n")
# Update geometry description
geom_description = f"""Bald Eagle Creek Geometry
Modified: {datetime.now().strftime('%Y-%m-%d')}
Contains 1D cross sections and inline structures (bridges, dam)."""
result = RasPlan.update_geom_description("01", geom_description)
print(f"Update result: {result}")
# Verify
updated_geom_desc = RasPlan.read_geom_description("01")
print(f"\nUpdated geometry description:\n{updated_geom_desc}")
# --- Steady Flow Description ---
print("=" * 60)
print("STEADY FLOW DESCRIPTION")
print("=" * 60)
# Check which flow files exist
print("Flow files in project:")
print(ras.flow_df[['flow_number', 'full_path']].to_string())
print()
# Read current flow description (use first flow file)
flow_num = ras.flow_df['flow_number'].iloc[0]
flow_desc = RasPlan.read_flow_description(flow_num)
print(f"Current flow description for f{flow_num}:\n'{flow_desc}'\n")
# Update flow description
flow_description = f"""Steady flow data for Bald Eagle Creek
Modified: {datetime.now().strftime('%Y-%m-%d')}
Contains baseline flow profiles for calibration."""
result = RasPlan.update_flow_description(flow_num, flow_description)
print(f"Update result: {result}")
# Verify
updated_flow_desc = RasPlan.read_flow_description(flow_num)
print(f"\nUpdated flow description:\n{updated_flow_desc}")
# --- Unsteady Flow Description ---
print("=" * 60)
print("UNSTEADY FLOW DESCRIPTION")
print("=" * 60)
# Check which unsteady files exist
print("Unsteady files in project:")
print(ras.unsteady_df[['unsteady_number', 'full_path']].to_string())
print()
# Read current unsteady description
unsteady_num = ras.unsteady_df['unsteady_number'].iloc[0]
unsteady_desc = RasUnsteady.read_unsteady_description(unsteady_num)
print(f"Current unsteady description for u{unsteady_num}:\n'{unsteady_desc}'\n")
# Update unsteady description
unsteady_description = f"""Unsteady flow boundary conditions for Bald Eagle Creek
Modified: {datetime.now().strftime('%Y-%m-%d')}
Event: February 1999 flood event
Upstream: Flow hydrograph, Downstream: Normal depth."""
result = RasUnsteady.update_unsteady_description(unsteady_num, unsteady_description)
print(f"Update result: {result}")
# Verify
updated_unsteady_desc = RasUnsteady.read_unsteady_description(unsteady_num)
print(f"\nUpdated unsteady description:\n{updated_unsteady_desc}")
# --- Verify descriptions in DataFrames ---
# Re-initialize to pick up all description changes
init_ras_project(bald_eagle_path, RAS_VERSION)
print("=" * 60)
print("DESCRIPTIONS IN DATAFRAMES (after re-initialization)")
print("=" * 60)
# Plan descriptions
print("\nplan_df 'description' column:")
for _, row in ras.plan_df.iterrows():
desc = row.get('description', 'N/A')
print(f" Plan {row['plan_number']}: {str(desc)[:80]}...")
# Geometry descriptions and titles
print("\ngeom_df 'geom_title' and 'description' columns:")
for _, row in ras.geom_df.iterrows():
title = row.get('geom_title', 'N/A')
desc = row.get('description', 'N/A')
print(f" Geom {row['geom_number']}: title='{title}', description='{str(desc)[:60]}...'")
# Flow descriptions
print("\nflow_df 'description' column:")
for _, row in ras.flow_df.iterrows():
desc = row.get('description', 'N/A')
print(f" Flow {row['flow_number']}: {str(desc)[:80]}...")
# Unsteady descriptions
print("\nunsteady_df 'description' column:")
for _, row in ras.unsteady_df.iterrows():
desc = row.get('description', 'N/A')
print(f" Unsteady {row['unsteady_number']}: {str(desc)[:80]}...")
Step 6: Updating Simulation Dates¶
For unsteady flow simulations, the simulation period defines the time window for the analysis. The RasPlan.update_simulation_date() method allows you to modify this period.
Key Parameters¶
plan_number_or_path(str or Path): The plan number or full path to the plan filestart_date(datetime): The start date and time for the simulationend_date(datetime): The end date and time for the simulationrasect(RasPrj, optional): The RAS project object
Considerations for Simulation Dates¶
- Hydrograph Coverage: The simulation period should fully encompass your hydrographs
- Warm-Up Period: Include time before the main event for model stabilization
- Cool-Down Period: Include time after the main event for complete drainage
- Computational Efficiency: Avoid unnecessarily long periods to reduce runtime
- Consistency: Ensure dates match available boundary condition data
Let's update the simulation dates for our plan:
# Get the current simulation date
current_sim_date = RasPlan.get_plan_value(plan_number, "Simulation Date")
print(f"Current simulation date: {current_sim_date}")
# Parse the current simulation date string
current_dates = current_sim_date.split(",")
current_start = datetime.strptime(f"{current_dates[0]},{current_dates[1]}", "%d%b%Y,%H%M")
current_end = datetime.strptime(f"{current_dates[2]},{current_dates[3]}", "%d%b%Y,%H%M")
# Define new simulation period - adjust by 1 hour from current dates
start_date = current_start + timedelta(hours=1) # Current start + 1 hour
end_date = current_end - timedelta(hours=1) # Current end - 1 hour
# Update the simulation date
print(f"\nUpdating simulation period to: {start_date.strftime('%d%b%Y,%H%M')} - {end_date.strftime('%d%b%Y,%H%M')}")
RasPlan.update_simulation_date(plan_number, start_date, end_date)
print("Simulation dates updated successfully")
# Verify the updated simulation date
updated_sim_date = RasPlan.get_plan_value(plan_number, "Simulation Date")
print(f"\nUpdated simulation date: {updated_sim_date}")
2026-01-11 20:50:29 - ras_commander.RasPlan - INFO - Updated simulation date in plan file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01
Current simulation date: 18FEB1999,0000,24FEB1999,0500
Updating simulation period to: 18Feb1999,0100 - 24Feb1999,0400
Simulation dates updated successfully
Updated simulation date: 18FEB1999,0100,24FEB1999,0400
Step 7: Verifying Updated Plan Values¶
After making multiple changes to a plan, it's a good practice to verify that all updates were applied correctly. Let's check the updated values:
# Print the Plan file's contents to confirm the change
# Print the plan file contents to verify the run flag changes
with open(plan_path, 'r') as f:
print(f.read())
Plan Title=Unsteady with Bridges and Dam
Program Version=5.00
Short Identifier=UnsteadyFlow
Simulation Date=18FEB1999,0100,24FEB1999,0400
Geom File=g01
Flow File=u02
Subcritical Flow
K Sum by GR= 0
Std Step Tol= 0.01
Critical Tol= 0.01
Num of Std Step Trials= 20
Max Error Tol= 0.3
Flow Tol Ratio= 0.001
Split Flow NTrial= 30
Split Flow Tol= 0.02
Split Flow Ratio= 0.02
Log Output Level= 0
Friction Slope Method= 2
Unsteady Friction Slope Method= 2
Unsteady Bridges Friction Slope Method= 1
Parabolic Critical Depth
Global Vel Dist= 0 , 0 , 0
Global Log Level= 0
CheckData=True
Encroach Param=-1 ,0,0, 0
Begin DESCRIPTION
Modified Plan for RAS Commander Testing
Date: 2026-01-11
Purpose: Demonstrating RAS Commander plan operations
Settings:
- Computation Interval: 5SEC
- Output Interval: 1MIN
- Mapping Interval: 15MIN
- Geometry Preprocessor: Enabled
- Post-Processor: Enabled
Notes: This plan was automatically modified using ras-commander.
END DESCRIPTION
Computation Interval=5SEC
Output Interval=1MIN
Instantaneous Interval=5MIN
Mapping Interval=15MIN
Run HTab= 0
Run UNet= 0
Run Sediment= 0
Run PostProcess= 0
Run WQNet= 0
Run RASMapper= -1
UNET Theta= 1
UNET Theta Warmup= 1
UNET ZTol= 0.01
UNET ZSATol= 0.1
UNET QTol=
UNET MxIter= 20
UNET Max Iter WO Improvement= 0
UNET MaxInSteps= 0
UNET DtIC= 0
UNET DtMin= 0
UNET MaxCRTS= 20
UNET WFStab= 2
UNET SFStab= 1
UNET WFX= 1
UNET SFX= 1
UNET DSS MLevel= 4
UNET Pardiso=0
UNET DZMax Abort= 100
UNET Use Existing IB Tables=-1
UNET Froude Reduction=False
UNET Froude Limit= 0.8
UNET Froude Power= 4
UNET Time Slicing=0,0, 5
UNET Junction Losses=0
UNET D1 Cores= 0
UNET D2 Coriolis=0
UNET D2 Cores= 0
UNET D2 Theta= 1
UNET D2 Theta Warmup= 1
UNET D2 Z Tol= 0.01
UNET D2 Max Iterations= 20
UNET D2 Equation= 0
UNET D2 TotalICTime=
UNET D2 RampUpFraction=0.5
UNET D2 TimeSlices= 1
UNET D2 Eddy Viscosity=
UNET D2 BCVolumeCheck=0
UNET D2 Latitude=
UNET D1D2 MaxIter= 0
UNET D1D2 ZTol=0.01
UNET D1D2 QTol=0.1
UNET D1D2 MinQTol=1
DSS File=dss
Write IC File= 0
Write IC File at Fixed DateTime=0
IC Time=,,
Write IC File Reoccurance=
Write IC File at Sim End=0
Echo Input=False
Echo Parameters=False
Echo Output=False
Write Detailed= 0
HDF Write Warmup=0
HDF Write Time Slices=0
HDF Flush=0
HDF Compression= 1
HDF Chunk Size= 1
HDF Spatial Parts= 1
HDF Use Max Rows=0
HDF Fixed Rows= 1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,138154.4
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,137690.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,137327.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,136564.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,136202.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,135591.4
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,135068.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,134487.2
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,133881.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,133446.1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,132973.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,132363.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,131699.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,130997.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,130339.2
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,129627.5
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,128760.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,128280.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,127410.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,126741.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,126454.1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,126062.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,125704.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,125091.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,124615.5
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,124025.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,123503.5
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,123123.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,122703.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,122190.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,121754.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,121394.1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,120862.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,120421.4
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,119954.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,119473.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,118901.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,118300.5
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,117753.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,117180.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,116401.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,115584.2
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,114899.8
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,113985.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,112856.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,111971.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,110657.4
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,109659.9
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,108600.1
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,107333.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,106466.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,105178.6
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,104647.2
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,104195.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,103854.0
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,103369.7
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,103122.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,101440.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,100657.3
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,99452.75
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,98206.87
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,97607.35
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,96370.43
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,94560.01
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,93391.71
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,92011.85
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,91030.01
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,90096.99
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,89060.69
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,87861.14
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,86942.04
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,85569.53
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,84724.08
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,83563.41
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,82607.89
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,81849.41
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,81084.18
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,80500.50
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,79684.28
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,78627.87
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,76643.40
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,76002.96
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,75917.82
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,75616.14
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,74650.60
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,74207.96
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,73504.24
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,72303.68
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,71400.81
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,70651.52
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,69567.33
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,68604.09
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,67326.78
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,66070.17
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,64908.02
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,63812.99
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,62746.41
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,61896.89
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,60901.09
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,59795.28
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,58836.23
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,58708.54
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,58091.91
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,57700.27
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,57250.60
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,56775.92
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,56243.79
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,55700.55
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,54696.51
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,53922.53
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,52879.19
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,51784.74
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,50720.68
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,49715.77
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,48965.94
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,48110.09
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,47453.14
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,46722.59
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,46310.48
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,45805.37
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,45233.89
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,44529.29
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,43919.30
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,42895.87
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,41806.43
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,40526.85
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,39499.37
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,38446.87
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,37962.54
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,37385.23
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,36769.88
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,36663.76
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,36339.56
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,35648.50
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,35072.37
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,34098.93
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,33498.68
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,32195.47
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,30878.12
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,29563.77
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,27226.40
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,25960.70
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,24843.25
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,24417.73
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,23872.06
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,23783.65
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,23384.79
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,22982.97
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,22386.15
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,21283.34
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,21199.93
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,20127.30
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,19036.24
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,18200.10
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,17549.23
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,16787.45
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,15407.88
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,14814.34
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,13326.74
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,12035.22
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,11865.80
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,11116.44
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,10995.73
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,10221.14
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,9258.941
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,8541.462
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,7936.130
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,6940.066
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,6267.489
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,5523.234
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,4293.710
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,3047.378
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,2731.142
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,2501.017
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,2371.827
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,1692.633
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,1212.855
Stage Flow Hydrograph=Bald Eagle ,Loc Hav ,659.942
Calibration Method= 0
Calibration Iterations= 20
Calibration Max Change=0.05
Calibration Tolerance=0.2
Calibration Maximum=1.5
Calibration Minimum=0.5
Calibration Optimization Method= 1
Calibration Window=,,,
WQ AD Non Conservative
WQ ULTIMATE=-1
WQ Max Comp Step=1HOUR
WQ Output Interval=15MIN
WQ Output Selected Increments= 0
WQ Output face flow=0
WQ Output face velocity=0
WQ Output face area=0
WQ Output face dispersion=0
WQ Output cell volume=0
WQ Output cell surface area=0
WQ Output cell continuity=0
WQ Output cumulative cell continuity=0
WQ Output face conc=0
WQ Output face dconc_dx=0
WQ Output face courant=0
WQ Output face peclet=0
WQ Output face adv mass=0
WQ Output face disp mass=0
WQ Output cell mass=0
WQ Output cell source sink temp=0
WQ Output nsm pathways=0
WQ Output nsm derived pathways=0
WQ Output MaxMinRange=-1
WQ Daily Max Min Mean=-1
WQ Daily Range=0
WQ Daily Time=0
WQ Create Restart=0
WQ Fixed Restart=0
WQ Restart Simtime=
WQ Restart Date=
WQ Restart Hour=
WQ System Summary=0
WQ Write To DSS=0
WQ Use Fixed Temperature=0
WQ Fixed Temperature=
Sorting and Armoring Iterations= 10
XS Update Threshold= 0.02
Bed Roughness Predictor= 0
Hydraulics Update Threshold= 0.02
Energy Slope Method= 1
Volume Change Method= 1
Sediment Retention Method= 0
XS Weighting Method= 0
Number of US Weighted Cross Sections= 1
Number of DS Weighted Cross Sections= 1
Upstream XS Weight=0
Main XS Weight=1
Downstream XS Weight=0
Number of DS XS's Weighted with US Boundary= 1
Upstream Boundary Weight= 1
Weight of XSs Associated with US Boundary= 0
Number of US XS's Weighted with DS Boundary= 1
Downstream Boundary Weight= 0.5
Weight of XSs Associated with DS Boundary= 0.5
Sediment Output Level= 4
Mass or Volume Output= 0
Output Increment Type= 1
Profile and TS Output Increment= 10
XS Output Flag= 0
XS Output Increment= 10
Write Gradation File= 0
Read Gradation Hotstart= 0
Gradation File Name=
Write HDF5 File= 0
Write DSS Sediment File= 0
SV Curve= 0
Specific Gage Flag= 0
Step 8: Computing the Plan (Optional)¶
After making changes to a plan, you might want to run the simulation to see the effects. The RasCmdr.compute_plan() method executes a HEC-RAS simulation with the specified plan.
Key Parameters¶
plan_number(str): The plan number to executedest_folder(str, Path, optional): Destination folder for computationrasect(RasPrj, optional): The RAS project objectclear_geompre(bool, optional): Whether to clear geometry preprocessor filesnum_cores(int, optional): Number of processor cores to useoverwrite_dest(bool, optional): Whether to overwrite the destination folder
If you want to run the simulation, you can uncomment the code below:
RasPlan.update_run_flags(plan_number, geometry_preprocessor=True)
RasCmdr.compute_plan(plan_number)
2026-01-11 20:50:29 - ras_commander.RasPlan - INFO - Successfully updated run flags in plan file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01 (flags modified: 1)
2026-01-11 20:50:29 - ras_commander.RasCmdr - INFO - Using ras_object with project folder: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09
2026-01-11 20:50:29 - ras_commander.RasCmdr - INFO - Running HEC-RAS from the Command Line:
2026-01-11 20:50:29 - ras_commander.RasCmdr - INFO - Running command: "C:\Program Files (x86)\HEC\HEC-RAS\6.6\Ras.exe" -c "C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.prj" "C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01"
2026-01-11 20:52:17 - ras_commander.RasCmdr - INFO - HEC-RAS execution completed for plan: 01
2026-01-11 20:52:17 - ras_commander.RasCmdr - INFO - Total run time for plan 01: 107.92 seconds
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Using existing Path object HDF file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Final validated file path: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Reading computation messages from HDF: BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Successfully extracted 800 characters from HDF
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Using existing Path object HDF file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Final validated file path: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Extracting Plan Information from: BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - WARNING - Group '/Plan Data/Plan Information' not found.
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Using existing Path object HDF file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Final validated file path: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Using existing Path object HDF file: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01.hdf
2026-01-11 20:52:17 - ras_commander.hdf.HdfResultsPlan - INFO - Final validated file path: C:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\examples\example_projects\Balde Eagle Creek_09\BaldEagle.p01.hdf
c:\Users\billk_clb\anaconda3\envs\rascmdr_piptest\Lib\site-packages\ras_commander\RasPrj.py:1513: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
self.results_df = pd.concat([self.results_df, new_results], ignore_index=True)
2026-01-11 20:52:17 - ras_commander.RasPrj - INFO - Updated results_df with 1 plan(s)
True
# Uncomment to run the simulation with the updated plan
# # Define a destination folder for the computation
# dest_folder = script_dir / "compute_results"
# print(f"Computing plan {plan_number}...")
# print(f"Results will be saved to: {dest_folder}")
# # Execute the plan
# success = RasCmdr.compute_plan(
# plan_number,
# dest_folder=dest_folder,
# clear_geompre=True, # Clear preprocessor files to ensure clean results
# num_cores=2, # Use 2 processor cores
# overwrite_dest=True, # Overwrite existing destination folder
# rasect=ras
# )
# if success:
# print(f"Plan {plan_number} computed successfully")
# # Check for results file
# results_path = RasPlan.get_results_path(plan_number)
# if results_path:
# print(f"Results saved to: {results_path}")
# else:
# print(f"Failed to compute plan {plan_number}")
Viewing Execution Summary with results_df¶
Check how parameter changes affected execution performance.
# Display execution summary only for the plan run in this notebook (filtered and transposed)
print("Execution Summary (for current plan):")
display.display(ras.results_df[ras.results_df['plan_number'] == plan_number].T)
Execution Summary (for current plan):
| 1 | |
|---|---|
| plan_number | 01 |
| plan_title | Unsteady with Bridges and Dam |
| flow_type | Unsteady |
| hdf_path | C:\Users\billk_clb\anaconda3\envs\rascmdr_pipt... |
| hdf_exists | True |
| hdf_mtime | 2026-01-11 20:52:17.256237 |
| completed | True |
| has_errors | False |
| has_warnings | False |
| error_count | 0 |
| warning_count | 0 |
| first_error_line | None |
| rt_simulation_start | None |
| rt_simulation_end | None |
| rt_simulation_hours | None |
| rt_complete_process_hours | None |
| rt_unsteady_compute_hours | None |
| rt_complete_process_speed | None |
| unsteady_time_of_maximum_stage | None |
| unsteady_time_of_maximum_velocity | None |
| unsteady_time_of_maximum_flow | None |
| unsteady_computation_interval | None |
| steady_solution | NaN |
HEC-RAS Plan Parameters Reference¶
Parameter Documentation¶
- HEC-RAS User's Manual - Chapter 5: Simulation window options https://www.hec.usace.army.mil/software/hec-ras/documentation.aspx
- Technical Reference - Section 2: Computation methods and intervals
Common Parameters¶
Computation Intervals:
- Computation Interval: Timestep for hydraulic calculations (seconds)
- Output Interval: Frequency of results saved to HDF (seconds)
- Mapping Interval: Frequency for RAS Mapper output (seconds)
Simulation Timing:
- Simulation Date: Start date/time (format: DDMMMYYYY,HHMM)
- End Date: End of simulation period
LLM Forward: Parameter Change Tracking¶
Create audit trail for parameter modifications:
def audit_parameter_changes(plan_number, changes_dict, output_file):
# Document all parameter changes
audit_record = {
'plan_number': plan_number,
'timestamp': datetime.now().isoformat(),
'changes': []
}
for param_name, (old_val, new_val) in changes_dict.items():
audit_record['changes'].append({
'parameter': param_name,
'original_value': str(old_val),
'new_value': str(new_val),
'change_type': type(new_val).__name__
})
# Export audit record
import json
with open(output_file, 'w') as f:
json.dump(audit_record, f, indent=2)
print(f"Parameter changes documented: {output_file}")
# Usage
changes = {
'Computation Interval': (10, 5),
'Output Interval': (60, 30),
'Mapping Interval': (3600, 1800)
}
audit_parameter_changes(
plan_number,
changes,
project_folder / 'parameter_audit.json'
)
This provides: - Change history: Know what was modified when - Reproducibility: Revert changes if needed - Peer review: Non-programmers can verify modifications
Summary¶
In this notebook, we covered essential operations for manipulating HEC-RAS plan files programmatically:
- Project Initialization:
init_ras_project()populates DataFrames with project metadata - Run Flags:
RasPlan.update_run_flags()controls which HEC-RAS components execute - Plan Intervals:
RasPlan.update_plan_intervals()sets computation and output timesteps - Descriptions for All File Types:
- Plans:
RasPlan.read_plan_description()/update_plan_description() - Geometry:
RasPlan.read_geom_description()/update_geom_description() - Steady Flow:
RasPlan.read_flow_description()/update_flow_description() - Unsteady Flow:
RasUnsteady.read_unsteady_description()/update_unsteady_description() - Simulation Dates:
RasPlan.update_simulation_date()for unsteady analysis periods - DataFrame Access: Descriptions available via
ras.plan_df['description'],ras.geom_df['description'],ras.geom_df['geom_title'],ras.flow_df['description'],ras.unsteady_df['description']
Key Classes¶
| Class | Methods |
|---|---|
RasPlan |
get_plan_value(), update_run_flags(), update_plan_intervals(), read_plan_description(), update_plan_description(), read_geom_description(), update_geom_description(), read_flow_description(), update_flow_description(), update_simulation_date() |
RasUnsteady |
read_unsteady_description(), update_unsteady_description() |
RasCmdr |
compute_plan() |
Related Notebooks¶
- 103_plan_and_geometry_operations.ipynb - Plan cloning fundamentals
- 110_single_plan_execution.ipynb - Execute parameterized plans
- 101_project_initialization.ipynb - Project structure basics