You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An example (requires installing the pangeo-forge-esgf PR branch):
frompangeo_forge_esgf.async_clientimportESGFAsyncClient;importasyncioimportintakedefzstore_to_iid(zstore: str):
# this is a bit whacky to account for the different way of storing old/new storesiid='.'.join(zstore.replace('gs://','').replace('.zarr','').replace('.','/').split('/')[-11:-1])
ifnotiid.startswith('CMIP6'):
iid='.'.join(zstore.replace('gs://','').replace('.zarr','').replace('.','/').split('/')[-10:])
returniiddefsearch_iids(col_url:str):
col=intake.open_esm_datastore(col_url)
iids_all= [zstore_to_iid(z) forzincol.df['zstore'].tolist()]
return [iidforiidiniids_allifiidiniids_requested]
asyncwithESGFAsyncClient() asclient:
iids_requested=awaitclient.expand_iids(["CMIP6.*.*.*.[historical, ssp245].*.[Amon,mon].tas.*.*"])
url_dict= {
'qc':"https://storage.googleapis.com/cmip6/cmip6-pgf-ingestion-test/catalog/catalog.json",
'non-qc':"https://storage.googleapis.com/cmip6/cmip6-pgf-ingestion-test/catalog/catalog_noqc.json",
'retracted':"https://storage.googleapis.com/cmip6/cmip6-pgf-ingestion-test/catalog/catalog_retracted.json"
}
iids_found= []
forcatalog,urlinurl_dict.items():
iids=search_iids(url)
iids_found.extend(iids)
print(f"Found in {catalog=}: {iids=}\n")
missing_iids=list(set(iids_requested) -set(iids_found))
print(f"\n\nStill missing {len(missing_iids)} of {len(iids_requested)}: \n{missing_iids=}")
Waiting on https://github.com/jbusecke/pangeo-forge-esgf/pulls
Once that is merged, I want to update the instructions in a few places:
All of these should support passing wildcard/square bracket strings.
The text was updated successfully, but these errors were encountered: