Skip to content

Instantly share code, notes, and snippets.

@ghidalgo3
Last active August 26, 2024 15:01
Show Gist options
  • Save ghidalgo3/3c7152147a6d25773615a783968abd67 to your computer and use it in GitHub Desktop.
Save ghidalgo3/3c7152147a6d25773615a783968abd67 to your computer and use it in GitHub Desktop.
# ! pip install xarray adlfs zarr planetary_computer matplotlib
from adlfs import AzureBlobFileSystem
import xarray as xr
import planetary_computer
signed_url = planetary_computer.sign("https://azureopendatastorage.blob.core.windows.net/noaa/conus404.zarr/")
_, sas_token = signed_url.split("?", 1)
fs = AzureBlobFileSystem(account_name="azureopendatastorage", sas_token=sas_token)
ds = xr.open_zarr(fs.get_mapper("az://noaa/conus404.zarr"))
ds # In a notebook, print this out to see all 200+ variables
print(f"{ds.nbytes / 1e15} PB dataset size")
ds.SNOWH[0, :, :].plot()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment