From ec4903ebe3b0d34860fa74d755bb1b0dd65daa07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20M=C3=BChlbauer?= Date: Wed, 27 Sep 2023 19:16:39 +0200 Subject: [PATCH] fix recipe6 (#91) --- notebooks/workflow/recipe3.ipynb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/notebooks/workflow/recipe3.ipynb b/notebooks/workflow/recipe3.ipynb index c8d46dff..7f4fcba5 100644 --- a/notebooks/workflow/recipe3.ipynb +++ b/notebooks/workflow/recipe3.ipynb @@ -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)" ] @@ -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", @@ -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", @@ -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", @@ -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)" ] }, { @@ -1541,7 +1542,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.0" + "version": "3.11.5" }, "toc": { "colors": {