mostlyright.weather.catalog.ghcnh
mostlyright.weather.catalog.ghcnh
Section titled “mostlyright.weather.catalog.ghcnh”GHCNh catalog adapter (CATALOG-04).
Wraps mostlyright.weather._ghcnh.parse_ghcnh_row() into a class that
satisfies the WeatherAdapter Protocol and emits a canonical
schema.observation.v1 DataFrame with overlay columns + correct SI units
(see mostlyright.weather.catalog._obs_projection).
GHCNh is the lowest-priority observation source in the v0.14.1 merge
policy (AWC=3 > IEM=2 > GHCNh=1). It carries QC-accepted hourly records
that are loud about their own quality via the _is_qc_accepted helper.
Module Attributes
Section titled “Module Attributes”GHCNH_LAG | GHCNh publishes with a longer lag than ASOS/AWC (hour-summary archive). |
|---|
Classes
Section titled “Classes”GHCNhAdapter() | GHCNh observation adapter. |
|---|
class mostlyright.weather.catalog.ghcnh.GHCNhAdapter
Section titled “class mostlyright.weather.catalog.ghcnh.GHCNhAdapter”Bases: object
GHCNh observation adapter.
SUPPORTED_SOURCES : ClassVar[list[str]] = [‘ghcnh.archive’]
Section titled “SUPPORTED_SOURCES : ClassVar[list[str]] = [‘ghcnh.archive’]”fetch_observations(source, station, from_date, to_date)
Section titled “fetch_observations(source, station, from_date, to_date)”Phase 3 Mode-2 entry point. v0.1: NotImplementedError.
static from_rows(rows, , source=‘ghcnh.archive’, retrieved_at=None)
Section titled “static from_rows(rows, , source=‘ghcnh.archive’, retrieved_at=None)”Project GHCNh parser rows to a canonical observation DataFrame with SI units (knots → m/s, miles → metres, feet → metres, inches → mm).
- Return type:
DataFrame - Parameters:
mostlyright.weather.catalog.ghcnh.parse_ghcnh_row(row)
Section titled “mostlyright.weather.catalog.ghcnh.parse_ghcnh_row(row)”Parse a single GHCNh PSV row to observation schema dict.
Takes a dict from csv.DictReader (pipe-delimited). Returns an observation dict with exactly 30 fields, or None if the row should be skipped.
Returns None when:
- Station code cannot be extracted from any Source_Station_ID column
- DATE is missing
- ALL key variables (temp, dewpoint, wind_speed, SLP) fail Quality_Code