Skip to content

mostlyright.core.schemas.satellite

Satellite schema (schema.satellite.v1).

This module defines:

validate_satellite_station : The site-identity check the GOES ABI L2 extractor (mostlyright.weather._fetchers._goes_extract) calls at the _build_record write site. ColumnSpec supports only dtype/nullable/enum and no regex (see core/schema.py), so the identity rule cannot live as a column pattern; it is enforced by this function plus validate_site_id_for_path on the cache path.

SatelliteSchema : The full schema.satellite.v1 shape contract — 18 storage fields plus the overlay columns source / delivery / qc_status / as_of_time. Registered with the Validator (core/schemas/__init__.py) and wired into the codegen exporter (scripts/export_schemas.py, _GROUP_A_SCHEMA_IDS) so schemas/json/schema.satellite.v1.json is emitted deterministically. The TypeScript SDK has no reader for these rows.

Source identity. _registered_sources is the set of the four native-ring source identities {noaa_goes, jma_himawari, noaa_viirs, eumetsat_meteosat}, one per instrument family, so a model trained on one can never silently reconcile against another. Within a single frame the source is homogeneous: the validator reconciles df.attrs["source"] against the set, and the per-row source overlay column must equal that single df.attrs["source"], so no frame mixes sources. noaa_goes rows are byte-identical across delivery channels (local extraction and the hosted feed). delivery (enum {live, hosted}, default "live") records the delivery channel only and is not part of source identity. mirror is a transport choice and is deliberately not a schema column.

AttributeDescription
SATELLITE_DELIVERY_VALUESDelivery-channel lineage.
SATELLITE_QC_STATUS_VALUESqc_status values.
FunctionDescription
validate_satellite_station(station)Validate a satellite row’s station identity is a well-formed site id.
ClassDescription
SatelliteSchema()schema.satellite.v1 — single-pixel satellite scan rows, native grid.

Delivery-channel lineage. delivery records how the row was obtained (local extraction vs the hosted feed) without being part of source identity: both channels reconcile to the same per-source identity, so local GOES rows and hosted GOES rows are both noaa_goes.

qc_status values. Rows are annotated, never dropped. "clean" passed every rule; "flagged" tripped a warning-class rule; "suspect" tripped an error-class rule (a physics or structure violation, almost always an extraction bug), and the row is kept rather than dropped.

class mostlyright.core.schemas.satellite.SatelliteSchema

Section titled “class mostlyright.core.schemas.satellite.SatelliteSchema”

Bases: Schema

schema.satellite.v1 — single-pixel satellite scan rows, native grid.

One row per (station, satellite, product, variable, pressure_level_hpa, scan_start_utc), which is also the dedup key and does not include the mirror. Carries 18 storage fields plus the overlay columns source / delivery / qc_status / as_of_time.

The schema covers GOES East/West, Himawari, VIIRS, and EUMETSAT through a set of distinct source identities (_registered_sources) and a correspondingly broad satellite enum, so a polar VIIRS swath row validates alongside a geostationary GOES/Himawari/SEVIRI row: subsatellite_longitude_degrees is nullable (geostationary only) and pixel_row/pixel_col mean either a native grid index or a swath line/sample index.

mostlyright.core.schemas.satellite.validate_satellite_station(station)

Section titled “mostlyright.core.schemas.satellite.validate_satellite_station(station)”

Validate a satellite row’s station identity is a well-formed site id.

A site id is 4-12 uppercase ASCII letters/digits: a station ICAO ("KNYC", "EGLC") or a coordinate-derived identifier ("S4078N0739W"). Returns the station string unchanged when valid (so call sites can use it inline). Raises SchemaValidationError for anything else — notably 3-letter NWS codes, which must raise rather than silently produce un-joinable rows.

services/weather delegates its station query-parameter check to this function, so widening the alphabet here widens the serving route with it: one identity contract, one place to change it.

  • Return type: str
  • Parameters: station (str)