xiaohongshu
xiaohongshu
atlas14-spatial-variance
Analyze spatial variability of NOAA Atlas 14 precipitation frequency estimates within HEC-RAS model domains using intelligent extent-based downloading. Helps determine whether uniform rainfall assumptions are appropriate for rain-on-grid modeling by calculating min/max/mean/range statistics with...
Full skill instructions
User-invocable skill for assessing precipitation spatial variability in HEC-RAS models
Complete Workflows (lines 540-629):
ras_commander/precip/CLAUDE.md
API Reference:
ras_commander/precip/Atlas14Grid.py (404 lines)
get_pfe_from_project() - Main entry point for HEC-RAS integrationget_pfe_for_bounds() - Direct bounding box queryget_point_pfe() - Single point lookupras_commander/precip/Atlas14Variance.py (322 lines)
analyze() - Full variance analysisanalyze_quick() - Rapid assessment (100-yr, 24-hr)is_uniform_rainfall_appropriate() - Decision supportgenerate_report() - Export with plotsWorking Example:
examples/725_atlas14_spatial_variance.ipynb
Quick Reference:
.claude/rules/hec-ras/precipitation.md (lines 104-126)from ras_commander.precip import Atlas14Variance
# Step 1: Quick check for representative event
stats = Atlas14Variance.analyze_quick("MyProject.g01.hdf")
# Step 2: Interpret results
if stats['range_pct'] > 10:
# High variance - run full analysis
results = Atlas14Variance.analyze(
geom_hdf="MyProject.g01.hdf",
durations=[6, 12, 24],
return_periods=[10, 25, 50, 100]
)
# Step 3: Generate report
Atlas14Variance.generate_report(
results,
output_dir="Atlas14_Report",
project_name="My Project"
)
else:
# Low variance - uniform rainfall OK
print("✓ Uniform rainfall appropriate")
from ras_commander.precip import Atlas14Grid
# Get PFE for project extent
pfe = Atlas14Grid.get_pfe_from_project(
geom_hdf="MyProject.g01.hdf",
extent_source="2d_flow_area", # or "project_extent"
durations=[6, 12, 24],
return_periods=[10, 50, 100],
buffer_percent=10.0
)
# Access data
print(f"Grid size: {pfe['lat'].shape[0]} x {pfe['lon'].shape[0]}")
print(f"100-yr 24-hr max: {pfe['pfe_24hr'][:,:,5].max():.2f} inches")
# Quick lookup for single location
df = Atlas14Grid.get_point_pfe(
lat=29.76,
lon=-95.37,
durations=[6, 12, 24],
return_periods=[10, 50, 100, 500]
)
print(df)
| Range % | Interpretation | Recommendation |
|---|---|---|
| < 5% | Very low variance | Uniform rainfall appropriate |
| 5-10% | Low variance | Uniform likely OK, monitor |
| 10-20% | Moderate variance | Consider spatially variable |
| > 20% | High variance | Use spatially variable rainfall |
Representative Event: 100-year, 24-hour is typical for quick assessment
Purpose: Rapid check if variance analysis is needed
See: ras_commander/precip/CLAUDE.md lines 544-564
from ras_commander.precip import Atlas14Variance
stats = Atlas14Variance.analyze_quick("MyProject.g01.hdf")
if stats['range_pct'] > 10:
print("⚠️ Run full analysis - high variance detected")
Purpose: Comprehensive variance across multiple events
See: ras_commander/precip/CLAUDE.md lines 566-585
results = Atlas14Variance.analyze(
geom_hdf="MyProject.g01.hdf",
durations=[6, 12, 24, 48],
return_periods=[10, 25, 50, 100, 500],
extent_source="2d_flow_area",
variance_denominator='min', # or 'max', 'mean'
output_dir="Atlas14_Variance_Report"
)
Purpose: Engineering documentation
See: ras_commander/precip/CLAUDE.md lines 587-605
report_dir = Atlas14Variance.generate_report(
results_df=results,
output_dir="reports/",
project_name="My Project",
include_plots=True
)
# Files created:
# - variance_statistics.csv
# - variance_summary.csv
# - variance_by_duration.png
# - variance_heatmap.png
Purpose: Export for HEC-RAS import or custom processing
See: ras_commander/precip/CLAUDE.md lines 607-629
from ras_commander.precip import Atlas14Grid
pfe = Atlas14Grid.get_pfe_from_project(
geom_hdf="MyProject.g01.hdf",
extent_source="2d_flow_area",
durations=[24],
return_periods=[100]
)
# Access raw arrays for custom analysis
lat = pfe['lat']
lon = pfe['lon']
data_100yr_24hr = pfe['pfe_24hr'][:, :, 5]
Controls which geometry is used for extent extraction:
"2d_flow_area" (default, recommended)
mesh_area_names"project_extent"
Controls whether to use HUC12 watershed instead of 2D flow area:
False (default)
True
pygeohydro packageExample:
# Analyze using HUC12 watershed
results = Atlas14Variance.analyze(
geom_hdf="MyProject.g01.hdf",
use_huc12_boundary=True
)
Controls how range percentage is calculated:
'min' (default) - range_pct = (max - min) / min × 100
'max' - range_pct = (max - min) / max × 100
'mean' - range_pct = (max - min) / mean × 100
URL: https://hdsc.nws.noaa.gov/pub/hdsc/data/tx/NOAA_Atlas_14_CONUS.nc
| Property | Value |
|---|---|
| Coverage | CONUS (24°N-50°N, -125°W to -66°W) |
| Resolution | ~0.0083° (~830m at 30°N) |
| Format | HDF5-based NetCDF-4 |
| Size | 320 MB (chunked for efficient access) |
| Chunking | (49, 111, 1) - optimized for spatial access |
| HTTP Support | Accept-Ranges: bytes ✓ |
Available Data:
| Project Size | Grid Cells | Data Transfer | Full Grid | Reduction |
|---|---|---|---|---|
| Small (0.5° × 0.5°) | ~3,600 | ~60 KB | 379 MB | 99.98% |
| Medium (1° × 1°) | ~14,400 | ~250 KB | 379 MB | 99.93% |
| Large (2° × 2°) | ~57,600 | ~1 MB | 379 MB | 99.74% |
Comparison: Traditional approach downloads 50-100 MB per state as ZIP files.
The NOAA CONUS NetCDF covers Continental US only:
Covered: Lower 48 states (24°N-50°N, -125°W to -66°W)
Not Covered:
Atlas14Grid requires internet access to NOAA servers:
Atlas14Grid.clear_cache())The ari dimension uses return periods, not ARI indices:
ari = [2, 5, 10, 25, 50, 100, 200, 500, 1000]
# 100-year event is index 5
pfe_100yr = pfe['pfe_24hr'][:, :, 5] # Correct
# NOT index 100
pfe_100yr = pfe['pfe_24hr'][:, :, 100] # Wrong!
Required (already in ras-commander):
h5py>=3.0.0 - HDF5/NetCDF accessnumpy - Array operationspandas - DataFramesgeopandas>=0.12.0 - Spatial operationsfsspec>=2023.0.0 - Remote file systems (HTTP)Optional:
matplotlib - Plotting (for generate_report())rioxarray - Enhanced raster operations (future)Installation:
pip install ras-commander # All required deps included
For complete workflows: Read ras_commander/precip/CLAUDE.md lines 540-629
For API details: Read docstrings in:
ras_commander/precip/Atlas14Grid.pyras_commander/precip/Atlas14Variance.pyFor working code: Run examples/725_atlas14_spatial_variance.ipynb
For quick reference: See .claude/rules/hec-ras/precipitation.md lines 104-126
For research background: See .claude/outputs/atlas14-variance-research-summary.md
Use Atlas14Grid/Variance when:
Use StormGenerator when:
The HTTP range request approach downloads exactly the grid cells within the specified extent. Validation shows:
The CONUS NetCDF covers the entire Continental US in a single file, so:
This is a major advantage over HEC-Commander's approach, which requires downloading separate state datasets and manually merging them.
Current: Atlas14Grid returns numpy arrays - export to GeoTIFF/NetCDF not yet implemented
Workaround: Use the data for variance analysis, then use StormGenerator or Atlas14Storm to create HEC-RAS precipitation input files
Future: Planned enhancement for direct GeoTIFF/NetCDF export
When user asks to:
Respond with:
Quick Check First:
from ras_commander.precip import Atlas14Variance
stats = Atlas14Variance.analyze_quick("project.g01.hdf")
print(f"Range: {stats['range_pct']:.1f}%")
Interpret Results:
Full Analysis if Needed:
results = Atlas14Variance.analyze("project.g01.hdf")
ok, msg = Atlas14Variance.is_uniform_rainfall_appropriate(results)
print(msg)
Generate Report:
Atlas14Variance.generate_report(
results,
output_dir="Atlas14_Report",
include_plots=True
)
Related Skills:
/analyzing-aorc-precipitation - Historic gridded precipitation/atlas14-design-storms - Hyetograph generationRelevant Agents:
precipitation-specialist - General precipitation workflowshdf-analyst - Extract HEC-RAS geometry for extentComplementary Classes:
StormGenerator - Point-based design storms (see ras_commander/precip/CLAUDE.md lines 44-77)Atlas14Storm - HMS-equivalent hyetographs (lines 79-116)PrecipAorc - Historic AORC data (lines 13-42)Scenario: Determine if uniform rainfall is valid before running rain-on-grid model
from ras_commander.precip import Atlas14Variance
# Quick check
stats = Atlas14Variance.analyze_quick("MyProject.g01.hdf")
if stats['range_pct'] <= 10:
print("Proceed with uniform rainfall")
# Run HEC-RAS with single precipitation source
else:
print("Consider spatially variable rainfall")
# Run full analysis to quantify
Scenario: Compare variance across multiple design storms
results = Atlas14Variance.analyze(
geom_hdf="MyProject.g01.hdf",
durations=[6, 12, 24, 48],
return_periods=[10, 25, 50, 100, 200, 500]
)
# Find highest variance event
worst = results.loc[results['range_pct'].idxmax()]
print(f"Highest variance: {worst['duration_hr']}-hr, {worst['return_period_yr']}-yr")
print(f"Range: {worst['range_pct']:.1f}%")
Scenario: Generate documentation for design report
# Full analysis
results = Atlas14Variance.analyze("MyProject.g01.hdf")
# Generate report with plots
report_dir = Atlas14Variance.generate_report(
results,
output_dir="Engineering_Report/Atlas14_Variance",
project_name="Smith Creek Dam",
include_plots=True
)
# Files suitable for inclusion in engineering documentation
Scenario: Analyze variance for specific mesh areas only
pfe = Atlas14Grid.get_pfe_from_project(
geom_hdf="MyProject.g01.hdf",
extent_source="2d_flow_area",
mesh_area_names=["Floodplain_Upper", "Floodplain_Lower"],
durations=[24],
return_periods=[100]
)
# Only analyzes specified mesh areas
Cause: Missing fsspec dependency
Fix:
pip install fsspec>=2023.0.0
# or
pip install --upgrade ras-commander
Cause: Project extent outside CONUS coverage
Check:
from ras_commander.hdf import HdfProject
bounds = HdfProject.get_project_bounds_latlon("project.g01.hdf")
print(f"Project bounds: {bounds}")
# Valid CONUS: lon=-125 to -66, lat=24 to 50
Solution: Project must be within Continental US
Possible Causes:
Validation:
Causes:
Check:
# Test server availability
if Atlas14Grid.is_available():
print("NOAA server reachable")
else:
print("Cannot reach NOAA server - check network")
Don't run full analysis unless needed:
# Quick check is fast (~5 seconds)
stats = Atlas14Variance.analyze_quick("project.g01.hdf")
# Only run full analysis if variance is high
if stats['range_pct'] > 10:
results = Atlas14Variance.analyze("project.g01.hdf")
Coordinates are cached after first access:
# First call downloads coordinates (~11 seconds)
pfe1 = Atlas14Grid.get_pfe_for_bounds(...)
# Subsequent calls use cache (much faster)
pfe2 = Atlas14Grid.get_pfe_for_bounds(...)
# Clear cache when done to free memory
Atlas14Grid.clear_cache()
Smaller extent = less data transfer:
# Use 2D flow areas (smaller) instead of project extent (larger)
pfe = Atlas14Grid.get_pfe_from_project(
geom_hdf="project.g01.hdf",
extent_source="2d_flow_area", # Smaller
buffer_percent=5.0 # Minimal buffer
)
Primary Documentation:
ras_commander/precip/CLAUDE.md - Complete precipitation workflows.claude/rules/hec-ras/precipitation.md - Quick reference guideRelated Features:
StormGenerator - Point-based Atlas 14 queries and hyetograph generationAtlas14Storm - HMS-equivalent temporal distributionsPrecipAorc - Historic gridded precipitation dataExample Notebooks:
examples/725_atlas14_spatial_variance.ipynb - This workflowexamples/720_atlas14_aep_events.ipynb - Point-based design stormsexamples/900_aorc_precipitation.ipynb - Historic precipitationResearch:
.claude/outputs/atlas14-variance-research-summary.md - Discovery of CONUS NetCDF approach.claude/outputs/atlas14-variance-implementation-summary.md - Implementation detailsxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience