Skip to content

Conversation

@jsignell
Copy link
Member

@jsignell jsignell commented Mar 10, 2023

With the following set up:

import planetary_computer
import pystac_client

catalog = pystac_client.Client.open(
    "https://planetarycomputer.microsoft.com/api/stac/v1",
    modifier=planetary_computer.sign_inplace,
)
collection = catalog.get_collection("nasa-nex-gddp-cmip6")
asset = collection.assets["ACCESS-CM2.historical"]

Without xpystac

import xarray as xr
import fsspec
import requests

references = requests.get(asset.href).json()
references = planetary_computer.sign(references)

reference_filesystem = fsspec.filesystem("reference", fo=references)

ds = xr.open_dataset(
    reference_filesystem.get_mapper("/"),
    engine="zarr",
    backend_kwargs={"consolidated": False},
    chunks={},
)
ds

With xpystac

import xarray as xr

ds = xr.open_dataset(asset)
ds

Closes #8

Note: code coverage is up to 88% after this PR.

@jsignell jsignell merged commit dfeab54 into main Mar 10, 2023
@jsignell jsignell deleted the test-ref-file branch March 10, 2023 14:51
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 this pull request may close these issues.

Test json objects

2 participants