@mostlyrightmd/weather/climate
Interfaces
Section titled “Interfaces”ClimateOptions
Section titled “ClimateOptions”Properties
Section titled “Properties”politenessMs?
Section titled “politenessMs?”
optionalpolitenessMs:number
Polite delay (ms) between IEM CLI yearly requests. Forwarded to
downloadCliRange. Default 1000 (IEM_CLI_POLITE_DELAY_MS).
signal?
Section titled “signal?”
optionalsignal:AbortSignal
Forward to the underlying fetcher; aborts the range download.
source?
Section titled “source?”
optionalsource:ClimateSourceFilter
Provenance filter. null/undefined (default) == "iem". Accepts
{"iem", "cli", "cli.archive"}; "acis" throws (no ACIS leg here).
ClimateRow
Section titled “ClimateRow”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.
Properties
Section titled “Properties”daily_summary_report_type
Section titled “daily_summary_report_type”daily_summary_report_type:
string
Inferred CLI report type (final/preliminary/…).
daily_summary_temp_high_f
Section titled “daily_summary_temp_high_f”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
Section titled “daily_summary_temp_low_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
Section titled “issued_at_utc”issued_at_utc:
null|string
ISO 8601 UTC issuance time when present, else null.
local_standard_date
Section titled “local_standard_date”local_standard_date:
string
Local climate day, YYYY-MM-DD (from the parser’s observation_date).
source
Section titled “source”source:
"iem"
Per-row endpoint tag — always "iem" for CLI.
station
Section titled “station”station:
string
Station code (as resolved from the caller’s input).
Type Aliases
Section titled “Type Aliases”ClimateFrameSource
Section titled “ClimateFrameSource”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
Section titled “ClimateSourceFilter”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.
Functions
Section titled “Functions”climate()
Section titled “climate()”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.
Parameters
Section titled “Parameters”station
Section titled “station”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()).
fromDate
Section titled “fromDate”string
Inclusive start date, ISO YYYY-MM-DD.
toDate
Section titled “toDate”string
Inclusive end date, ISO YYYY-MM-DD.
ClimateOptions = {}
See ClimateOptions.
Returns
Section titled “Returns”Promise<DataResult<ClimateRow>>
ClimateResult: projected ClimateRow[] + frameSource.
Throws
Section titled “Throws”ValidationError on a malformed/unknown station (before any fetch).
Throws
Section titled “Throws”Error on malformed dates, fromDate > toDate, or source="acis"
(no ACIS leg in this code path).