Skip to content

Commit

Permalink
FIX: Fix bugs in jma notebook (#134)
Browse files Browse the repository at this point in the history
* FIX: Fix the broken link

* FIX: Fix the issues with the jma radar example
  • Loading branch information
mgrover1 authored Jun 13, 2024
1 parent 4405486 commit aebda16
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 39 deletions.
2 changes: 1 addition & 1 deletion _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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\")"
Expand Down Expand Up @@ -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",
Expand All @@ -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\")"
]
},
{
Expand All @@ -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"
]
},
Expand All @@ -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"
]
},
Expand All @@ -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"
]
},
Expand Down Expand Up @@ -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,)"
]
},
{
Expand All @@ -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,)"
]
},
{
Expand All @@ -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,)"
]
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit aebda16

Please sign in to comment.