Retrieves and processes AORC precipitation data for HEC-RAS/HMS models. Handles spatial averaging over watersheds, temporal aggregation, DSS export, and Atlas 14 design storms...
Purpose: Navigate precipitation workflows for HEC-RAS/HMS models using AORC historical data and Atlas 14 design storms.
This skill is a NAVIGATOR -- read the primary sources below for complete workflows and API documentation. Do not duplicate implementation details here.
ras_commander/precip/AGENTS.md - canonical local contract
Contains:
Use source docstrings for method signatures and parameter details.
examples/900_aorc_precipitation.ipynb
Live working example showing:
examples/720_atlas14_aep_events.ipynb
Complete design storm workflow:
examples/722_atlas14_multi_project.ipynb
Advanced batch processing:
from ras_commander.precip import PrecipAorc
# Retrieve hourly AORC data for watershed
aorc_data = PrecipAorc.retrieve_aorc_data(
watershed="02070010", # HUC-8 code or shapefile path
start_date="2015-05-01",
end_date="2015-05-15"
)
# Spatial average over watershed
avg_precip = PrecipAorc.spatial_average(aorc_data, watershed)
# Aggregate to HEC-RAS interval
hourly = PrecipAorc.aggregate_to_interval(avg_precip, interval="1HR")
# Export to DSS for HEC-RAS
PrecipAorc.export_to_dss(
hourly,
dss_file="precipitation.dss",
pathname="/PROJECT/PRECIP/AORC//1HOUR/OBS/"
)
from ras_commander.precip import StormGenerator
# Get 24-hr, 1% AEP (100-year) precipitation
precip = StormGenerator.get_precipitation_frequency(
location=(38.9, -77.0), # lat, lon
duration_hours=24,
aep_percent=1.0
)
# Generate SCS Type II distribution
hyetograph = StormGenerator.generate_design_storm(
total_precip=precip,
duration_hours=24,
distribution="SCS_Type_II",
interval_minutes=15
)
# Export to HEC-RAS DSS
StormGenerator.export_to_dss(
hyetograph,
dss_file="design_storm.dss",
pathname="/PROJECT/PRECIP/DESIGN//15MIN/SYN/"
)
Details: See ras_commander/precip/AGENTS.md and examples/900_aorc_precipitation.ipynb
Details: See ras_commander/precip/AGENTS.md and the Atlas 14 reference notebooks
Details: See examples/104_Atlas14_AEP_Multi_Project.ipynb
Data Retrieval:
retrieve_aorc_data() - Download AORC time series for watershedget_available_years() - Query available data years (1979-present)check_data_coverage() - Verify spatial and temporal coverageSpatial Processing:
spatial_average() - Calculate areal average over watershedextract_by_watershed() - Extract data for HUC or custom polygonresample_grid() - Aggregate AORC grid cells to coarser resolutionTemporal Processing:
aggregate_to_interval() - Aggregate to HEC-RAS/HMS intervals (1HR, 6HR, 1DAY)extract_storm_events() - Identify and extract individual storm eventscalculate_rolling_totals() - Compute N-hour rolling precipitation totalsOutput Formats:
export_to_dss() - DSS format for HEC-RAS/HMSto_csv() - CSV time series for HEC-HMSto_netcdf() - NetCDF for further analysisDesign Storm Creation:
generate_design_storm() - Create Atlas 14 design storm hyetographget_precipitation_frequency() - Query Atlas 14 point precipitation valuesapply_temporal_distribution() - Apply standard temporal patterns (SCS Type II, etc.)Spatial Processing:
apply_areal_reduction() - Apply ARF for large watershedsinterpolate_point_values() - Interpolate Atlas 14 values to gridgenerate_multi_point_storms() - Spatially distributed design stormsOutput Formats:
export_to_dss() - HEC-RAS DSS precipitationexport_to_hms_gage() - HEC-HMS precipitation gage fileto_csv() - Tabular hyetograph (CSV)Full method signatures and parameters: Read source docstrings in ras_commander/precip/.
from ras_commander.precip import PrecipAorc
from ras_commander import init_ras_project
from ras_commander.hdf import HdfProject
# Initialize project
ras = init_ras_project("path/to/project", "7.0")
# Get project bounds from geometry HDF
geom_hdf = ras.project_folder / f"{ras.project_name}.g09.hdf"
bounds = HdfProject.get_project_bounds_latlon(
geom_hdf,
buffer_percent=50.0 # 50% buffer ensures full coverage
)
# Generate storm catalog
catalog = PrecipAorc.get_storm_catalog(
bounds=bounds,
year=2020,
inter_event_hours=8.0, # USGS standard for storm separation
min_depth_inches=0.75, # Minimum significant precipitation
buffer_hours=48 # Simulation warmup buffer
)
# Returns DataFrame with:
# storm_id, start_time, end_time, sim_start, sim_end,
# total_depth_in, peak_intensity_in_hr, duration_hours, rank
Complete workflow: See examples/900_aorc_precipitation.ipynb
from ras_commander.precip import StormGenerator
# Define AEP suite
aep_events = [10, 4, 2, 1, 0.5, 0.2] # 10%, 4%, 2%, 1%, 0.5%, 0.2%
for aep in aep_events:
# Query Atlas 14
precip = StormGenerator.get_precipitation_frequency(
location=(38.9, -77.0),
duration_hours=24,
aep_percent=aep
)
# Generate design storm
hyetograph = StormGenerator.generate_design_storm(
total_precip=precip,
duration_hours=24,
distribution="SCS_Type_II"
)
# Export to DSS
dss_file = f"design_storm_{aep}pct.dss"
StormGenerator.export_to_dss(hyetograph, dss_file)
Complete multi-project workflow: See examples/722_atlas14_multi_project.ipynb
Required:
Optional:
Installation:
pip install ras-commander[precip] # Includes all precipitation dependencies
# OR
pip install xarray rasterio geopandas
When you need...
ā Read ras_commander/precip/AGENTS.md for method selection, then source docstrings for signatures
ā Open examples/900_aorc_precipitation.ipynb (live working code)
ā Open examples/720_atlas14_aep_events.ipynb
ā Open examples/722_atlas14_multi_project.ipynb
ā Read source docstrings in ras_commander/precip/
ā Read the relevant precipitation source module and reference notebook
ā Read ras_commander/precip/AGENTS.md and the source module for the data provider
ras_commander/precip/AGENTS.md for package rules and source docstrings for API detailsAORC Data Retrieval:
Atlas 14 Queries:
Details: See the relevant source module and reference notebook.
Rules (follow these):
.claude/rules/hec-ras/precipitation.md -- Precipitation domain overview.claude/rules/testing/precipitation-method-validation.md -- Testing precipitation methodsAgents (delegate when needed):
precipitation-specialist -- Delegate for complex precipitation workflowsSkills (related workflows):
precip_analyze_atlas14-variance -- Use for Atlas 14 design storm analysisdss_read_boundary-data -- Use when exporting precipitation to DSS formathecras_compute_plans -- Use downstream after generating rain-on-grid boundariesPrimary sources:
ras_commander/AGENTS.md -- Precipitation sectionras_commander/precip/AGENTS.mdThis skill is a lightweight index -- detailed content lives in primary sources.