Skip to main content

Easy lat/lon/altitude queries against NOAA HRRR/GFS weather data for rocketry.

Project description

SDAtmospheric

This package allows for arbitrary data decoding for variables related to high powered rocketry by querying HRRR and GFS data above the continental united states

Install

You can install SDAtmospheric using the PyPI package registry:

pip install sdatmospheric

If the installation fails due to the eccodes library missing, see the manual installation instructions below!

Installing eccodes

cfgrib needs the eccodes C library. Easiest on conda-forge:

conda install -c conda-forge eccodes cfgrib herbie-data
pip install -e .

Pip-only (Linux/macOS or recent Windows with eccodes wheels):

pip install eccodes
pip install -e .

Basic usage

The SDAtmospheric API is built around the Atmosphere class, which represents a snapshot of the atmospheric model above the continental US at any given time. The Atmosphere class provides only two methods:

from sdatmospheric import Atmosphere
atmos = Atmosphere()

atmos.q(LATITUDE, LONGITUDE)        # Returns a `State` function closure (described below)
atmost.preload(LATITUDE, LONGITUDE) # Preloads a certain GRIB grid square around a given point

In reality, the Atmosphere class is lazy, and only loads wind data for the times and the regions directly queried by the host application. Because GRIB downloads and decoding is an involved process, we implement the use of 2 caching levels:

  • Hot Caching, where the data for a given location is stored within program memory, so queries within a region that is hot cached requires only a program memory lookup (~50ms)
  • Warm Caching, which will store GRIB regions on disk and allow for a relatively quick disk lookup rather than a redownload from the NOAA servers (~3s)

Full cache misses will trigger a download from the NOAA servers, which (depending on server traffic) can take a few minutes.

State Return

The return type of Atmosphere.q is a State-returning function closure. This means that Atmosphere.q returns a function f that, given an altitude, returns a State object.

class State(NamedTuple):
    u: float        # east wind, m/s
    v: float        # north wind, m/s
    T: float        # K
    rho: float      # kg/m^3
    P: float        # Pa
    mach_v: float   # m/s, speed of sound

Models

Atmosphere(model="hrrr") # 3km spatial resolution, 1h temporal up to 48h, 20km ceiling
Atmosphere(model="gfs") # 0.25 degree spatial resolution, 6h temporal up to 384h, 50km ceiling 
Atmosphere(model="blend") # Blends between the hrrr and gfs models
Atmosphere(model="blend", blend_range=(15_000, 19_000)) # Adjusable blending range (default 17km)

Forecasting

The analysis time defaults to the latest available analysis for the given model. This can be overridden to provide future (and past) analyses of weather data at a location.

Atmosphere(time="2025-08-03T12:00Z") # Specific time
Atmosphere(forecast_hours=3) # Forecast 3h in the future

Conventions

  • Altitude: MSL by default. alt_ref="agl" subtracts surface elevation at the query point.
  • Longitude: accept within CONUS
  • Ceiling: altitudes above the top pressure level emit a UserWarning and extrapolate based on a linear fit
  • Cache: herbie stores subset GRIBs under ~/data/ by default, and can be overridden with cache_dir=....

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sdatmospheric-0.1.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sdatmospheric-0.1.1-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file sdatmospheric-0.1.1.tar.gz.

File metadata

  • Download URL: sdatmospheric-0.1.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for sdatmospheric-0.1.1.tar.gz
Algorithm Hash digest
SHA256 822696e72c7c6aec11e7fdcb6812d699a30229042d0bb90aa932dbac6cf95e92
MD5 024ceb726fa9f17a9be132197350b48f
BLAKE2b-256 f83c9da5d03df2fb945e54a64d53ef57c3a410e94e73fa05d9d4f527d99bbc0c

See more details on using hashes here.

File details

Details for the file sdatmospheric-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sdatmospheric-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for sdatmospheric-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cfccf208e1bad3f380ce819d0360dd0c6a95c5cb634e108cc04a4757db385b1c
MD5 d22ac6bcd3b50e0fd7d7db165b3308f4
BLAKE2b-256 cac6c69e89dae0f1f5618e26ecc44cac348964e506656ac729f47e0526657ecf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page