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

kerchunk:indices not in the properties metadata of nasa-nex-gddp-cmip6" #390

Open
alepr opened this issue Nov 7, 2024 · 2 comments
Open

Comments

@alepr
Copy link

alepr commented Nov 7, 2024

I am trying to follow the example for NASA NEX-GDDP-CMIP6 to ensemble the layers with Kerchunk, but I get a KeyError because the 'indices' key is not in the metadata. Is there another method to perform the ensemble of layers?
Image

@ghidalgo3
Copy link

@alepr could you share the STAC query you made to retrieve items? I ran the example notebook I could not reproduce the error you got.

@alepr
Copy link
Author

alepr commented Nov 8, 2024

Hi, thanks for the reply. I tried running the script with this query: {"cmip6:model": {"eq": "ACCESS-CM2"}, "cmip6:scenario": {"eq": "ssp245"}}. I'm not sure if I'm doing it correctly. I'm a newbie in STAC and Microsoft Planetary Computer. I need this information for a research paper, and I would like to try using Planetary Computer. My items collection indicates 86 items, This is my script:

import planetary_computer
import xarray as xr
import fsspec
import pystac_client

catalog = pystac_client.Client.open(
    "https://planetarycomputer-test.microsoft.com/stac",
    modifier=planetary_computer.sign_inplace,
)
search = catalog.search(
    collections=["nasa-nex-gddp-cmip6"],
    datetime="2015/2100",
    query={"cmip6:model": {"eq": model}, "cmip6:scenario":{"eq": "ssp245"}},
)
items = search.item_collection()


for i in range(len(items[0].properties["kerchunk:indices"]["refs"])):
    if i % 100 == 1:
        print(
            list(items[0].properties["kerchunk:indices"]["refs"].keys())[i],
            items[0].properties["kerchunk:indices"]["refs"][
                list(items[0].properties["kerchunk:indices"]["refs"].keys())[i]
            ],
        )


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