tephpy.io.wyoming#

University of Wyoming sounding archive reader (spec §3.4).

fetch() requests one ascent from the archive’s post-2024 wsgi interface in its machine-readable TEXT:CSV form — bare, self-describing CSV (verified 2026-07-27) — over stdlib urllib behind a function-local import, and hands the body to a pure, transport-free parser. Network failures, HTTP errors, and the archive’s “no data” replies raise TephpyIOError summarising the upstream response; the parsed sounding passes the ordinary ingest validation (spec §6).

Functions#

fetch(→ tephpy.sounding.Sounding)

Fetch one sounding from the University of Wyoming archive.

Module Contents#

tephpy.io.wyoming.fetch(station: str, time: datetime.datetime | str, *, timeout: float | None = None) tephpy.sounding.Sounding[source]#

Fetch one sounding from the University of Wyoming archive.

Parameters:
stationstr

The WMO station identifier, e.g. "72357".

timedatetime.datetime or str

The nominal launch time; a string is read with datetime.datetime.fromisoformat(), and a naive value is read as UTC (the Sounding convention).

timeoutfloat, optional

The request timeout in seconds (default WYOMING_TIMEOUT).

Returns:
Sounding

The validated sounding, with station and time as metadata — so the legend label derives for free (spec §3.4).

Raises:
TephpyIOError

For network failures, HTTP errors (including the archive’s “no data at that time” and “unknown station” replies), or a response the parser does not recognise.

TypeError

If time is neither a datetime nor a string.

ValueError

If a time string is not ISO 8601.