Skip to content

What is the best approach for loading a Zarr file from the EOPF Sample Service with obstore? #480

Answered by maxrjones
tylere asked this question in Q&A
Discussion options

You must be logged in to vote

I haven't found time to dive into the EOPF Zarr data yet so I cannot say if this is the best way, but it will enable you to open an xarray dataset:

import obstore as obs
import xarray as xr
from zarr.storage import ObjectStore

remote_product_path = "https://objectstore.eodc.eu:2222/e05ab01a9d56408d82ac32d69a5aae2a:sample-data/tutorial_data/cpm_v253/S2B_MSIL1C_20250113T103309_N0511_R108_T32TLQ_20250113T122458.zarr"
object_store = obs.store.HTTPStore.from_url(remote_product_path)
zarr_store = ObjectStore(object_store, read_only=True)
ds = xr.open_zarr(zarr_store, consolidated=True)
ds

The object that you named zarr_store is actually an obstore object rather than a zarr object (the names ar…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tylere
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants