From 6ce3c774a7c6101f62d12d1cd8145506ba9d044a Mon Sep 17 00:00:00 2001 From: Shay Carter Date: Wed, 8 Nov 2023 12:44:42 -0700 Subject: [PATCH] Small changes to the web version of the accumulated precipi roi notebook - use metpy.units - add "accumulated" to plot titles --- .../Precip_Accumulation_Region_of_Interest.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/notebooks/Precip_Accumulation_Region_of_Interest.ipynb b/examples/notebooks/Precip_Accumulation_Region_of_Interest.ipynb index dd177b4..48874ee 100644 --- a/examples/notebooks/Precip_Accumulation_Region_of_Interest.ipynb +++ b/examples/notebooks/Precip_Accumulation_Region_of_Interest.ipynb @@ -210,7 +210,7 @@ " print(data.min(), data.max(), grid.getDataTime().getFcstTime()/3600)\n", "\n", " # Convert from mm to inches\n", - " result = data * (0.0393701)\n", + " result = (data * units.mm).to(units.inch)\n", " \n", " ii,jj = np.where(result==result.max())\n", " i=ii[0]\n", @@ -392,7 +392,7 @@ "fig, ax = make_map(bbox=bbox)\n", "cs = ax.pcolormesh(lons, lats, tp_inch, cmap=cmap)\n", "cbar = fig.colorbar(cs, shrink=0.7, orientation='horizontal')\n", - "cbar.set_label(grid.getLocationName() + \" Total precipitation in inches, \" \\\n", + "cbar.set_label(grid.getLocationName() + \" Total accumulated precipitation in inches, \" \\\n", " + str(fcstHr) + \"-hr fcst valid \" + str(grid.getDataTime().getRefTime()))\n", "\n", "ax.scatter(maxPoint.x, maxPoint.y, s=300,\n", @@ -446,7 +446,7 @@ "\n", "cs = ax.pcolormesh(lons, lats, tp_inch, cmap=cmap)\n", "cbar = fig.colorbar(cs, shrink=0.7, orientation='horizontal')\n", - "cbar.set_label(grid.getLocationName() + \" Total precipitation in inches, \" \\\n", + "cbar.set_label(grid.getLocationName() + \" Total accumulated precipitation in inches, \" \\\n", " + str(fcstHr) + \"-hr fcst valid \" + str(grid.getDataTime().getRefTime()))\n", "\n", "ax.scatter(maxPoint.x, maxPoint.y, s=300,\n", @@ -607,7 +607,7 @@ "\n", "cs = ax.pcolormesh(roiLons, roiLats, roi_data, cmap=cmap)\n", "cbar = fig.colorbar(cs, shrink=0.7, orientation='horizontal')\n", - "cbar.set_label(roiGrid.getLocationName() + \" Total precipitation in inches, \" \\\n", + "cbar.set_label(roiGrid.getLocationName() + \" Total accumulated precipitation in inches, \" \\\n", " + str(roiFcstHr) + \"-hr fcst valid \" + str(roiGrid.getDataTime().getRefTime()))\n", "\n", "ax.scatter(maxPoint.x, maxPoint.y, s=300,\n",