Anemoi#
- class ufs2arco.targets.Anemoi(source: Source, chunks: dict, store_path: str, rename: dict | None = None, forcings: list | tuple | None = None, statistics_period: dict | None = None, compute_temporal_residual_statistics: bool | None = False, sort_channels_by_levels: bool | None = False, variables_with_nans: list | None = None, transformed_dims: dict | None = None)#
Store dataset ready for anemoi
- Expected output has dimensions
("time", "variable", "ensemble", "cell")
Use the rename argument to modify any of these before they get packed in the anemoi dataset. This might be useful if you want to train a model with the same variables, but from different datasets, so they have different names originally.
Assumptions
For
EnsembleForecastSourceandForecastSourcedatasets, t0 gets renamed to time, and fhr is silently droppeddo_flatten_grid=Trueresolution = None, I have no idea where this gets set in anemoi-datasets
just setting use_level_index = False for now, but eventually it would be nice to use this flag to switch between how vertical level suffixes are labeled
if
sort_channels_by_levelisTrue, then we’ll make sure that channels go like variable_<level 0> -> variable_<largest level value>
Methods
Anemoi.__init__(source, chunks, store_path)Deal with the dates issue
Anemoi.aggregate_stats(topo)Aggregate statistics over "time" and "ensemble" dimension.
After opening a single dataset for the given initial condition, forecast hour, and member, Apply any transformations necessary for storage
Deal with the dates issue
Anemoi.finalize(topo)Finalize the dataset with * dates * stats * temporal stats (if specified)
Anemoi.handle_missing_data(missing_data)Take a list of dicts, with dimensions of missing data.
Anemoi.manage_coords(xds)Manage the coordinates that will get stored in the container
Anemoi.merge_multisource(dslist)Take a list of datasets, each from their own source, and merge them
This has to happen after
add_dates()is called.In addition to any user specified renamings.
Attributes
Anemoi.allow_nansAnemoi.always_open_static_varsAnemoi.datesAnemoi.datetimeAnemoi.dim_orderAnemoi.do_flatten_gridAnemoi.end_dateAnemoi.ensembleAnemoi.expanded_horizontal_dimsAnemoi.fhrAnemoi.horizontal_dimsAnemoi.memberAnemoi.nameAnemoi.protected_renameAnemoi.renamed_sample_dimsAnemoi.resolutionAnemoi.sample_dimsAnemoi.start_dateAnemoi.statistics_end_dateAnemoi.statistics_start_dateAnemoi.t0Anemoi.timeAnemoi.use_level_index