Browse Source

Cleaned up plotting documentation.

main
Bill Ladwig 8 years ago
parent
commit
c9eea20f23
  1. 21
      doc/source/new.rst
  2. 53
      doc/source/plot.rst

21
doc/source/new.rst

@ -1,6 +1,23 @@ @@ -1,6 +1,23 @@
What's New
===========
Releases
-------------
v1.0.0
^^^^^^^^^^^^^
- Release 1.0.0.
- Fixed issue with not being able to set the thread-local coordinate cache to
0 to disable it. Also, the cache will now correctly resize itself when
the size is reduced to less than its current setting.
- Fixed an issue with the '0000-00-00 00:00:00' time used in geo_em files
causing crashes due to the invalid time. The time is now set to
numpy.datetime64('NaT').
- Fixed issue with wrf.cape_3d not working correctly with a single
column of data.
Beta Releases
--------------
@ -67,8 +84,8 @@ v1.0a3 @@ -67,8 +84,8 @@ v1.0a3
Known Issues
--------------
v1.0b3
^^^^^^^^^^^^^^^
v1.0.0
^^^^^^^^
- Currently unable to build on Windows with Python 3.5+ using open source
mingw compiler. The mingwpy project is working on resolving the

53
doc/source/plot.rst

@ -69,8 +69,10 @@ Plotting a Two-dimensional Field @@ -69,8 +69,10 @@ Plotting a Two-dimensional Field
ax.coastlines('50m', linewidth=0.8)
# Make the contour outlines and filled contours for the smoothed sea level pressure.
plt.contour(to_np(lons), to_np(lats), to_np(smooth_slp), 10, colors="black", transform=crs.PlateCarree())
plt.contourf(to_np(lons), to_np(lats), to_np(smooth_slp), 10, transform=crs.PlateCarree(), cmap=get_cmap("jet"))
plt.contour(to_np(lons), to_np(lats), to_np(smooth_slp), 10, colors="black",
transform=crs.PlateCarree())
plt.contourf(to_np(lons), to_np(lats), to_np(smooth_slp), 10, transform=crs.PlateCarree(),
cmap=get_cmap("jet"))
# Add a color bar
plt.colorbar(ax=ax, shrink=.62)
@ -86,6 +88,7 @@ Plotting a Two-dimensional Field @@ -86,6 +88,7 @@ Plotting a Two-dimensional Field
plt.show()
Horizontal Interpolation to a Pressure Level
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -194,8 +197,8 @@ plot, see :ref:`cross_example`. @@ -194,8 +197,8 @@ plot, see :ref:`cross_example`.
slp = getvar(ncfile, "slp")
smooth_slp = smooth2d(slp, 3)
ctt = getvar(ncfile, "ctt")
z = getvar(ncfile, "z", timeidx=0)
dbz = getvar(ncfile, "dbz", timeidx=0)
z = getvar(ncfile, "z")
dbz = getvar(ncfile, "dbz")
Z = 10**(dbz/10.)
wspd = getvar(ncfile, "wspd_wdir", units="kt")[0,:]
@ -203,10 +206,12 @@ plot, see :ref:`cross_example`. @@ -203,10 +206,12 @@ plot, see :ref:`cross_example`.
start_point = CoordPair(lat=26.76, lon=-80.0)
end_point = CoordPair(lat=26.76, lon=-77.8)
# Compute the vertical cross-section interpolation. Also, include the lat/lon points along the cross-section
# in the metadata by setting latlon to True.
z_cross = vertcross(Z, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
# Compute the vertical cross-section interpolation. Also, include the lat/lon
# points along the cross-section in the metadata by setting latlon to True.
z_cross = vertcross(Z, z, wrfin=ncfile, start_point=start_point, end_point=end_point,
latlon=True, meta=True)
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point,
latlon=True, meta=True)
dbz_cross = 10.0 * np.log10(z_cross)
# Get the lat/lon points
@ -236,11 +241,11 @@ plot, see :ref:`cross_example`. @@ -236,11 +241,11 @@ plot, see :ref:`cross_example`.
# Create the filled cloud top temperature contours
contour_levels = [-80.0, -70.0, -60, -50, -40, -30, -20, -10, 0, 10]
ctt_contours = ax_ctt.contourf(to_np(lons), to_np(lats), to_np(ctt), contour_levels, cmap=get_cmap("Greys"),
transform=crs.PlateCarree(), zorder=2)
ctt_contours = ax_ctt.contourf(to_np(lons), to_np(lats), to_np(ctt), contour_levels,
cmap=get_cmap("Greys"), transform=crs.PlateCarree(), zorder=2)
ax_ctt.plot([start_point.lon, end_point.lon], [start_point.lat, end_point.lat], color="yellow",
marker="o", transform=crs.PlateCarree(), zorder=3)
ax_ctt.plot([start_point.lon, end_point.lon], [start_point.lat, end_point.lat],
color="yellow", marker="o", transform=crs.PlateCarree(), zorder=3)
# Create the color bar for cloud top temperature
cb_ctt = fig.colorbar(ctt_contours, ax=ax_ctt, shrink=.60)
@ -299,6 +304,7 @@ plot, see :ref:`cross_example`. @@ -299,6 +304,7 @@ plot, see :ref:`cross_example`.
plt.show()
Matplotlib with Basemap
-----------------------
@ -306,8 +312,7 @@ Although basemap is in maintenance mode only and becoming deprecated, it is stil @@ -306,8 +312,7 @@ Although basemap is in maintenance mode only and becoming deprecated, it is stil
widely used by many programmers. Cartopy is becoming the preferred package for
mapping, however it suffers from growing pains in some areas
(can't use latitude/longitude labels for many map projections). If you
run in to these issues, basemap is likely to accomplish what you need, despite
slower performance.
run in to these issues, basemap is likely to accomplish what you need.
Plotting a Two-Dimensional Field
@ -462,8 +467,8 @@ plot, see :ref:`cross_example`. @@ -462,8 +467,8 @@ plot, see :ref:`cross_example`.
slp = getvar(ncfile, "slp")
smooth_slp = smooth2d(slp, 3)
ctt = getvar(ncfile, "ctt")
z = getvar(ncfile, "z", timeidx=0)
dbz = getvar(ncfile, "dbz", timeidx=0)
z = getvar(ncfile, "z")
dbz = getvar(ncfile, "dbz")
Z = 10**(dbz/10.)
wspd = getvar(ncfile, "wspd_wdir", units="kt")[0,:]
@ -471,10 +476,12 @@ plot, see :ref:`cross_example`. @@ -471,10 +476,12 @@ plot, see :ref:`cross_example`.
start_point = CoordPair(lat=26.76, lon=-80.0)
end_point = CoordPair(lat=26.76, lon=-77.8)
# Compute the vertical cross-section interpolation. Also, include the lat/lon points along the cross-section in
# the metadata by setting latlon to True.
z_cross = vertcross(Z, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
# Compute the vertical cross-section interpolation. Also, include the lat/lon points
# along the cross-section in the metadata by setting latlon to True.
z_cross = vertcross(Z, z, wrfin=ncfile, start_point=start_point, end_point=end_point,
latlon=True, meta=True)
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point,
latlon=True, meta=True)
dbz_cross = 10.0 * np.log10(z_cross)
# Get the latitude and longitude points
@ -609,8 +616,10 @@ plotted using the standard matplotlib API. @@ -609,8 +616,10 @@ plotted using the standard matplotlib API.
start_point = CoordPair(lat=26.76, lon=-80.0)
end_point = CoordPair(lat=26.76, lon=-77.8)
# Compute the vertical cross-section interpolation. Also, include the lat/lon points along the cross-section.
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point, latlon=True, meta=True)
# Compute the vertical cross-section interpolation. Also, include the lat/lon
# points along the cross-section.
wspd_cross = vertcross(wspd, z, wrfin=ncfile, start_point=start_point, end_point=end_point,
latlon=True, meta=True)
# Create the figure
fig = plt.figure(figsize=(12,6))

Loading…
Cancel
Save