SKILL.md
NWS Flood Thresholds Guide
Overview
The National Weather Service (NWS) maintains flood stage thresholds for thousands of stream gages across the United States. These thresholds define when water levels become hazardous.
Data Sources
Option 1: Bulk CSV Download (Recommended for Multiple Stations)
https://water.noaa.gov/resources/downloads/reports/nwps_all_gauges_report.csv
Option 2: Individual Station Pages
https://water.noaa.gov/gauges/<station_id>
Example: https://water.noaa.gov/gauges/04118105
Flood Stage Categories
| Category | CSV Column | Description |
|---|---|---|
| Action Stage | action stage | Water level requiring monitoring, preparation may be needed |
| Flood Stage (Minor) | flood stage | Minimal property damage, some public threat. Use this to determine if flooding occurred. |
| Moderate Flood Stage | moderate flood stage | Structure inundation, evacuations may be needed |
| Major Flood Stage | major flood stage | Extensive damage, significant evacuations required |
For general flood detection, use the flood stage column as the threshold.
Downloading Bulk CSV
import pandas as pd
import csv
import urllib.request
import io
nws_url = "https://water.noaa.gov/resources/downloads/reports/nwps_all_gauges_report.csv"
response = urllib.request.urlopen(nws_url)
content = response.read().decode('utf-8')
reader = csv.reader(io.StringIO(content))
headers = next(reader)
data = [row[:43] for row in reader] # Truncate to 43 columns
nws_df = pd.DataFrame(data, columns=headers)
