Skip to content

Commit 18ccf41

Browse files
authored
Merge pull request #122 from kgoebber/fix_119
fixed a few issues related to issue 119
2 parents f482cf0 + d6b6a21 commit 18ccf41

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

pages/gallery/Upperair_Obs.ipynb

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@
351351
"# Temperature, smooth, and convert to Celsius\n",
352352
"tmpk = ds.Temperature_isobaric.metpy.sel(\n",
353353
" vertical=level*units.hPa, time=date, lat=slice(70, 15), lon=slice(360-145, 360-50))\n",
354-
"smooth_tmpc = (mpcalc.smooth_n_point(tmpk, 9, 10)).to('degC')"
354+
"smooth_tmpc = (mpcalc.smooth_n_point(tmpk, 9, 10)).metpy.convert_units('degC')"
355355
]
356356
},
357357
{
@@ -444,7 +444,7 @@
444444
"# Plot Dashed Contours of Temperature\n",
445445
"cs2 = ax.contour(hght.lon, hght.lat, smooth_tmpc, range(-60, 51, 5),\n",
446446
" colors='black', transform=ccrs.PlateCarree())\n",
447-
"clabels = plt.clabel(cs2, fmt='%d', colors='white', inline_spacing=5, use_clabeltext=True)\n",
447+
"clabels = plt.clabel(cs2, fmt='%d', colors='black', inline_spacing=5, use_clabeltext=True)\n",
448448
"\n",
449449
"# Set longer dashes than default\n",
450450
"for c in cs2.collections:\n",
@@ -460,16 +460,23 @@
460460
" marker='o', color='black', transform=ccrs.PlateCarree())\n",
461461
"\n",
462462
"# Use definition to plot H/L symbols\n",
463-
"plot_maxmin_points(hght.lon, hght.lat, smooth_hght.m, 'max', 50,\n",
463+
"plot_maxmin_points(hght.lon, hght.lat, smooth_hght.values, 'max', 50,\n",
464464
" symbol='H', color='black', transform=ccrs.PlateCarree())\n",
465-
"plot_maxmin_points(hght.lon, hght.lat, smooth_hght.m, 'min', 25,\n",
465+
"plot_maxmin_points(hght.lon, hght.lat, smooth_hght.values, 'min', 25,\n",
466466
" symbol='L', color='black', transform=ccrs.PlateCarree())\n",
467467
"\n",
468468
"# Add titles\n",
469-
"plt.title('Upper-air Observations at {}-hPa Analysis Heights/Temperature'.format(level),\n",
469+
"plt.title(f'Upper-air Observations at {level}-hPa Analysis Heights/Temperature',\n",
470470
" loc='left')\n",
471471
"plt.title(f'Valid: {date}', loc='right');"
472472
]
473+
},
474+
{
475+
"cell_type": "code",
476+
"execution_count": null,
477+
"metadata": {},
478+
"outputs": [],
479+
"source": []
473480
}
474481
],
475482
"metadata": {
@@ -493,7 +500,7 @@
493500
"name": "python",
494501
"nbconvert_exporter": "python",
495502
"pygments_lexer": "ipython3",
496-
"version": "3.8.5"
503+
"version": "3.8.6"
497504
}
498505
},
499506
"nbformat": 4,

0 commit comments

Comments
 (0)