Stormcast-CONUS#919
Conversation
| return torch.tensor(series.values, dtype=dtype, device=device) | ||
|
|
||
|
|
||
| class ObsGridMapping: |
There was a problem hiding this comment.
Given the functionality, this feels like it would belong more alongside the other interpolation utils we have in earth2studio.utils.interp. In fact this whole file in general is maybe questionable, I know I was the one who approved its location here in earth2sutdio.models.da but maybe we should migrate the da utils to the general utils folder? Maybe I'm being too nitpicky... @NickGeneva any thoughts?
There was a problem hiding this comment.
This now lives in earth2studio.utils.obs, is it ok there? I don't think we got @NickGeneva's opinion.
Greptile SummaryThis PR adds the StormCast-CONUS model: a 3 km HRRR-resolution DiT-based generative forecast model for the Continental United States, with support for score-based data assimilation (SDA) via DPS guidance and optional subdomain cropping.
|
| Filename | Overview |
|---|---|
| earth2studio/models/nn/stormcastconus.py | Core model implementation for StormCastCONUS with EDM diffusion, sigma-split sub-model routing, SDA support, and subdomain cropping. Mutable default arguments for variables and conditioning_variables parameters are a minor concern; otherwise well-structured. |
| earth2studio/utils/obs.py | New ObsGridMapping utility for binning point observations onto 2-D model grids with CuPy GPU support. Logic is correct; the filter_time_range function signature type hint is narrowed to pd.DataFrame but the body and docstring still handle cuDF DataFrames. |
| docs/modules/models_da.rst | Adds utils.ObsGridMapping to the DA autosummary, but ObsGridMapping is not present in earth2studio.models.da.utils — this would break the Sphinx docs build. |
| earth2studio/models/px/stormcastconus.py | Thin forecasting wrapper around StormCastCONUSBase; correctly delegates to super().__call__(x, coords, obs=None) and provides a standalone create_generator with PrognosticMixin hooks. |
| earth2studio/models/da/init.py | Exports StormCastCONUSBase as StormCastCONUSSDA; intentional — base class supports obs-guided diffusion. Does not inherit AssimilationModel, but the SDA example uses the generator interface directly rather than a generic DA framework. |
| earth2studio/models/da/utils.py | Removes the duplicate filter_time_range implementation and re-exports it from earth2studio.utils.obs. Clean refactor, though ObsGridMapping is missing as a re-export despite being referenced from the docs. |
| test/models/px/test_stormcastconus.py | Comprehensive unit tests covering call, iterator, AMP, value clamping, multi-time, and ensemble dimensions. Uses a well-structured stub diffusion model and correct subdomain alignment. |
| test/utils/test_obs.py | Good coverage of ObsGridMapping: construction, obs_coords, obs_to_grid (empty input, averaging, variable/time filtering), grid_to_obs (nearest and bilinear), irregular grids, and CPU/GPU parity checks. |
Reviews (1): Last reviewed commit: "ObsGridMapping unit tests + support miss..." | Re-trigger Greptile
|
/blossom-ci |
|
/blossom-ci |
|
/blossom-ci |
| # .. note:: | ||
| # StormCast-CONUS does not yet have a publicly released default package. | ||
| # Set the ``STORMCAST_CONUS_MODEL_PATH`` environment variable to the local | ||
| # directory or remote URI of the model package before running this example. |
There was a problem hiding this comment.
TODO drop this when HF package is ready
| }, | ||
| ) | ||
| # Uses GFS_FX as the conditioning data source by default | ||
| model = StormCastCONUS.load_model(package) |
There was a problem hiding this comment.
TODO update when HF is available
There was a problem hiding this comment.
Just curious did someone ask for this explicitly?
There was a problem hiding this comment.
I have a user in mind for this, yes. Also generally I find these workflows are better starting points for building end user workflows (even if they're not using the API) than the examples in the examples directory.
…studio into stormcast-conus
Earth2Studio Pull Request
Description
Adds StormCast-CONUS model: A CONUS-wide StormCast-like model with a DiT backbone.
Main features/additions:
models.nn.stormcastconus.StormCastCONUSBasemodel wrapper:_SplitModelWrapperto handle per-sigma and per-variable expert splitmodels.px.stormcastconus.StormCastCONUSandmodels.da.sda_stormcastconus.StormCastCONUSSDAspecialize the above as forecasting and DA modelsutils.obs.ObsGridMappingfor converting between point obs and gridded variables, with CuPy supportutils.cos_zenithfor a torch port of cos zenith calculations (Stormscope uses version from PhysicsNeMo, which is implemented in NumPy and runs on CPU)TBA/TBD:
Do we want to further generalizeSplitModelWrapper?Discuss what to do withutils.cos_zenithwhich admittedly adds code duplicationAdd example using SDAAdd workflow for Earth2Studio API for using the model with various conditioning models (e.g. GFS, FCN3, AIFS)Add unit testsChecklist
Dependencies