xiaohongshu
xiaohongshu
integrating-usgs-gauges
Complete USGS gauge data integration workflow from spatial discovery to model validation. Handles gauge finding, data retrieval, matching to HEC-RAS features, boundary condition generation, initial conditions, real-time monitoring, and validation metrics (NSE, KGE). Use when working with USGS dat...
Full skill instructions
Lightweight skill navigator - Points you to authoritative sources instead of duplicating content.
COMPLETE WORKFLOWS AND API REFERENCE:
ras_commander/usgs/CLAUDE.md (367 lines) - Complete module documentation with workflows
WORKING EXAMPLES:
examples/911_usgs_gauge_data_integration.ipynb - Complete workflow (discovery → validation)examples/912_usgs_real_time_monitoring.ipynb - Real-time monitoring examplesexamples/913_bc_generation_from_live_gauge.ipynb - Boundary condition generationexamples/914_model_validation_with_usgs.ipynb - Model validation workflowexamples/910_usgs_gauge_catalog.ipynb - Catalog generation (v0.89.0+)CODE DOCSTRINGS:
| Task | Primary Source | Secondary Source |
|---|---|---|
| API reference | ras_commander/usgs/CLAUDE.md | Code docstrings |
| Complete workflows | ras_commander/usgs/CLAUDE.md | Example notebooks |
| Spatial discovery | CLAUDE.md → Spatial Queries section | 421_usgs_*.ipynb |
| Data retrieval | CLAUDE.md → Data Retrieval section | 421_usgs_*.ipynb |
| Gauge matching | CLAUDE.md → Gauge Matching section | 421_usgs_*.ipynb |
| Boundary generation | CLAUDE.md → Boundary Conditions section | 423_bc_*.ipynb |
| Initial conditions | CLAUDE.md → Initial Conditions section | 423_bc_*.ipynb |
| Real-time monitoring | CLAUDE.md → Real-Time Monitoring section | 422_*.ipynb |
| Catalog generation | CLAUDE.md → Catalog Generation section | 420_*.ipynb |
| Model validation | CLAUDE.md → Validation Metrics section | 424_*.ipynb |
| Visualization | CLAUDE.md → Visualization section | 424_*.ipynb |
| Troubleshooting | Example notebooks (see errors/warnings) | Code comments |
From ras_commander/usgs/CLAUDE.md:
Core Data Retrieval (core.py):
RasUsgsCore.retrieve_flow_data() - Get flow time seriesRasUsgsCore.retrieve_stage_data() - Get stage time seriesRasUsgsCore.get_gauge_metadata() - Get gauge infoRasUsgsCore.check_data_availability() - Check data existsSpatial Discovery (spatial.py):
UsgsGaugeSpatial.find_gauges_in_project() - Find gauges in project boundsUsgsGaugeSpatial.get_project_gauges_with_data() - Find gauges with data for sim periodGauge Matching (gauge_matching.py):
GaugeMatcher.auto_match_gauges() - Automatic matchingGaugeMatcher.match_gauge_to_cross_section() - Match to 1D XSGaugeMatcher.match_gauge_to_2d_area() - Match to 2D areaTime Series (time_series.py):
RasUsgsTimeSeries.resample_to_hecras_interval() - Resample to HEC-RAS intervalsRasUsgsTimeSeries.check_data_gaps() - Detect gapsRasUsgsTimeSeries.align_timeseries() - Align observed/modeledBoundary Generation (boundary_generation.py):
RasUsgsBoundaryGeneration.generate_flow_hydrograph_table() - Create BC tableRasUsgsBoundaryGeneration.update_boundary_hydrograph() - Update .u## fileInitial Conditions (initial_conditions.py):
InitialConditions.create_ic_line() - Generate IC lineInitialConditions.get_ic_value_from_usgs() - Extract IC from USGS dataReal-Time (real_time.py) - v0.87.0+:
RasUsgsRealTime.get_latest_value() - Get most recent readingRasUsgsRealTime.monitor_gauge() - Continuous monitoring with callbacksRasUsgsRealTime.detect_threshold_crossing() - Flood detectionCatalog (catalog.py) - v0.89.0+:
catalog.generate_gauge_catalog() - Create standardized gauge catalogcatalog.load_gauge_catalog() - Load catalogcatalog.load_gauge_data() - Load historical dataValidation (metrics.py):
metrics.nash_sutcliffe_efficiency() - NSE metricmetrics.kling_gupta_efficiency() - KGE metricmetrics.calculate_all_metrics() - Complete validation suiteVisualization (visualization.py):
visualization.plot_timeseries_comparison() - Observed vs modeled plotsvisualization.plot_scatter_comparison() - Scatter with 1:1 linevisualization.plot_residuals() - 4-panel diagnosticsFile I/O (file_io.py):
RasUsgsFileIo.cache_gauge_data() - Save to CSVRasUsgsFileIo.load_cached_gauge_data() - Load from CSVFor complete quick start, see ras_commander/usgs/CLAUDE.md.
Basic pattern (copy-paste starting point):
from ras_commander import init_ras_project
from ras_commander.usgs import UsgsGaugeSpatial, RasUsgsCore, GaugeMatcher
# Initialize
init_ras_project(r"C:\Projects\MyModel", "6.5")
# 1. Find gauges
gauges = UsgsGaugeSpatial.find_gauges_in_project(
project_folder=r"C:\Projects\MyModel",
buffer_miles=5.0
)
# 2. Get data
flow_data = RasUsgsCore.retrieve_flow_data(
site_no="01646500",
start_date="2023-09-01",
end_date="2023-09-15",
service='iv' # Instantaneous values
)
# 3. Match to model
matches = GaugeMatcher.auto_match_gauges(
gauges_gdf=gauges,
project_folder=r"C:\Projects\MyModel"
)
# For complete workflow, see ras_commander/usgs/CLAUDE.md
See: ras_commander/usgs/CLAUDE.md → "Complete Workflow" section → Stage 5
Example: examples/913_bc_generation_from_live_gauge.ipynb
See: ras_commander/usgs/CLAUDE.md → "Complete Workflow" section → Stage 6
Example: examples/914_model_validation_with_usgs.ipynb
See: ras_commander/usgs/CLAUDE.md → "Real-Time Workflows" section
Example: examples/912_usgs_real_time_monitoring.ipynb
See: ras_commander/usgs/CLAUDE.md → "Complete Workflow" section → Stage 7
Example: examples/910_usgs_gauge_catalog.ipynb
ModuleNotFoundError: No module named 'dataretrieval'
Solution: pip install dataretrieval
Check:
buffer_miles parameterSee: examples/911_usgs_*.ipynb for spatial discovery debugging
Tools:
RasUsgsTimeSeries.check_data_gaps() - Detect gapsRasUsgsTimeSeries.fill_data_gaps() - Interpolate gapsSee: ras_commander/usgs/CLAUDE.md → Time Series Processing
Check:
15MIN, 1HOUR, etc.)validate_boundary_format() to check formatSee: examples/913_bc_*.ipynb for boundary generation debugging
Investigate:
See: examples/914_*.ipynb for validation workflow
Required (always available):
Optional (lazy-loaded):
dataretrieval - USGS NWIS client (recommended)
pip install dataretrievalCheck dependencies:
from ras_commander.usgs import check_dependencies
deps = check_dependencies()
print(deps) # {'pandas': True, 'geopandas': True, 'dataretrieval': True/False}
See: ras_commander/usgs/CLAUDE.md → Validation Metrics section for complete details.
Quick reference:
0.75: Very good
For detailed interpretation: See examples/914_model_validation_with_usgs.ipynb
See: ras_commander/usgs/CLAUDE.md → Key Features for details
.claude/skills/executing-hecras-plans/.claude/skills/extracting-hecras-results/ras_commander.precipitation moduleras_commander.RasUnsteadyThis skill is intentionally lightweight (~300 lines) and serves as a navigator to authoritative sources rather than duplicating content. This approach:
ras_commander/usgs/CLAUDE.md (367 lines)When to use this skill:
When to read full docs:
ras_commander/usgs/CLAUDE.mdxiaohongshu
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