Add NASA IMERG Early and Late V07 analysis datasets#636
Open
aldenks wants to merge 2 commits into
Open
Conversation
Integrate two global half-hourly precipitation analysis datasets from NASA GPM IMERG V07: nasa-imerg-analysis-early-v7 and nasa-imerg-analysis-late-v7. The two runs differ only in source product/URL and update latency, so they share NasaImergRegionJob and a NasaImergAnalysisTemplateConfig base under src/reformatters/nasa/imerg/ (GFS-style base/subclass split). A single NasaImergSourceFileCoord carries a `run` field; per-run RegionJob subclasses set it via a ClassVar. - Source: GES DISC HTTPS with NASA Earthdata Login (reuses the SMAP auth pattern). Tries the date-appropriate V07C/V07B filename label with fallback. - Reads HDF5 /Grid variables via rasterio, reorienting the source (time, lon, lat) layout to (latitude, longitude) and converting fill values to NaN. precipitation is converted mm/hr -> kg m-2 s-1 to match the existing precipitation_surface / precipitation_flux convention. - Variables: precipitation_surface, probability_of_liquid_precipitation_surface, precipitation_quality_index_surface. - Grid: global 0.1 deg (1800 x 3600), record from 1998-01-01 (verified on GES DISC). Chunk (1440,45,45) / shard (1440,450,450) = 30 days/shard; alternatives documented in template_config. Tests: unit tests for all custom logic, a fully-mocked backfill->update integration test (runs offline), and slow tests that download and read a real granule from each run (require Earthdata credentials). Relates to #462 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…kip-guard integration tests - Replace the central IMERG_RUN_CONFIG dict + `run` field/ClassVar with two NasaImergSourceFileCoord subclasses (one per run) that own their GES DISC product id and filename code. The shared base RegionJob is parameterized by a `source_file_coord_class` ClassVar set in each run's module, so the base no longer knows about specific runs. - Add tests/integration.py `require_secret` helper: real download-from-source tests now run where the kubernetes secret is reachable (kubectl context or a mounted secret file) and skip cleanly elsewhere (plain PR CI, contributor machines) instead of erroring. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two global half-hourly precipitation analysis datasets from NASA GPM IMERG V07:
nasa-imerg-analysis-early-v7nasa-imerg-analysis-late-v7(IMERG Final is intentionally deferred to V08 — V07 Final stopped 2025-09-30.)
The two runs differ only in their source product/URL and update latency, so they share
NasaImergRegionJoband aNasaImergAnalysisTemplateConfigbase undersrc/reformatters/nasa/imerg/, mirroring the NOAA GFS forecast/analysis shared-code layout. A singleNasaImergSourceFileCoordcarries arunfield; thin per-runRegionJobsubclasses set it via aClassVar.Details
earthdata_authpattern).download_filetries the date-appropriateV07C/V07Bfilename label and falls back to the other./Gridsubdatasets, reorienting the source(time, lon, lat)layout to(latitude, longitude), converting fill values (-9999.9float /-9999int16) to NaN.precipitationis converted mm/hr →kg m-2 s-1to match the existingprecipitation_surface/precipitation_fluxconvention.precipitation_surface,probability_of_liquid_precipitation_surface,precipitation_quality_index_surface.(1440, 45, 45)/ shard(1440, 450, 450)= 30 days/shard (~37 GB per-worker buffer). The memory ↔ read-locality ↔ update-cost tradeoff and lean (720) / premium (2880) alternatives are documented intemplate_config.py.s3://dynamical-nasa-imerg)."0.1 degrees (~10km)"to the sharedSpatialResolutionliteral; added the two non-CF/non-ECMWF variables to the compliance-test exemption lists.Testing
backfill_local→updateintegration test that runs offline and exercises the whole download → read → write → append pipeline.ruff,ty, and the full non-slow suite pass.Follow-ups before backfill
(time,lon,lat)→(lat,lon)transpose + latitude flip is implemented from the source spec but only confirmed by the slow tests. Runuv run pytest tests/nasa -m slowwith Earthdata credentials before backfilling.dynamical.orgcatalog (separate repo).Relates to #462
🤖 Generated with Claude Code