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

Factors should be sorted(?) #95

Closed
ahuang11 opened this issue Feb 1, 2024 · 1 comment
Closed

Factors should be sorted(?) #95

ahuang11 opened this issue Feb 1, 2024 · 1 comment

Comments

@ahuang11
Copy link
Contributor

ahuang11 commented Feb 1, 2024

"The paths to the arrays in dataset series MUST be ordered from largest (i.e. highest resolution) to smallest."

From https://forum.image.sc/t/multiscale-arrays-v0-1/37930

So I think [16, 8, 4, 3, 2, 1] should be reversed.

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
pyramid = pyramid_coarsen(ds, factors=[16, 8, 4, 3, 2, 1], dims=['lat', 'lon'], boundary='trim')

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

# write the pyramid to zarr
pyramid.to_zarr('./path/to/write')
@maxrjones
Copy link
Contributor

Hey @ahuang11, excited to see your interest in ndpyramid!

ndpyramid doesn't follow the same specification as ome-ngff. See zarr-developers/zarr-specs#125 for some history on where the microscopy and geospatial specs diverged and https://ndpyramid.readthedocs.io/en/latest/schema.html for the ndpyramid schema. @norlandrhagen and I are actually meeting with Sanket and Josh tomorrow to discuss if/how a Zarr spec could accomodate these differences.

@ahuang11 ahuang11 closed this as completed Feb 1, 2024
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