Correct errors in metric calculations for DINO #76
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.
This PR captures two errors in the calculation of the metrics:
velocity_uintotemperature_DWbox_metric, should have beentemperature.Previously, we had renamed dims as so:
So this made the metrics (as they were given to us by Etienne) work fine.
However, when we select variables from the DataSet, for example,
The pre-existing dimensions (time_counter, nav_lev, nav_lat, nav_lon) are carried across as well as coordinates (time_counter, nav_lev). i.e. the
nav_latandnav_lonvariables are not carried over. And note that the dims have been renamed tonav_lonandnav_lat.To fix this, we need to promote the nav_lat(nav_lat, nav_lon) and nav_lon(nav_lat, nav_lon) to coordinates. The idiomatic way to do this is with the
set_coordsfunction:Exploring xarray further, if Nemo had output nav_lat without the redundancy i.e. as 1D arrays. It would have been parameterised as so: nav_lat(nav_lat), which, on reading by xarray would automatically be recognised as a coordinate. The same is true of
nav_lon.Results
Running the following command:
python3 -m spinup_evaluation --sim-path ./tests/data/DINO_subsampled_A/ --mode restartTODOs
This closes #81