ScsTypeStorm¶
SCS Type I, IA, II, and III hyetograph generation helpers.
hms_commander.ScsTypeStorm
¶
ScsTypeStorm - SCS Type I, IA, II, III Hyetograph Generation for HEC-HMS
Generates precipitation hyetographs using NRCS SCS temporal distributions, matching the algorithm used by HEC-HMS "Hypothetical Storm -> SCS" exactly.
SCS Storm Types
- Type I: Pacific Coast (Alaska, California, Oregon, Washington)
- Type IA: Pacific Northwest coastal regions
- Type II: Most of the continental US (standard)
- Type III: Gulf of Mexico and Atlantic coastal areas
Algorithm
- Load built-in SCS cumulative distribution (1441 values for 24hr @ 1min)
- Interpolate to requested time interval
- Convert cumulative to incremental depths
- Scale to total storm depth
CRITICAL: Duration is ALWAYS 24 hours (1440 minutes). This is a HEC-HMS constraint - SCS storms are hardcoded to 24hr duration. Use FrequencyStorm for variable duration storms.
Time Axis
Output DataFrames include a t=0 zero-sentinel row. Row 0 has hour=0.0 and incremental_depth=0.0; subsequent rows are interval end times, so a 24-hour storm ends at hour=24.0.
Pattern Data
Extracted from HEC-HMS 4.13 source code (aH.java) Arrays contain 1441 cumulative values (0 to 1) at 1-minute intervals Bundled as .npy files in hms_commander/data/
Reference
- NRCS TR-55 (Technical Release 55)
- HEC-HMS Technical Reference Manual
Example
from hms_commander import ScsTypeStorm
Generate 100-year, 24-hour Type II storm¶
hyeto = ScsTypeStorm.generate_hyetograph( ... total_depth_inches=10.0, ... scs_type='II' ... ) print(hyeto.columns.tolist()) ['hour', 'incremental_depth', 'cumulative_depth'] print(f"Generated {len(hyeto)} time steps") print(f"Total depth: {hyeto['cumulative_depth'].iloc[-1]:.6f} inches")
ScsTypeStorm
¶
Static class for generating SCS Type I, IA, II, III hyetographs.
Implements the same algorithm as HEC-HMS "Hypothetical Storm" with SCS distribution type.
All methods are static - no instantiation required.
Attributes:
| Name | Type | Description |
|---|---|---|
SCS_TYPES |
List of valid SCS type identifiers |
|
DURATION_MINUTES |
Fixed duration (1440 = 24 hours, HMS constraint) |
Example
from hms_commander import ScsTypeStorm
Generate Type II storm with 10 inches total depth¶
hyeto = ScsTypeStorm.generate_hyetograph( ... total_depth_inches=10.0, ... scs_type='II', ... time_interval_min=60 # 1-hour intervals ... ) print(f"Total: {hyeto.sum():.6f} inches") print(f"Peak: {hyeto.max():.3f} inches")
Source code in hms_commander/ScsTypeStorm.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 | |
generate_hyetograph(total_depth_inches, scs_type='II', time_interval_min=60)
staticmethod
¶
Generate SCS Type hyetograph (incremental precipitation depths).
This matches HEC-HMS "Hypothetical Storm -> SCS Type" exactly. Duration is ALWAYS 24 hours (HEC-HMS constraint).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
total_depth_inches
|
float
|
Total storm precipitation depth (inches) |
required |
scs_type
|
str
|
SCS distribution type ('I', 'IA', 'II', or 'III') - Type I: Pacific Coast (AK, CA, OR, WA) - peak at ~41% - Type IA: Pacific Northwest coastal - peak at ~32% - Type II: Most of continental US - peak at ~50% - Type III: Gulf/Atlantic coastal - peak at ~50% |
'II'
|
time_interval_min
|
int
|
Output time step in minutes (default: 60) Common values: 5, 10, 15, 30, 60 minutes Note: Storm is ALWAYS 24 hours (1440 min) regardless of interval |
60
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame with columns: - 'hour': Time in hours from storm start (float) - 'incremental_depth': Precipitation depth for this interval (inches) - 'cumulative_depth': Cumulative precipitation depth (inches) |
DataFrame
|
Length = 1440 / time_interval_min + 1 (includes t=0 sentinel); |
DataFrame
|
the final row is hour=24.0. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If scs_type is not valid or interval invalid |
Example
Type II storm (most common)¶
hyeto = ScsTypeStorm.generate_hyetograph( ... total_depth_inches=10.0, ... scs_type='II', ... time_interval_min=60 ... ) print(f"Time steps: {len(hyeto)}") # 25 (24 hours + t=0) print(f"Total: {hyeto.sum():.6f} inches") # 10.000000 print(f"Peak: {hyeto.max():.3f} inches") # ~4.1 inches
Note
Duration is ALWAYS 24 hours (hardcoded in HMS). Use FrequencyStorm.generate_hyetograph() for variable durations.
Source code in hms_commander/ScsTypeStorm.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 | |
generate_all_types(total_depth_inches, time_interval_min=60)
staticmethod
¶
Generate hyetographs for all 4 SCS types.
Useful for comparison and sensitivity analysis.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
total_depth_inches
|
float
|
Total storm precipitation depth (inches) |
required |
time_interval_min
|
int
|
Output time step in minutes (default: 60) |
60
|
Returns:
| Type | Description |
|---|---|
Dict[str, DataFrame]
|
Dictionary mapping SCS type to DataFrame |
Dict[str, DataFrame]
|
Each DataFrame has columns: ['hour', 'incremental_depth', 'cumulative_depth'] |
Example
storms = ScsTypeStorm.generate_all_types(10.0) for scs_type, hyeto in storms.items(): ... peak = hyeto['incremental_depth'].max() ... print(f"Type {scs_type}: peak={peak:.2f} inches")
Source code in hms_commander/ScsTypeStorm.py
get_peak_position(scs_type)
staticmethod
¶
Get expected peak position as fraction of storm duration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scs_type
|
str
|
SCS type ('I', 'IA', 'II', or 'III') |
required |
Returns:
| Type | Description |
|---|---|
float
|
Peak position as fraction (0.0 to 1.0) |
float
|
e.g., 0.5 = 50% of duration = 12 hours into 24-hour storm |
Example
pos = ScsTypeStorm.get_peak_position('II') print(f"Type II peak at {pos100:.0f}% = {pos24:.1f} hours") Type II peak at 50% = 12.0 hours
Source code in hms_commander/ScsTypeStorm.py
get_pattern_info(scs_type='II')
staticmethod
¶
Get information about SCS pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scs_type
|
str
|
SCS type to query |
'II'
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with pattern metadata |
Example
info = ScsTypeStorm.get_pattern_info('II') print(f"Peak at {info['peak_position']*100:.0f}% of duration")
Source code in hms_commander/ScsTypeStorm.py
validate_against_reference(hyetograph, reference)
staticmethod
¶
Compare generated hyetograph against reference (e.g., HMS output).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hyetograph
|
Union[DataFrame, ndarray]
|
Generated hyetograph (DataFrame or ndarray) If DataFrame, uses 'incremental_depth' column |
required |
reference
|
Union[DataFrame, ndarray]
|
Reference hyetograph (DataFrame or ndarray) If DataFrame, uses 'incremental_depth' column |
required |
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with comparison metrics |
Example
hyeto = ScsTypeStorm.generate_hyetograph(10.0, 'II') hms_ref = np.load("hms_type_ii_reference.npy") metrics = ScsTypeStorm.validate_against_reference(hyeto, hms_ref) print(f"RMSE: {metrics['rmse']:.6f} inches")
Source code in hms_commander/ScsTypeStorm.py
list_types()
staticmethod
¶
List all available SCS storm types.
Returns:
| Type | Description |
|---|---|
List[str]
|
List of SCS type identifiers |