Skip to content

Commit

Permalink
fix recipe6 (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer authored Sep 27, 2023
1 parent 82f4fe9 commit ec4903e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions notebooks/workflow/recipe3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@
"outputs": [],
"source": [
"swp = gr_data[f\"sweep_{ee}\"].ds\n",
"swp = swp.set_coords(\"sweep_mode\")\n",
"display(swp)\n",
"print(swp.sweep_fixed_angle.values)"
]
Expand Down Expand Up @@ -378,13 +379,16 @@
"source": [
"# Todo: make height level parameterizable via keyword argument\n",
"# Todo: plot gr radar domain and satellite swath outlines\n",
"def plot_unmatched_refl(sr_data, gr_data, level=-5):\n",
"import cmweather\n",
"\n",
"\n",
"def plot_unmatched_refl(sr_data, swp, level=-5):\n",
" \"\"\"\n",
" Plotting unmatched SR and GR Reflectivity\n",
"\n",
" # Input:\n",
" # ------\n",
" gr_data ::: graund radar sweep data\n",
" swp ::: graund radar sweep data\n",
" sr_data ::: satellite data\n",
"\n",
" # Output:\n",
Expand All @@ -398,7 +402,7 @@
" pm = sr_data.zFactorCorrected[:, :, level].plot(\n",
" x=\"Longitude\",\n",
" y=\"Latitude\",\n",
" cmap=\"jet\",\n",
" cmap=\"HomeyerRainbow\",\n",
" vmin=0,\n",
" vmax=40,\n",
" add_labels=False,\n",
Expand All @@ -416,16 +420,13 @@
" ax1.set_ylim(sr_data.Latitude.min(), sr_data.Latitude.max())\n",
"\n",
" ax2 = plt.subplot(1, 2, 2)\n",
" swp = gr_data[\"sweep_2\"].ds\n",
" ll = swp.wrl.georef.spherical_to_proj()\n",
" swp = swp.assign_coords(lon=ll[..., 0], lat=ll[..., 1])\n",
" pm = swp.DBZH.plot(\n",
" x=\"lon\",\n",
" y=\"lat\",\n",
" cmap=\"jet\",\n",
" vmin=0,\n",
" vmax=40,\n",
" ax=ax2,\n",
" cmap=\"HomeyerRainbow\",\n",
" add_labels=False,\n",
" add_colorbar=False,\n",
" )\n",
Expand All @@ -452,7 +453,7 @@
" level = 75\n",
"else:\n",
" level = 171\n",
"plot_unmatched_refl(sr_data, gr_data, level=level)"
"plot_unmatched_refl(sr_data, swp, level=level)"
]
},
{
Expand Down Expand Up @@ -1541,7 +1542,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0"
"version": "3.11.5"
},
"toc": {
"colors": {
Expand Down

0 comments on commit ec4903e

Please sign in to comment.