-
Notifications
You must be signed in to change notification settings - Fork 6
Regular Grid fixes #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Deploying gridlook with
|
Latest commit: |
139d141
|
Status: | ✅ Deploy successful! |
Preview URL: | https://49fd06df.gridlook.pages.dev |
Branch Preview URL: | https://regular-fix.gridlook.pages.dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the changes for NaN and the ordering are fine (although I'm wondering if we shouldn't have such a fix for longitude as well, just in case?).
I'm not sure I get the second point, what do you mean by "shape has only time and value information"? If the dataset doesn't have distinct lat and lon dimensions, it is not a regular grid, because having latitude and longitude dimensions (not necessarily by the names lat
and lon
) is exactly the property that makes a grid regular instead of irregular.
But probably I'm missunderstanding things here, as I've trouble finding my thoughts in the code...
The issue was this code:
This code leaves me with a https://eerie.cloud.dkrz.de/datasets/icon-esm-er.hist-1950.v20240618.atmos.gr025.2d_daily_mean/stac And then there is this dataset here (sorry, I wanted to posted this one in the initial message and mixed them up) https://eerie.cloud.dkrz.de/datasets/ifs-amip-tco1279.hist.v20240901.atmos.gr025.2D_monthly/stac Which has two dimensions I just commited another condition for regular grids in |
You are very likely right. It could also be a problem when the data goes from -180 to 180 instead of 0 to 360. I will create issues for this and we can fix it later. |
Ok, I see what the issue is. The grid-file specifies a lat/lon grid, i.e.:
but the data-file only has the
I'd consider this as a broken setup, because the grid doesn't match the data (and probably shouldn't even be there, as the data already contains lat and lon). So I guess we should reject this form of grid+data combination. Also, when loading the dataset directly with gridlook (using auto-detection), i.e..: https://gridlook.pages.dev/#https://eerie.cloud.dkrz.de/datasets/ifs-amip-tco1279.hist.v20240901.atmos.gr025.2D_monthly/zarr , gridlook (correctly) detects this dataset as unstructured and displays it correctly. |
@wachsylon came up with a few examples of regular grids which did not work with the current implementation for various reasons. This PR aims to fix this:
NaN in data points are now ignored and data is rendered now properly. Example: https://eerie.cloud.dkrz.de/datasets/icon-esm-er.hist-1950.v20240618.ocean.gr025.2d_monthly_mean/stac
GlobeRegular can now deal with data which has missing lat and lon-information in
_ARRAY_DIMENSIONS
and therefore theshape
-object has only a time and avalue
-information. We are now getting the information directly from thelat
andlon
-variablesGlobeRegular can now also deal with data with reverted lats, i.e. with lats starting from 90 to -90 instead of the other way round
The last two fixes can both be seen in the following example, however it will still not work because of
getGridType
. It will only recognize a regular grid bydatavar.attrs._ARRAY_DIMENSIONS as unknown[]).length >= 3
, which does not work with this data. Any suggestions? Right now you can only see it in action when hard codingREGULAR_GRID
ingetGridType
.https://eerie.cloud.dkrz.de/datasets/icon-esm-er.hist-1950.v20240618.atmos.gr025.2d_daily_mean/stac