From aebda16773a61791a7aaf1defd1f05f706134926 Mon Sep 17 00:00:00 2001 From: Max Grover Date: Thu, 13 Jun 2024 11:33:38 -0600 Subject: [PATCH] FIX: Fix bugs in jma notebook (#134) * FIX: Fix the broken link * FIX: Fix the issues with the jma radar example --- _toc.yml | 2 +- ...dar-visualization-jmaradar-cfradial1.ipynb | 54 ++++++------------- 2 files changed, 17 insertions(+), 39 deletions(-) rename notebooks/{foundations => example-workflows}/interactive-radar-visualization-jmaradar-cfradial1.ipynb (89%) diff --git a/_toc.yml b/_toc.yml index baee52f4..c91a296e 100644 --- a/_toc.yml +++ b/_toc.yml @@ -13,7 +13,6 @@ parts: - file: notebooks/foundations/pyart-corrections - file: notebooks/foundations/pyart-gridding - file: notebooks/foundations/interactive-radar-visualization - - file: notebooks/foundations/interactive-radar-visualization-jmaradar-cfradial1 - caption: Example Workflows chapters: - file: notebooks/example-workflows/moore-oklahoma-tornado @@ -22,3 +21,4 @@ parts: - file: notebooks/example-workflows/cacti-data-quality-example - file: notebooks/example-workflows/fastbarnes_interpolation_rhi - file: notebooks/example-workflows/echo_top_height + - file: notebooks/example-workflows/interactive-radar-visualization-jmaradar-cfradial1 diff --git a/notebooks/foundations/interactive-radar-visualization-jmaradar-cfradial1.ipynb b/notebooks/example-workflows/interactive-radar-visualization-jmaradar-cfradial1.ipynb similarity index 89% rename from notebooks/foundations/interactive-radar-visualization-jmaradar-cfradial1.ipynb rename to notebooks/example-workflows/interactive-radar-visualization-jmaradar-cfradial1.ipynb index 9ddab069..0fa530bf 100644 --- a/notebooks/foundations/interactive-radar-visualization-jmaradar-cfradial1.ipynb +++ b/notebooks/example-workflows/interactive-radar-visualization-jmaradar-cfradial1.ipynb @@ -47,6 +47,7 @@ "import pyart\n", "import hvplot.xarray\n", "import holoviews as hv\n", + "from open_radar_data import DATASETS\n", "import panel as pn\n", "\n", "hv.extension(\"bokeh\")" @@ -82,18 +83,6 @@ "Here, we use data from the Japanese weather radar, using sample data [from here](https://github.com/openradar/asean2024-pyrad-course/tree/main/data/JMA)." ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "27133c8d-ddd2-4557-acda-1b78dd8e3064", - "metadata": {}, - "outputs": [], - "source": [ - "!wget -nc https://github.com/openradar/asean2024-pyrad-course/raw/main/data/JMA/Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRref_N11_ANAL_cfrad.nc\n", - "!wget -nc https://github.com/openradar/asean2024-pyrad-course/raw/main/data/JMA/Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRzdr_N11_ANAL_cfrad.nc\n", - "!wget -nc https://github.com/openradar/asean2024-pyrad-course/raw/main/data/JMA/Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRkdp_N11_ANAL_cfrad.nc" - ] - }, { "cell_type": "markdown", "id": "c1615d14-50a8-4786-adb8-7c6e80f0ce94", @@ -111,8 +100,9 @@ }, "outputs": [], "source": [ - "files = glob.glob('./Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_*')\n", - "files" + "reflectivity_file = DATASETS.fetch(\"Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRref_N11_ANAL_cfrad.nc\")\n", + "zdr_file = DATASETS.fetch(\"Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRzdr_N11_ANAL_cfrad.nc\")\n", + "kdp_file = DATASETS.fetch(\"Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRkdp_N11_ANAL_cfrad.nc\")" ] }, { @@ -133,7 +123,7 @@ }, "outputs": [], "source": [ - "radar = xd.io.open_cfradial1_datatree(files[0]).xradar.georeference()\n", + "radar = xd.io.open_cfradial1_datatree(reflectivity_file).xradar.georeference()\n", "radar" ] }, @@ -146,7 +136,7 @@ }, "outputs": [], "source": [ - "radar_zdr = xd.io.open_cfradial1_datatree(files[1]).xradar.georeference()\n", + "radar_zdr = xd.io.open_cfradial1_datatree(zdr_file).xradar.georeference()\n", "radar_zdr" ] }, @@ -159,7 +149,7 @@ }, "outputs": [], "source": [ - "radar_kdp = xd.io.open_cfradial1_datatree(files[2]).xradar.georeference()\n", + "radar_kdp = xd.io.open_cfradial1_datatree(kdp_file).xradar.georeference()\n", "radar_kdp" ] }, @@ -211,13 +201,11 @@ " y='y',\n", " cmap='pyart_ChaseSpectral',\n", " clabel='Horizontal Reflectivity (dBZ)',\n", - " title=f'Horizontal Reflectivity \\n {radar.attrs[\"site_name\"]} Radar',\n", + " title=f'Horizontal Reflectivity \\n JMA {radar.attrs[\"site_name\"]} Radar',\n", " clim=(-20, 60),\n", " height=400,\n", " rasterize=True,\n", - " width=500,)\n", - "\n", - "#ref" + " width=500,)" ] }, { @@ -233,12 +221,11 @@ " y='y',\n", " cmap='pyart_ChaseSpectral',\n", " clabel='Differential Reflectivity (dB)',\n", - " title=f'Differential Reflectivity \\n {radar.attrs[\"site_name\"]} Radar',\n", + " title=f'Differential Reflectivity \\n JMA {radar.attrs[\"site_name\"]} Radar',\n", " clim=(-1, 6),\n", " height=400,\n", " rasterize=True,\n", - " width=500,)\n", - "#zdr" + " width=500,)" ] }, { @@ -254,12 +241,11 @@ " y='y',\n", " cmap='pyart_ChaseSpectral',\n", " clabel='Specific differential phase (degree/km)',\n", - " title=f'Specific differential phase \\n {radar.attrs[\"site_name\"]} Radar',\n", + " title=f'Specific differential phase \\n JMA {radar.attrs[\"site_name\"]} Radar',\n", " clim=(-1, 6),\n", " height=400,\n", " rasterize=True,\n", - " width=500,)\n", - "#kdp" + " width=500,)" ] }, { @@ -280,17 +266,9 @@ }, "outputs": [], "source": [ - "(ref + zdr + kdp).cols(3)" + "(ref + zdr + kdp).cols(1)" ] }, - { - "cell_type": "code", - "execution_count": null, - "id": "e916fa08-fd62-4c5a-9e12-2c9b46b1f74d", - "metadata": {}, - "outputs": [], - "source": [] - }, { "cell_type": "markdown", "id": "65594dca-31c6-4b80-b5d7-92c101e07c97", @@ -475,9 +453,9 @@ ], "metadata": { "kernelspec": { - "display_name": "radar-cookbook-dev", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "radar-cookbook-dev" + "name": "python3" }, "language_info": { "codemirror_mode": {