Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix recipe6 #91

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading