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

pyramid_reproject doesn't put NaNs #93

Closed
ahuang11 opened this issue Jan 31, 2024 · 1 comment · Fixed by #110
Closed

pyramid_reproject doesn't put NaNs #93

ahuang11 opened this issue Jan 31, 2024 · 1 comment · Fixed by #110

Comments

@ahuang11
Copy link
Contributor

ahuang11 commented Jan 31, 2024

import xarray as xr
import rioxarray
from ndpyramid import pyramid_coarsen, pyramid_reproject

# load a sample xarray.Dataset
ds = xr.tutorial.load_dataset('air_temperature')

# make a coarsened pyramid
factors = [8, 4, 2, 1]
pyramid = pyramid_coarsen(ds, factors=factors, dims=['lat', 'lon'], boundary='trim')

# make a reprojected (EPSG:3857) pyramid
ds = ds.rio.write_crs('EPSG:4326')
pyramid = pyramid_reproject(ds, levels=len(factors))

# write the pyramid to zarr
# pyramid.to_zarr('test.zarr')

pyramid["0"].isel(time=0).ds["air"].plot()
image

Expected to see something like

import xarray as xr
import rioxarray
from ndpyramid import pyramid_coarsen, pyramid_reproject

# load a sample xarray.Dataset
ds = xr.tutorial.load_dataset('air_temperature')

# make a coarsened pyramid
factors = [8, 4, 2, 1]
pyramid = pyramid_coarsen(ds, factors=factors, dims=['lat', 'lon'], boundary='trim')

# make a reprojected (EPSG:3857) pyramid
ds = ds.rio.write_crs('EPSG:4326')
pyramid = pyramid_reproject(ds, levels=len(factors))
image
@maxrjones
Copy link
Contributor

Thanks for the bug report @ahuang11! This was fixed in #110. We'll cut a release in the next week or so.

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

Successfully merging a pull request may close this issue.

2 participants