Stop hardcoding names of Cartesian coords - #169
Conversation
Instead of assuming that the regular grid Cartesian coordinates are called `x` and `y` use the coordinate names from the datastore config of the coordinates that were stacked.
|
Maybe we can call it Other than the variable name this looks great :) |
joeloskarsson
left a comment
There was a problem hiding this comment.
(I realize I never added a review properly here)
Let's just change the variable names as discussed above, then this is good :)
…x/coordinate-names-hardcoding
|
Hmm, something seems to go wrong with the dummy datastore in the tests now |
I hadn't changed the variable defining the spatial coordinates within the dummy datastore 😊 |
|
The tests are passing now so this can go in |
joeloskarsson
left a comment
There was a problem hiding this comment.
Looks good to me now! Please remember to add a changelog entry before merging.
…x/coordinate-names-hardcoding
Instead of assuming that the regular grid Cartesian coordinates are called
xandyuse the coordinate names from the datastore config of the coordinates that were stacked.Describe your changes
This PR removes the hardcoding of
xandyas the names of the Cartesian coordinates inMDPDatastore. This means that if the regular grid coordinates are not calledxandybut instead for example the training data is on a regular lat/lon grid (i.e. 2D coordinate dimensions are for example calledlatandlon),neural-lamwill still be able to use this training data.This came about due to the discussion on mllam/mllam-data-prep#45 (comment) where @joeloskarsson was trying to use ERA5 data where the dimension of the variables are
(time, latitude, longitude, ...)i.e. the regular grid 2D spatial coordinates are not calledxandy, insteadlatitudeandlongitude. This fix will allow forMDPDatastoreinneural-lamto work with this ERA5 dataset, and any other dataset with differently named coordinates.I am realising that calling these coordinates "Cartesian" is not strictly correct. Should we call them "regular grid coordinates", or what is the better name here?
No change of dependencies needed for this fix.
Issue Link
mllam/mllam-data-prep#45 (comment)
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