Skip to content

v2.0.0

Choose a tag to compare

@tkschuler tkschuler released this 03 Jun 20:29
· 17 commits to main since this release

version 2.0.0

  • BREAKING: Unified forecast format — GFS and ERA5 consolidated into one reader
    • ERA5.py and GFS.py collapsed into a single Forecast class
      (Forecast.py) that reads one canonical schema regardless of source
    • Single canonical netCDF schema (CF-1.7, ECMWF/ERA5-style), documented in
      docs/source/forecast-schema-v2.md:
      • variables u/v/z/t; dims valid_time/pressure_level/latitude/longitude
      • latitude descending; pressure_level descending hPa; longitude -180..180
      • geopotential z in m²/s² (reader divides by g); temperature t required
      • time as seconds since 1970-01-01 / proleptic_gregorian
      • matches what the Copernicus CDS API returns post-September 2024, so
        current ERA5 downloads load with no conversion step
    • Source (GFS vs ERA5) is read from the file's institution global attribute
      and exposed as Forecast.source (with a filename fallback for older files)
    • Forecast cadence (resolution_hr) is derived from the file's time array
      rather than a config key — ERA5 1-hr and GFS 3-hr both work with no knob
    • Every v2 file is a tight bounding-box subset; the old determineRanges()
      and lat/lon/time index bookkeeping are gone (array slices are [:])
  • Configuration
    • config_earth.forecast['forecast_type'] retired; config now carries a
      single forecast['file'] path that may point at a GFS or ERA5 file
    • Forecast and balloon_trajectory loading fail fast with a clear message
      and a non-zero exit code when the configured file is missing or mistyped
  • GFS downloader (saveNETCDF.py) now writes canonical files directly
    • renames vars/dims; converts geopotential height → geopotential (* g)
    • converts longitude [0, 360) → [-180, 180); flips latitude to descending
    • re-encodes time; stamps institution and Conventions = "CF-1.7"
  • Migration tooling for archived v1 forecasts
    • python -m EarthSHAB.forecast_processing.migrate_v1 <file_or_dir> converts
      v1 GFS, v1 ERA5 "processed", and pre-Sep-2024 ERA5 files to canonical in
      place (idempotent; backs up originals as <name>.v1.nc)
    • python -m EarthSHAB.forecast_processing.verify_migration <dir> confirms a
      directory is fully v2
    • The reader raises ForecastFormatError with the exact migration command
      when it encounters a v1 file — no silent on-load conversion
    • Documented in docs/source/migration-v2.md
  • Removals / cleanup
    • Deleted the obsolete convert_era52gfs.py / convert_gfs2era5.py
      converters and the *-processed.nc intermediates
    • Test suite collapsed to a single reader: dropped the reader_type
      parametrization and reader_adapter.py; dummy-forecast fixtures emit
      only canonical schema
  • Bug fixes (latent v1 bugs surfaced while deleting the old readers)
    • ERA5 reader unpacked 3 values from a 2D np.nonzero (fired on partial
      masks at the level-0 sample slice)
    • GFS time decode used hardcoded "days since 0001-01-01" units, producing
      cftime objects and a 2-day calendar offset vs stdlib datetime
  • Historical GFS downloads from the AWS archive (saveNETCDF_archive.py)
    • Pulls past cycles from noaa-gfs-bdp-pds (pgrb2.0p25, ~2021-03 onward) via
      each file's .idx sidecar + HTTP byte-range requests; writes the same v2
      canonical schema as the live downloader (drop-in replacement)
    • saveNETCDF.py auto-switches to it (yellow warning + prompt) when the
      requested cycle predates NOAA's ~9-day live window; non-interactive
      sessions proceed automatically
  • New netcdf_gfs['step_hours'] sets download temporal resolution for both
    downloaders (3-hourly default, 1 = hourly; GFS hourly only out to f120)
  • run_batch.py gains --launches <file> to run an alternate launches JSON
  • Documentation
    • New canonical-schema and migration guides; unified Forecast API page
      (replacing the separate GFS/ERA5 pages); refreshed GFS/ERA5 download guides
    • README v2.0 breaking-change banner linking to the migration guide