lair.soundings.download_sounding#
- lair.soundings.download_sounding(station, date, dst=None)[source]#
Download an upper air sounding from the Wyoming archive.
- Parameters:
station (str) – The 3-letter station identifier (e.g.
'SLC') passed to the Wyoming service via siphon. Also used as the file-name prefix.date (datetime) – The date and time. A time without a time zone follows the UTC rule; one with a time zone is converted to UTC. Wyoming reads the time as UTC, and the file is named for the UTC hour (
SLC_2024011512.csvfor 12 UTC).dst (str) – The destination directory. Defaults to
$LAIR_SOUNDING_DIR/<station>.
- Returns:
str – The path to the downloaded sounding data.
- Raises:
ValueError – If the unit siphon reports for
speed,u_windorv_windis missing or is not a speed unit that pint knows. No file is written.- Return type:
Notes
Every file is saved in the units of
Sounding.units, whatever Wyoming sent. Wyoming sends the winds in m/s today and sent knots before, sospeed,u_windandv_windare converted to knots from the unit siphon reports for each. Wyoming no longer sends the station’selevation, so it is saved as the height of the first level, the ground.pwandstation_numberare saved only if Wyoming sends them, which it no longer does. A file that is already indstis not downloaded again or changed.See also
download_soundingsEvery sounding of a period.
SoundingReads the file.
Examples
The 12 UTC sounding of Salt Lake City on 2024-01-15, into a folder of your own. It needs the network, so it is not run when the docs build:
>>> import datetime as dt >>> from lair.soundings import download_sounding >>> download_sounding( ... "SLC", dt.datetime(2024, 1, 15, 12), dst="soundings/SLC" ... ) 'soundings/SLC/SLC_2024011512.csv'