|
351 | 351 | "# Temperature, smooth, and convert to Celsius\n", |
352 | 352 | "tmpk = ds.Temperature_isobaric.metpy.sel(\n", |
353 | 353 | " 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')" |
355 | 355 | ] |
356 | 356 | }, |
357 | 357 | { |
|
444 | 444 | "# Plot Dashed Contours of Temperature\n", |
445 | 445 | "cs2 = ax.contour(hght.lon, hght.lat, smooth_tmpc, range(-60, 51, 5),\n", |
446 | 446 | " 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", |
448 | 448 | "\n", |
449 | 449 | "# Set longer dashes than default\n", |
450 | 450 | "for c in cs2.collections:\n", |
|
460 | 460 | " marker='o', color='black', transform=ccrs.PlateCarree())\n", |
461 | 461 | "\n", |
462 | 462 | "# 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", |
464 | 464 | " 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", |
466 | 466 | " symbol='L', color='black', transform=ccrs.PlateCarree())\n", |
467 | 467 | "\n", |
468 | 468 | "# 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", |
470 | 470 | " loc='left')\n", |
471 | 471 | "plt.title(f'Valid: {date}', loc='right');" |
472 | 472 | ] |
| 473 | + }, |
| 474 | + { |
| 475 | + "cell_type": "code", |
| 476 | + "execution_count": null, |
| 477 | + "metadata": {}, |
| 478 | + "outputs": [], |
| 479 | + "source": [] |
473 | 480 | } |
474 | 481 | ], |
475 | 482 | "metadata": { |
|
493 | 500 | "name": "python", |
494 | 501 | "nbconvert_exporter": "python", |
495 | 502 | "pygments_lexer": "ipython3", |
496 | | - "version": "3.8.5" |
| 503 | + "version": "3.8.6" |
497 | 504 | } |
498 | 505 | }, |
499 | 506 | "nbformat": 4, |
|
0 commit comments