-
Notifications
You must be signed in to change notification settings - Fork 447
Closed
Labels
Area: DocsAffects documentationAffects documentationArea: PlotsPertains to producing plotsPertains to producing plots
Milestone
Description
Better description and documentation of Declarative area settings
In the declarative syntax we have a number of pre-defined areas that can use used to set the extent for a particular visualization; however, the names and areas they represent are not well exposed for our users. These areas all come from GEMPAK, which were also not well documented for users. I have recently created maps using all of these areas and here are some of my thoughts:
- there are many good areas defined and we need a better way to let our users know about them and see what they look like in different projections
- there are a number of not great or nearly redundant extents that can likely be removed
- the names of many of the areas are cryptic at best - we should consider updating some naming conventions moving forward
- some extents are great for a PlateCarree plot, while others are meant more for an Lambert Conformal or Polar Stereographic projection - we should document this for our users.
Open to thoughts questions, comments, suggestions from the community on what would be useful to allow greater clarity and examples of these pre-defined areas.
Here is code that will generate maps for all the pre-defined areas on a PlateCarree, Lamber Conformal, and Polar Stereographic projections:
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import matplotlib.pyplot as plt
from metpy.plots import declarative
areas = declarative._areas
platecarree = ccrs.PlateCarree()
lcc = ccrs.LambertConformal(central_longitude=-100, standard_parallels=[30, 60])
ps = ccrs.NorthPolarStereo(central_longitude=-100)
proj_names = ['PlateCarree', 'LCC', 'PS']
for i, area in enumerate(areas):
j = 0
for proj in [platecarree, lcc, ps]:
try:
plt.figure(i, figsize=(8,10))
ax = plt.subplot(111, projection=proj)
ax.set_extent(areas[area], ccrs.PlateCarree())
ax.add_feature(cfeature.COASTLINE.with_scale('10m'))
ax.add_feature(cfeature.STATES.with_scale('10m'))
ax.set_title(f'{area} in {proj_names[j]} projection')
plt.savefig(f'{area}_{proj_names[j]}.png', dpi=150, bbox_inches='tight')
plt.close()
except:
print(f'{area} did not plot in {proj_names[j]}')
j += 1Metadata
Metadata
Assignees
Labels
Area: DocsAffects documentationAffects documentationArea: PlotsPertains to producing plotsPertains to producing plots
Type
Projects
Status
Done