← 返回 Skills 市场
wu-uk

nws-flood-thresholds

作者 wu-uk · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ✓ 安全检测通过
75
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install flood-risk-analysis-nws-flood-thresholds
功能描述
Download flood stage thresholds from NWS (National Weather Service). Use when determining flood levels for USGS stations, accessing action/minor/moderate/maj...
使用说明 (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/\x3Cstation_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)

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 Name Description
usgs id USGS station ID (8-digit string)
location name Station name/location
state Two-letter state code
action stage Action threshold (feet)
flood stage Minor flood threshold (feet)
moderate flood stage Moderate flood threshold (feet)
major flood stage Major 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'] == '\x3CSTATE_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 = ['\x3Cid_1>', '\x3Cid_2>', '\x3Cid_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

Issue Cause Solution
Column mismatch error CSV has 44 data columns but 43 headers Truncate rows to 43 columns
Missing thresholds Station not in NWS database Skip station or use alternative source
Value is -9999 No threshold defined Filter out these values
Empty usgs id NWS-only station Filter 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
安全使用建议
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.
功能分析
Type: OpenClaw Skill Name: flood-risk-analysis-nws-flood-thresholds Version: 0.1.0 The skill bundle provides legitimate documentation and code snippets for retrieving flood stage data from the National Weather Service (NOAA). It uses standard Python libraries (pandas, urllib) to fetch and process a CSV file from an official government domain (water.noaa.gov). The code includes specific logic to handle a known formatting issue in the NWS data, and there are no signs of malicious intent, data exfiltration, or prompt injection.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install flood-risk-analysis-nws-flood-thresholds
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /flood-risk-analysis-nws-flood-thresholds 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
Bulk publish from all-task-skills-dedup
元数据
Slug flood-risk-analysis-nws-flood-thresholds
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

nws-flood-thresholds 是什么?

Download flood stage thresholds from NWS (National Weather Service). Use when determining flood levels for USGS stations, accessing action/minor/moderate/maj... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 75 次。

如何安装 nws-flood-thresholds?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install flood-risk-analysis-nws-flood-thresholds」即可一键安装,无需额外配置。

nws-flood-thresholds 是免费的吗?

是的,nws-flood-thresholds 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

nws-flood-thresholds 支持哪些平台?

nws-flood-thresholds 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 nws-flood-thresholds?

由 wu-uk(@wu-uk)开发并维护,当前版本 v0.1.0。

💬 留言讨论