Meteorologic Models¶
Managing precipitation, evapotranspiration, and gage assignments in HEC-HMS meteorologic models (.met).
Overview¶
The HmsMet class provides methods for working with meteorologic model files, including precipitation methods, gage assignments, and frequency storm parameters.
Quick Examples¶
Get Gage Assignments¶
from hms_commander import HmsMet
# Read gage assignments
gages_df = HmsMet.get_gage_assignments("model.met")
print(gages_df)
Update Gage Assignment¶
# Assign gage to subbasin
HmsMet.set_gage_assignment(
"model.met",
subbasin="Sub1",
gage="Precip_Gage_1"
)
Update Precipitation Depths (Atlas 14)¶
# Update TP-40 to Atlas 14 depths
atlas14_depths = [2.5, 3.1, 3.8, 4.5, 5.2, 6.0]
HmsMet.update_tp40_to_atlas14(
"model.met",
atlas14_depths=atlas14_depths
)
Key Operations¶
- Precipitation methods -
get_precipitation_method(),set_precipitation_method() - Gage assignments -
get_gage_assignments(),set_gage_assignment() - Frequency storms -
get_frequency_storm_params(),set_precipitation_depths() - Clone workflow -
clone_met()for QAQC comparisons
Reproducing the HMS Frequency Storm hyetograph¶
BalancedFrequencyStorm.generate_hyetograph() generates a balanced (nested,
alternating-block) hyetograph from a depth-duration table, including the supported
storm-area reduction and partial-to-annual conversion options. It is checked
against 68 HEC-HMS 4.13 fixture cases to a 0.001-in per-interval and total-depth
tolerance; this validation does not establish equivalence outside that matrix. The
older FrequencyStorm class is a different, fixed-pattern HCFCD generator. See
BalancedFrequencyStorm for HEC manual
references, observed 4.13 differences from the Technical Reference Manual, and
unvalidated/unsupported HMS options.
from hms_commander import BalancedFrequencyStorm
hyeto = BalancedFrequencyStorm.generate_hyetograph(
{5: 1.17, 10: 1.88, 15: 2.32, 30: 3.2, 60: 4.27, 120: 5.77, 180: 6.82,
360: 8.63, 720: 10.3, 1440: 12.1},
total_duration_min=1440, time_interval_min=15, peak_position_pct=67,
storm_area_sqmi=0)
Atlas 14 Updates¶
HMS Commander includes specialized support for updating precipitation from TP-40 to NOAA Atlas 14:
# Get current depths
depths = HmsMet.get_precipitation_depths("model.met")
# Update to Atlas 14 (from API or manual entry)
HmsMet.update_tp40_to_atlas14("model.met", new_depths)
Related Topics¶
- API Reference: HmsMet - Complete method documentation
- Atlas 14 Updates - Precipitation frequency updates
- Time-Series Gages - Gage file management
- Data Formats: Met File - HMS .met file format
For complete API documentation, see HmsMet API Reference