Skip to content

Commit

Permalink
Rename notebooks for easier navigation from the Hub (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrjones authored Jul 18, 2023
1 parent 8e45d17 commit 52baa7a
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 648 deletions.
14 changes: 7 additions & 7 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ parts:
- file: notebooks/how-to-cite
- caption: Foundations
chapters:
- file: notebooks/foundations/kerchunk_basics
- file: notebooks/foundations/kerchunk_multi_file
- file: notebooks/foundations/kerchunk_dask
- file: notebooks/foundations/01_kerchunk_basics
- file: notebooks/foundations/02_kerchunk_multi_file
- file: notebooks/foundations/03_kerchunk_dask

- caption: Case Studies
chapters:
- file: notebooks/case_studies/ARG_Weather
- file: notebooks/case_studies/HRRR
- file: notebooks/case_studies/TIFF
- file: notebooks/case_studies/pangeo_forge
- file: notebooks/case_studies/NetCDF_SMN_Arg
- file: notebooks/case_studies/GRIB2_HRRR
- file: notebooks/case_studies/GeoTIFF_FMI
- file: notebooks/case_studies/NetCDF_Pangeo_Forge_gridMET
2 changes: 1 addition & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: dask-tutorial
name: kerchunk-tutorial
channels:
- conda-forge
dependencies:
Expand Down
572 changes: 0 additions & 572 deletions notebooks/case_studies/ARG_combined.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "9eced552",
"metadata": {},
Expand Down Expand Up @@ -70,7 +69,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "0e7ce9e2",
"metadata": {},
Expand Down Expand Up @@ -143,8 +141,8 @@
"# retrieve list of available days in archive\n",
"days_available = fs_read.glob(\"s3://noaa-hrrr-bdp-pds/hrrr.*\")\n",
"\n",
"# Read HRRR GRIB2 files from latest day\n",
"files = fs_read.glob(f\"s3://{days_available[-1]}/conus/*wrfsfcf01.grib2\")\n",
"# Read HRRR GRIB2 files from April 19, 2023\n",
"files = fs_read.glob(f\"s3://noaa-hrrr-bdp-pds/hrrr.20230419/conus/*wrfsfcf01.grib2\")\n",
"\n",
"# Append s3 prefix for filelist\n",
"files = sorted([\"s3://\" + f for f in files])\n",
Expand All @@ -165,18 +163,6 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cf13b333",
"metadata": {},
"outputs": [],
"source": [
"\"s3://noaa-hrrr-bdp-pds/hrrr.20230419/conus/hrrr.t00z.wrfsfcf01.grib2\"\n",
"\"s3://noaa-hrrr-bdp-pds/hrrr.20230419/conus/hrrr.t00z.wrfsfcf01.grib2\""
]
},
{
"attachments": {},
"cell_type": "markdown",
"id": "3bec2881",
"metadata": {},
Expand Down Expand Up @@ -327,7 +313,7 @@
"outputs": [],
"source": [
"# Write Kerchunk .json record\n",
"output_fname = \"HRRR_combined.json\"\n",
"output_fname = \"references/HRRR_combined.json\"\n",
"with open(f\"{output_fname}\", \"wb\") as f:\n",
" f.write(ujson.dumps(multi_kerchunk).encode())"
]
Expand All @@ -349,7 +335,10 @@
"source": [
"# open dataset as zarr object using fsspec reference file system and Xarray\n",
"fs = fsspec.filesystem(\n",
" \"reference\", fo=multi_kerchunk, remote_protocol=\"s3\", remote_options={\"anon\": True}\n",
" \"reference\",\n",
" fo=\"references/HRRR_combined.json\",\n",
" remote_protocol=\"s3\",\n",
" remote_options={\"anon\": True},\n",
")\n",
"m = fs.get_mapper(\"\")\n",
"ds = xr.open_dataset(\n",
Expand Down Expand Up @@ -396,14 +385,6 @@
"source": [
"ds[\"t2m\"][:, 500, 500].plot()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "be917a4b",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -422,7 +403,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.10.11"
},
"vscode": {
"interpreter": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# Kerchunk, GeoTIFF and Generating Coordinates with `xrefcoord`\n"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"<img src=\"../images/radar.png\" width=400 alt=\"ARG\"></img>"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -42,7 +39,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -81,7 +77,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -124,7 +119,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -166,7 +160,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -221,7 +214,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -264,13 +256,12 @@
"multi_kerchunk = mzz.translate()\n",
"\n",
"# Write kerchunk .json record\n",
"output_fname = \"RADAR.json\"\n",
"output_fname = \"references/RADAR.json\"\n",
"with open(f\"{output_fname}\", \"wb\") as f:\n",
" f.write(ujson.dumps(multi_kerchunk).encode())"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -285,7 +276,7 @@
"source": [
"fs = fsspec.filesystem(\n",
" \"reference\",\n",
" fo=\"RADAR.json\",\n",
" fo=\"references/RADAR.json\",\n",
" remote_protocol=\"s3\",\n",
" remote_options={\"anon\": True},\n",
" skip_instance_cache=True,\n",
Expand All @@ -304,7 +295,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -327,7 +317,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -346,7 +335,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand All @@ -367,7 +355,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "kerchunk-cookbook-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -381,9 +369,9 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.10.11"
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -37,7 +36,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -135,7 +133,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -179,7 +176,7 @@
"metadata": {},
"source": [
"## Create a Location For Output\n",
"For this example, we are creating a temporary directory to write the data to. If we wanted to persist this Kerchunk reference, we could write to local disc or cloud storage. "
"We write to local storage for this example, but the reference file could also be shared via cloud storage. "
]
},
{
Expand All @@ -190,14 +187,8 @@
},
"outputs": [],
"source": [
"import os\n",
"from tempfile import TemporaryDirectory\n",
"\n",
"td = TemporaryDirectory()\n",
"target_root = td.name\n",
"target_root = \"esip\"\n",
"store_name = \"PF_kerchunk\"\n",
"target_store = os.path.join(target_root, store_name)"
"target_root = \"references\"\n",
"store_name = \"Pangeo_Forge\""
]
},
{
Expand Down Expand Up @@ -426,8 +417,6 @@
"outputs": [],
"source": [
"# prepare urls\n",
"\n",
"\n",
"def url_gen(year):\n",
" return (\n",
" f\"http://thredds.northwestknowledge.net:8080/thredds/dodsC/MET/bi/bi_{year}.nc\"\n",
Expand Down Expand Up @@ -516,7 +505,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "kerchunk-cookbook-dev",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -530,7 +519,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.12"
"version": "3.10.11"
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -66,7 +65,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -200,7 +198,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -254,7 +251,6 @@
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
Expand Down Expand Up @@ -282,7 +278,7 @@
"multi_kerchunk = mzz.translate()\n",
"\n",
"# Write kerchunk .json record\n",
"output_fname = \"ARG_combined.json\"\n",
"output_fname = \"references/ARG_combined.json\"\n",
"with open(f\"{output_fname}\", \"wb\") as f:\n",
" f.write(ujson.dumps(multi_kerchunk).encode())"
]
Expand All @@ -307,7 +303,7 @@
"\n",
"fs = fsspec.filesystem(\n",
" \"reference\",\n",
" fo=\"ARG_combined.json\",\n",
" fo=\"references/ARG_combined.json\",\n",
" remote_protocol=\"s3\",\n",
" remote_options={\"anon\": True},\n",
" skip_instance_cache=True,\n",
Expand Down Expand Up @@ -369,7 +365,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.10.11"
},
"vscode": {
"interpreter": {
Expand All @@ -378,5 +374,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
1 change: 1 addition & 0 deletions notebooks/case_studies/references/ARG_combined.json

Large diffs are not rendered by default.

Loading

0 comments on commit 52baa7a

Please sign in to comment.