Skip to content
Snippets Groups Projects
Commit b56ba518 authored by Nils Brüggemann's avatar Nils Brüggemann
Browse files

pyic_fig.py: Some improvements for atmospheric plotting.

parent 29a088d2
No related branches found
No related tags found
No related merge requests found
Pipeline #31293 passed
......@@ -95,6 +95,9 @@ parser.add_argument('--coastlines_color', type=str, default='k',
help='Color of coastlines. Default is \'k\'. To disable set to \'none\'.')
parser.add_argument('--land_facecolor', type=str, default='0.7',
help='Color of land masses. Default is \'0.7\'. To disable set to \'none\'.')
parser.add_argument('--noland', default=False,
action='store_true',
help='If specified, continents are not filled and land_facecolor is overwritten.')
parser.add_argument('--lonlat_for_mask', default=False,
action='store_true',
help='If specified, mask for triangles which are swapped at periodic boundaries is calculated from clon and clat (and not only from clon). Relevant for torus setup.')
......@@ -240,9 +243,20 @@ elif 'lev_2' in data.dims:
depth_name = 'lev_2'
elif 'plev' in data.dims:
depth_name = 'plev'
elif 'height' in data.dims:
depth_name = 'height'
elif 'height_2' in data.dims:
depth_name = 'height_2'
else:
depth_name = 'none'
# --- re-chunk data to allow for plotting from big files
chunks = dict(time=1)
if depth_name!='none':
chunks[depth_name] = 1
data = data.chunk(chunks)
# --- select vertical and time coordinate
if depth_name!='none':
if depth!=-1:
data = data.sel({depth_name: depth}, method='nearest')
......@@ -374,6 +388,9 @@ if lat_reg is None:
else:
ylim = lat_reg
if iopts.noland:
iopts.land_facecolor='none'
if projection in ['np', 'sp']:
ax.set_extent(extent, ccrs.PlateCarree())
ax.gridlines()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment