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

A BoundingBox requested through zampy must contain at least 2x2 pixels #48

Open
retsios opened this issue Jan 24, 2024 · 1 comment
Open

Comments

@retsios
Copy link

retsios commented Jan 24, 2024

SpatialBounds(52.3, 7.1, 52.2, 6.9) is too small for zampy to handle. One will eventually get the error "ValueError: arange: cannot compute length". This is caused by the way infer_resolution()

def infer_resolution(dataset: xr.Dataset) -> tuple[float, float]:
in regrid.py works. It is needed to provide a boundingbox that includes at least 2 pixels, both horizontally and vertically. E.g. SpatialBounds(53, 7, 52, 6) would work, since dataset CAMS has 0.75 degree pixels.

@BSchilperoort
Copy link
Contributor

Hi Bas,

Thanks for raising this issue! I assume the resulting dataset only has a single point of data (in space), in which case we should fill the new grid with the single available datapoint.
The 2x1 pixels case will be a little bit less trivial to properly resolve 🤔

I still have to move over the regridding routines in Zampy to https://github.com/EXCITED-CO2/xarray-regrid
Before I do so I will add these edgecases to xarray-regrid's unit tests and write a solution.

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