Skip to content
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

Regridding a dataset to a finer resolution does not interpolate, but fills with NaN instead #52

Open
retsios opened this issue Feb 6, 2024 · 1 comment

Comments

@retsios
Copy link

retsios commented Feb 6, 2024

In the jupyter demo of zampy, when re-loading the dataset after the ingest process, a "resolution" parameter is asked.
If we provide the original resolution of the data, or a coarser resolution, all works well.
If we provide a finer resolution, the regridding algorithm fills the space inbetween pixels with NaN.
See below with zampy.LandCover, that has an original resolution of 0.05 degrees:
Original resolution:
image
Finer resolution:
image
If possible, make the "resolution" parameter optional. The regridding is many times not needed (unwanted), since to match all layers, we need to respect the one that has the coarsest resolution, which is CAMS (0.75 degrees, approximately 85 kilometers; while canopy-height has a resolution of 0.01 degrees).

@BSchilperoort
Copy link
Contributor

Hi Bas, thanks for raising this issue. With the move to xarray-regrid (#49) this bug will have changed slightly. We will have to check if the new resolution is finer than the dataset's and in that case use a nearest-neighbor interpolation.

The landcover dataset is even finer, but in the ingestion (preprocessing) step we regrid it already to 0.05 degrees. This is to conserve memory and storage.

The resolution parameter is required because we need to unify the resolution of all input datasets. With regridding it is possible to do interpolation as well which is already happening for the other datasets (they are regridded linearily).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants