Created
October 20, 2021 17:43
-
-
Save cisaacstern/59cadd26a32e5fe554b5425856d7ae83 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"id": "975ecd07-82e0-4307-98b8-591cc0af57a4", | |
"metadata": { | |
"tags": [] | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"<xarray.Dataset>\n", | |
"Dimensions: (time: 14532, zlev: 1, lat: 720, lon: 1440)\n", | |
"Coordinates:\n", | |
" * lat (lat) float32 -89.88 -89.62 -89.38 -89.12 ... 89.38 89.62 89.88\n", | |
" * lon (lon) float32 0.125 0.375 0.625 0.875 ... 359.1 359.4 359.6 359.9\n", | |
" * time (time) datetime64[ns] 1981-09-01T12:00:00 ... 2021-06-14T12:00:00\n", | |
" * zlev (zlev) float32 0.0\n", | |
"Data variables:\n", | |
" anom (time, zlev, lat, lon) float32 dask.array<chunksize=(20, 1, 720, 1440), meta=np.ndarray>\n", | |
" err (time, zlev, lat, lon) float32 dask.array<chunksize=(20, 1, 720, 1440), meta=np.ndarray>\n", | |
" ice (time, zlev, lat, lon) float32 dask.array<chunksize=(20, 1, 720, 1440), meta=np.ndarray>\n", | |
" sst (time, zlev, lat, lon) float32 dask.array<chunksize=(20, 1, 720, 1440), meta=np.ndarray>\n", | |
"Attributes: (12/37)\n", | |
" Conventions: CF-1.6, ACDD-1.3\n", | |
" cdm_data_type: Grid\n", | |
" comment: Data was converted from NetCDF-3 to NetCDF-4 ...\n", | |
" creator_email: oisst-help@noaa.gov\n", | |
" creator_url: https://www.ncei.noaa.gov/\n", | |
" date_created: 2020-05-08T19:05:13Z\n", | |
" ... ...\n", | |
" source: ICOADS, NCEP_GTS, GSFC_ICE, NCEP_ICE, Pathfin...\n", | |
" standard_name_vocabulary: CF Standard Name Table (v40, 25 January 2017)\n", | |
" summary: NOAAs 1/4-degree Daily Optimum Interpolation ...\n", | |
" time_coverage_end: 1981-09-01T23:59:59Z\n", | |
" time_coverage_start: 1981-09-01T00:00:00Z\n", | |
" title: NOAA/NCEI 1/4 Degree Daily Optimum Interpolat...\n" | |
] | |
} | |
], | |
"source": [ | |
"# HTTP opening\n", | |
"import xarray as xr\n", | |
"\n", | |
"path = \"https://ncsa.osn.xsede.org/Pangeo/pangeo-forge/noaa_oisst/v2.1-avhrr.zarr\"\n", | |
"ds = xr.open_zarr(path, consolidated=True)\n", | |
"\n", | |
"print(ds)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 2, | |
"id": "d92213b5-8ea4-4407-9690-7a8bdd6097ba", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"<xarray.Dataset>\n", | |
"Dimensions: (time: 14532, zlev: 1, lat: 720, lon: 1440)\n", | |
"Coordinates:\n", | |
" * lat (lat) float32 -89.88 -89.62 -89.38 -89.12 ... 89.38 89.62 89.88\n", | |
" * lon (lon) float32 0.125 0.375 0.625 0.875 ... 359.1 359.4 359.6 359.9\n", | |
" * time (time) datetime64[ns] 1981-09-01T12:00:00 ... 2021-06-14T12:00:00\n", | |
" * zlev (zlev) float32 0.0\n", | |
"Data variables:\n", | |
" anom (time, zlev, lat, lon) float32 dask.array<chunksize=(20, 1, 720, 1440), meta=np.ndarray>\n", | |
" err (time, zlev, lat, lon) float32 dask.array<chunksize=(20, 1, 720, 1440), meta=np.ndarray>\n", | |
" ice (time, zlev, lat, lon) float32 dask.array<chunksize=(20, 1, 720, 1440), meta=np.ndarray>\n", | |
" sst (time, zlev, lat, lon) float32 dask.array<chunksize=(20, 1, 720, 1440), meta=np.ndarray>\n", | |
"Attributes: (12/37)\n", | |
" Conventions: CF-1.6, ACDD-1.3\n", | |
" cdm_data_type: Grid\n", | |
" comment: Data was converted from NetCDF-3 to NetCDF-4 ...\n", | |
" creator_email: oisst-help@noaa.gov\n", | |
" creator_url: https://www.ncei.noaa.gov/\n", | |
" date_created: 2020-05-08T19:05:13Z\n", | |
" ... ...\n", | |
" source: ICOADS, NCEP_GTS, GSFC_ICE, NCEP_ICE, Pathfin...\n", | |
" standard_name_vocabulary: CF Standard Name Table (v40, 25 January 2017)\n", | |
" summary: NOAAs 1/4-degree Daily Optimum Interpolation ...\n", | |
" time_coverage_end: 1981-09-01T23:59:59Z\n", | |
" time_coverage_start: 1981-09-01T00:00:00Z\n", | |
" title: NOAA/NCEI 1/4 Degree Daily Optimum Interpolat...\n" | |
] | |
} | |
], | |
"source": [ | |
"# S3 opening\n", | |
"import fsspec\n", | |
"import xarray as xr\n", | |
"\n", | |
"path = \"s3://Pangeo/pangeo-forge/noaa_oisst/v2.1-avhrr.zarr\"\n", | |
"kwargs = dict(anon=True, client_kwargs={'endpoint_url': 'https://ncsa.osn.xsede.org'})\n", | |
"mapper = fsspec.get_mapper(path, **kwargs)\n", | |
"\n", | |
"ds = xr.open_zarr(mapper, consolidated=True)\n", | |
"\n", | |
"print(ds)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"id": "fad6afe5-e7f2-4f72-a903-c207823dd383", | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "pangeo-forge3.8", | |
"language": "python", | |
"name": "pangeo-forge3.8" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.8.8" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 5 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment