Skip to content

Commit aebda16

Browse files
authored
FIX: Fix bugs in jma notebook (#134)
* FIX: Fix the broken link * FIX: Fix the issues with the jma radar example
1 parent 4405486 commit aebda16

File tree

2 files changed

+17
-39
lines changed

2 files changed

+17
-39
lines changed

_toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ parts:
1313
- file: notebooks/foundations/pyart-corrections
1414
- file: notebooks/foundations/pyart-gridding
1515
- file: notebooks/foundations/interactive-radar-visualization
16-
- file: notebooks/foundations/interactive-radar-visualization-jmaradar-cfradial1
1716
- caption: Example Workflows
1817
chapters:
1918
- file: notebooks/example-workflows/moore-oklahoma-tornado
@@ -22,3 +21,4 @@ parts:
2221
- file: notebooks/example-workflows/cacti-data-quality-example
2322
- file: notebooks/example-workflows/fastbarnes_interpolation_rhi
2423
- file: notebooks/example-workflows/echo_top_height
24+
- file: notebooks/example-workflows/interactive-radar-visualization-jmaradar-cfradial1

notebooks/foundations/interactive-radar-visualization-jmaradar-cfradial1.ipynb renamed to notebooks/example-workflows/interactive-radar-visualization-jmaradar-cfradial1.ipynb

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
"import pyart\n",
4848
"import hvplot.xarray\n",
4949
"import holoviews as hv\n",
50+
"from open_radar_data import DATASETS\n",
5051
"import panel as pn\n",
5152
"\n",
5253
"hv.extension(\"bokeh\")"
@@ -82,18 +83,6 @@
8283
"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)."
8384
]
8485
},
85-
{
86-
"cell_type": "code",
87-
"execution_count": null,
88-
"id": "27133c8d-ddd2-4557-acda-1b78dd8e3064",
89-
"metadata": {},
90-
"outputs": [],
91-
"source": [
92-
"!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",
93-
"!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",
94-
"!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"
95-
]
96-
},
9786
{
9887
"cell_type": "markdown",
9988
"id": "c1615d14-50a8-4786-adb8-7c6e80f0ce94",
@@ -111,8 +100,9 @@
111100
},
112101
"outputs": [],
113102
"source": [
114-
"files = glob.glob('./Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_*')\n",
115-
"files"
103+
"reflectivity_file = DATASETS.fetch(\"Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRref_N11_ANAL_cfrad.nc\")\n",
104+
"zdr_file = DATASETS.fetch(\"Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRzdr_N11_ANAL_cfrad.nc\")\n",
105+
"kdp_file = DATASETS.fetch(\"Z__C_RJTD_20230801200000_RDR_JMAGPV_RS47937_Gar0p250km0p35deg_PRkdp_N11_ANAL_cfrad.nc\")"
116106
]
117107
},
118108
{
@@ -133,7 +123,7 @@
133123
},
134124
"outputs": [],
135125
"source": [
136-
"radar = xd.io.open_cfradial1_datatree(files[0]).xradar.georeference()\n",
126+
"radar = xd.io.open_cfradial1_datatree(reflectivity_file).xradar.georeference()\n",
137127
"radar"
138128
]
139129
},
@@ -146,7 +136,7 @@
146136
},
147137
"outputs": [],
148138
"source": [
149-
"radar_zdr = xd.io.open_cfradial1_datatree(files[1]).xradar.georeference()\n",
139+
"radar_zdr = xd.io.open_cfradial1_datatree(zdr_file).xradar.georeference()\n",
150140
"radar_zdr"
151141
]
152142
},
@@ -159,7 +149,7 @@
159149
},
160150
"outputs": [],
161151
"source": [
162-
"radar_kdp = xd.io.open_cfradial1_datatree(files[2]).xradar.georeference()\n",
152+
"radar_kdp = xd.io.open_cfradial1_datatree(kdp_file).xradar.georeference()\n",
163153
"radar_kdp"
164154
]
165155
},
@@ -211,13 +201,11 @@
211201
" y='y',\n",
212202
" cmap='pyart_ChaseSpectral',\n",
213203
" clabel='Horizontal Reflectivity (dBZ)',\n",
214-
" title=f'Horizontal Reflectivity \\n {radar.attrs[\"site_name\"]} Radar',\n",
204+
" title=f'Horizontal Reflectivity \\n JMA {radar.attrs[\"site_name\"]} Radar',\n",
215205
" clim=(-20, 60),\n",
216206
" height=400,\n",
217207
" rasterize=True,\n",
218-
" width=500,)\n",
219-
"\n",
220-
"#ref"
208+
" width=500,)"
221209
]
222210
},
223211
{
@@ -233,12 +221,11 @@
233221
" y='y',\n",
234222
" cmap='pyart_ChaseSpectral',\n",
235223
" clabel='Differential Reflectivity (dB)',\n",
236-
" title=f'Differential Reflectivity \\n {radar.attrs[\"site_name\"]} Radar',\n",
224+
" title=f'Differential Reflectivity \\n JMA {radar.attrs[\"site_name\"]} Radar',\n",
237225
" clim=(-1, 6),\n",
238226
" height=400,\n",
239227
" rasterize=True,\n",
240-
" width=500,)\n",
241-
"#zdr"
228+
" width=500,)"
242229
]
243230
},
244231
{
@@ -254,12 +241,11 @@
254241
" y='y',\n",
255242
" cmap='pyart_ChaseSpectral',\n",
256243
" clabel='Specific differential phase (degree/km)',\n",
257-
" title=f'Specific differential phase \\n {radar.attrs[\"site_name\"]} Radar',\n",
244+
" title=f'Specific differential phase \\n JMA {radar.attrs[\"site_name\"]} Radar',\n",
258245
" clim=(-1, 6),\n",
259246
" height=400,\n",
260247
" rasterize=True,\n",
261-
" width=500,)\n",
262-
"#kdp"
248+
" width=500,)"
263249
]
264250
},
265251
{
@@ -280,17 +266,9 @@
280266
},
281267
"outputs": [],
282268
"source": [
283-
"(ref + zdr + kdp).cols(3)"
269+
"(ref + zdr + kdp).cols(1)"
284270
]
285271
},
286-
{
287-
"cell_type": "code",
288-
"execution_count": null,
289-
"id": "e916fa08-fd62-4c5a-9e12-2c9b46b1f74d",
290-
"metadata": {},
291-
"outputs": [],
292-
"source": []
293-
},
294272
{
295273
"cell_type": "markdown",
296274
"id": "65594dca-31c6-4b80-b5d7-92c101e07c97",
@@ -475,9 +453,9 @@
475453
],
476454
"metadata": {
477455
"kernelspec": {
478-
"display_name": "radar-cookbook-dev",
456+
"display_name": "Python 3 (ipykernel)",
479457
"language": "python",
480-
"name": "radar-cookbook-dev"
458+
"name": "python3"
481459
},
482460
"language_info": {
483461
"codemirror_mode": {

0 commit comments

Comments
 (0)