Skip to content

Instantly share code, notes, and snippets.

View rabernat's full-sized avatar

Ryan Abernathey rabernat

View GitHub Profile
@rabernat
rabernat / NASA_earthdata_OPeNDAP_xarray.py
Created December 2, 2021 17:48
Load NASA EarthData OPeNDAP via Xarray
# first make sure lxml is installed
# pip install lxml
# browse to a Hyrax opendap link, e.g.
# https://acdisc.gesdisc.eosdis.nasa.gov/opendap/hyrax/CMS/GEOS_CASAGFED_D_FIRE.3/GEOSCarb_CASAGFED3v3_Fire.Daily.x720_y360.2003.nc.html
import xarray as xr
from pydap.client import open_url
from pydap.cas.urs import setup_session
@rabernat
rabernat / mds_zarr_adaptor.py
Created October 29, 2021 18:50
Expose mitgcm mds files as zarr arrays
from collections.abc import Mapping
import json
from typing import Tuple, List, Optional, Any
from pydantic import validator
from pydantic.dataclasses import dataclass
from fsspec.implementations.reference import ReferenceFileSystem
import numpy as np
import zarr
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rabernat
rabernat / xgcm_boundary_conditions.ipynb
Last active October 8, 2021 15:37
Exploration of map_overlap stuff in the context of xgcm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"version": 1, "templates": {"a": "s3://esgf-world/CMIP6/OMIP/NOAA-GFDL/GFDL-CM4/omip1/r1i1p1f1/Omon/thetao/gr/v20180701/thetao_Omon_GFDL-CM4_omip1_r1i1p1f1_gr_170801-172712.nc", "b": "s3://esgf-world/CMIP6/OMIP/NOAA-GFDL/GFDL-CM4/omip1/r1i1p1f1/Omon/thetao/gr/v20180701/thetao_Omon_GFDL-CM4_omip1_r1i1p1f1_gr_172801-174712.nc", "c": "s3://esgf-world/CMIP6/OMIP/NOAA-GFDL/GFDL-CM4/omip1/r1i1p1f1/Omon/thetao/gr/v20180701/thetao_Omon_GFDL-CM4_omip1_r1i1p1f1_gr_174801-176712.nc", "d": "s3://esgf-world/CMIP6/OMIP/NOAA-GFDL/GFDL-CM4/omip1/r1i1p1f1/Omon/thetao/gr/v20180701/thetao_Omon_GFDL-CM4_omip1_r1i1p1f1_gr_176801-178712.nc", "e": "s3://esgf-world/CMIP6/OMIP/NOAA-GFDL/GFDL-CM4/omip1/r1i1p1f1/Omon/thetao/gr/v20180701/thetao_Omon_GFDL-CM4_omip1_r1i1p1f1_gr_178801-180712.nc", "f": "s3://esgf-world/CMIP6/OMIP/NOAA-GFDL/GFDL-CM4/omip1/r1i1p1f1/Omon/thetao/gr/v20180701/thetao_Omon_GFDL-CM4_omip1_r1i1p1f1_gr_180801-182712.nc", "g": "s3://esgf-world/CMIP6/OMIP/NOAA-GFDL/GFDL-CM4/omip1/r1i1p1f1/Omon/thetao/gr/v20180701/the
@rabernat
rabernat / anomaly_std.ipynb
Last active August 2, 2021 17:46
Test case for dask distributed scheduler
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rabernat
rabernat / zarr-cloudfiles.ipynb
Created June 4, 2021 03:31
CloudFilesStore for Zarr
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.