Skip to content

@mostlyrightmd/weather/climate

optional politenessMs: number

Polite delay (ms) between IEM CLI yearly requests. Forwarded to downloadCliRange. Default 1000 (IEM_CLI_POLITE_DELAY_MS).

optional signal: AbortSignal

Forward to the underlying fetcher; aborts the range download.

optional source: ClimateSourceFilter

Provenance filter. null/undefined (default) == "iem". Accepts {"iem", "cli", "cli.archive"}; "acis" throws (no ACIS leg here).


Single climate (CLI daily settlement) row. Projects the raw parser keys onto the public JOIN vocabulary. date/station/daily_summary_temp_high_f/ daily_summary_temp_low_f/daily_summary_report_type are the settlement contract; source + issued_at carry provenance.

daily_summary_report_type: string

Inferred CLI report type (final/preliminary/…).

daily_summary_temp_high_f: null | number

Daily high °F (int) or null. JOIN vocab — same as PairsRow.daily_summary_temp_high_f.

daily_summary_temp_low_f: null | number

Daily low °F (int) or null. JOIN vocab — same as PairsRow.daily_summary_temp_low_f.

issued_at_utc: null | string

ISO 8601 UTC issuance time when present, else null.

local_standard_date: string

Local climate day, YYYY-MM-DD (from the parser’s observation_date).

source: "iem"

Per-row endpoint tag — always "iem" for CLI.

station: string

Station code (as resolved from the caller’s input).

ClimateFrameSource: "cli.archive"

Frame-level source identity carried on the array climate() returns. Always the settlement PRODUCT tag "cli.archive" — distinct from the per-row endpoint tag "iem". Mirrors Python df.attrs["source"].


ClimateSourceFilter: "iem" | "cli" | "cli.archive" | null

Source filter for climate(). Mirrors the Python accept-set {None, "iem", "cli", "cli.archive"}. null/undefined (default) == "iem". "acis" is REJECTED (no ACIS leg in this code path) — matching Python’s ValueError.

climate(station, fromDate, toDate, opts): Promise<DataResult<ClimateRow>>

Fetch the NWS CLI daily settlement labels for a station’s window.

Mirrors Python mostlyright.weather.climate(station, from_date, to_date, *, source=None, ...). Composes the local CLI fetch path (year-granular download → parse → frozen mergeClimate dedup), window-trims to [fromDate, toDate], and projects onto the public JOIN vocabulary.

string

ICAO code (e.g. “KNYC”) OR 3-letter NWS code (e.g. “NYC”). Resolved through the station registry: fetched by ICAO, projected as the NWS code into each row’s station (matches Python climate()).

string

Inclusive start date, ISO YYYY-MM-DD.

string

Inclusive end date, ISO YYYY-MM-DD.

ClimateOptions = {}

See ClimateOptions.

Promise<DataResult<ClimateRow>>

ClimateResult: projected ClimateRow[] + frameSource.

ValidationError on a malformed/unknown station (before any fetch).

Error on malformed dates, fromDate > toDate, or source="acis" (no ACIS leg in this code path).