Data Assimilation Models¶
Earth2Studio's data assimilation interface supports models that ingest, predict, and assimilate sparse observations. Traditional assimilation combines observations with an optional background field to produce an updated state. The same interface also supports predicting observations directly from other observations, without requiring a gridded analysis as an intermediate output.
Use these models to prepare initial conditions, update forecasts with new measurements, or produce observation-space predictions. The assimilation API supports both independent calls and models that continue a stateful trajectory.
Interface¶
| Method | Purpose |
|---|---|
input_coords() |
Declare initial inputs, including observations for independent models. |
output_coords(...) |
Validate input declarations and plan the output. |
default_sources() |
Recommend providers in input-then-forcing order. |
model(...) |
Produce an analysis or prediction from separate, named inputs. |
to(device) |
Place model computation on the requested device. |
AssimilationModel defines this independent interface. StatefulAssimilationModel
adds forcing_coords(), initialize(...), step(..., state=state), and
create_iterator(...), following the prognostic explicit-state
convention. For these models, observations supplied during a rollout are forcing.
The protocols are in earth2studio.models.da.base; inheritance is optional.
Each input or output slot is either a gridded DataArray described by a
CoordinateSystem, or a DataFrame described by a FrameSchema. A schema maps column
names to representative NumPy arrays: empty arrays leave values unconstrained;
nonempty arrays specify allowed values. Multiple slots form an ordered tuple, which
can mix gridded and tabular declarations. Models expose stochastic and set_rng;
seeding is a no-op for deterministic models.
For an observation-to-observation model, input and output FrameSchema declarations
describe the observations consumed and predicted. Neither side requires a gridded
field; choose the slot types that match the model's actual inputs and outputs.
See E2S-07: Data Assimilation Contract for slot ordering, observation schemas and timing, and independent and stateful execution requirements.
Usage¶
Choose the Execution Pattern¶
| Model | Inputs | Forcing | Execution |
|---|---|---|---|
InterpEquirectangular |
Observations | — | Independent |
HealDA |
Conventional, satellite observations | — | Independent |
CorrDiffCosmoEra5SDA |
ERA5 background, observations | — | Independent |
StormCastSDA |
HRRR background | Conditioning, observations | Independent or stateful |
StormCastConusSDA |
HRRR background | Conditioning, observations | Independent or stateful |
For example, load HealDA through its concrete class, with its optional dependencies and weights installed. Given observation frames prepared to match its two schemas:
from earth2studio.models.da import HealDA
model = HealDA.load_model(HealDA.load_default_package())
analysis = model(conv_obs, sat_obs)
HealDA requires at least one observation batch. CorrDiff accepts
model(background, observations), where observations may be None. Use
fetch_dataframe and fetch_dataframes to
prepare observation requests and retain request-time metadata.
Continue a Stateful Analysis¶
For a loaded StormCastSDA model and prepared fields:
analysis, state = model.initialize(x0, conditioning0, obs0)
analysis, state = model.step(analysis, conditioning1, None, state=state)
Or let the iterator retain state:
iterator = model.create_iterator(x0, conditioning0, obs0)
analysis = next(iterator) # First computed analysis, one hour after x0
analysis = iterator.send((conditioning1, None)) # Next step without observations
iterator.close()
Conditioning remains required when observations are absent: next(iterator) or
send(None) cannot replace send((conditioning, None)). StormCastSDA aligns
conditioning to the input valid time and observations to the output time, one hour
later. StormCastConusSDA aligns both to the output valid time and filters observations
using the wrapped model's time_tolerance.
Wrap Your Own Assimilation Model¶
Keep a wrapper in your own project. Declare gridded signatures and observation schemas, use fixed named execution arguments, and implement the stateful extension only when outputs and explicit state continue a trajectory. Validate observation timing and optional-input behavior as well as numerical agreement with your reference analysis or observation predictions.
The earth2studio-create-assimilation skill provides contract and validation guidance. Ask your agent to adapt it to a local wrapper, supplying your inference code, observation schema, background/forcing requirements, and reference cases. See the prognostic customization guide for an example agent request scoped to your project.