Add support for inverting transformation operations (mapping back to structure of source datasets) #78
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.
Describe your changes
This PR adds support for taking a zarr dataset produced with
mllam-data-prepand inverting the transformations applied to create it. This is implemented inmllam_data_prep.recreate_inputs(ds: xr.Dataset)which returns a dictionary of datasetsDict[str,xr.Dataset]where the is the name of each input defined in the config that was used to create the dataset.The main motivation for implementing this functionality is to be able to easily take a forecast produced with neural-lam as an zarr dataset and invert back to the data-structure (individual variables on a regular grid) so that these can be used in downstream applications.
Below is an example that shows inverting where the DANRA training dataset included with

mllam-data-prepand we just select thedanra_heigth_levelsto write to zarr:Added parse to support parsing of the format string used for creating the coordinate values during stacking of variables and coordinates.
Issue Link
#85 should be merged first since it introduces a better handling of
MultiIndexresulting from stacking coordinates, and using this better handling makes inverting the operation a lot simpler to handle.Type of change
Checklist before requesting a review
pullwith--rebaseoption if possible).Checklist for reviewers
Each PR comes with its own improvements and flaws. The reviewer should check the following:
Author checklist after completed review
reflecting type of change (add section where missing):
Checklist for assignee