nws-flood-thresholds

v0.1.0

Download flood stage thresholds from NWS (National Weather Service). Use when determining flood levels for USGS stations, accessing action/minor/moderate/maj...

0· 73·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for wu-uk/flood-risk-analysis-nws-flood-thresholds.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "nws-flood-thresholds" (wu-uk/flood-risk-analysis-nws-flood-thresholds) from ClawHub.
Skill page: https://clawhub.ai/wu-uk/flood-risk-analysis-nws-flood-thresholds
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install flood-risk-analysis-nws-flood-thresholds

ClawHub CLI

Package manager switcher

npx clawhub@latest install flood-risk-analysis-nws-flood-thresholds
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description (download NWS flood thresholds and match to USGS stations) matches the SKILL.md: it points to an NWS CSV and station pages and provides code to download, parse, filter, and map thresholds. No unrelated services, binaries, or credentials are requested.
Instruction Scope
The runtime instructions are narrowly scoped to fetching the NWS CSV, truncating a known header/data mismatch, converting columns to numeric, filtering, and matching by USGS id. The instructions do not ask the agent to read unrelated files, access other environment variables, or transmit data to other endpoints.
Install Mechanism
This is an instruction-only skill with no install spec and no code files beyond SKILL.md. No downloads or package installs are performed by the skill itself.
Credentials
No environment variables, credentials, or config paths are required. The only runtime dependency is outbound network access to water.noaa.gov (expected for this purpose).
Persistence & Privilege
always is false and the skill does not request persistent/global privileges or modify other skills. Normal autonomous invocation is permitted (platform default) but not excessive for this functionality.
Assessment
This skill is a straightforward how-to for obtaining NWS flood thresholds; before using it, ensure your agent/runtime can make outbound HTTPS requests to water.noaa.gov, and validate/handle CSV schema changes (the guide notes a known 43 vs 44 column mismatch). Treat incoming CSV data as untrusted: add error handling, null/-9999 checks, and explicit parsing to avoid subtle bugs. Preserve leading zeros when matching USGS IDs (use strings), consider caching to reduce repeated network calls, and verify the NWS endpoint is the current canonical source if you rely on this for operational decisions.

Like a lobster shell, security has layers — review code before you run it.

latestvk9755qg54c318rn2wy1fszzeys84wh0c
73downloads
0stars
1versions
Updated 1w ago
v0.1.0
MIT-0

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

CategoryCSV ColumnDescription
Action Stageaction stageWater level requiring monitoring, preparation may be needed
Flood Stage (Minor)flood stageMinimal property damage, some public threat. Use this to determine if flooding occurred.
Moderate Flood Stagemoderate flood stageStructure inundation, evacuations may be needed
Major Flood Stagemajor flood stageExtensive 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)

Important: CSV Column Mismatch

The NWS CSV has a known issue: header row has 43 columns but data rows have 44 columns. Always truncate data rows to match header count:

data = [row[:43] for row in reader]

Key Columns

Column NameDescription
usgs idUSGS station ID (8-digit string)
location nameStation name/location
stateTwo-letter state code
action stageAction threshold (feet)
flood stageMinor flood threshold (feet)
moderate flood stageModerate flood threshold (feet)
major flood stageMajor flood threshold (feet)

Converting to Numeric

Threshold columns need conversion from strings:

nws_df['flood stage'] = pd.to_numeric(nws_df['flood stage'], errors='coerce')

Filtering by State

# Get stations for a specific state
state_stations = nws_df[
    (nws_df['state'] == '<STATE_CODE>') &
    (nws_df['usgs id'].notna()) &
    (nws_df['usgs id'] != '') &
    (nws_df['flood stage'].notna()) &
    (nws_df['flood stage'] != -9999)
]

Matching Thresholds to Station IDs

# Build a dictionary of station thresholds
station_ids = ['<id_1>', '<id_2>', '<id_3>']
thresholds = {}

for _, row in nws_df.iterrows():
    usgs_id = str(row['usgs id']).strip()
    if usgs_id in station_ids:
        thresholds[usgs_id] = {
            'name': row['location name'],
            'flood': row['flood stage']
        }

Common Issues

IssueCauseSolution
Column mismatch errorCSV has 44 data columns but 43 headersTruncate rows to 43 columns
Missing thresholdsStation not in NWS databaseSkip station or use alternative source
Value is -9999No threshold definedFilter out these values
Empty usgs idNWS-only stationFilter by usgs id != ''

Best Practices

  • Always truncate CSV rows to match header count
  • Convert threshold columns to numeric before comparison
  • Filter out -9999 values (indicates no threshold defined)
  • Match stations by USGS ID (8-digit string with leading zeros)
  • Some stations may have flood stage but not action/moderate/major

Comments

Loading comments...