You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser_crocplot.add_argument('--level', required=False, default=None, type=parse_int, help='level to plot. If >=0, then a sigma level is plotted. If <0 then a z level (in m) is plotted. Default behaviour will plot the surface layer')
Copy file name to clipboardExpand all lines: crocotools_py/plotting.py
+25-4
Original file line number
Diff line number
Diff line change
@@ -242,15 +242,15 @@ def plot(fname,
242
242
ax=None, # allowing for adding to an existing axis
243
243
var='temp', # croco variable to plot
244
244
grdname=None, # option croco grid file (if grid variables arem't in the croco output file)
245
-
time=None, # see post.get_var() for 'time' format. If a single value, then a plot is made, if two values, then an animation between those times is made
245
+
time=slice(None), # see post.get_var() for 'time' format. If a single value, then a plot is made, if two values, then an animation between those times is made
246
246
level=None, # see post.get_var() for 'level' format. Has to be a single value for this function to do a plot
247
-
ticks=np.linspace(12,22,num=11), # the ticks to plot (should default to None and determine automatically)
247
+
ticks=None, #np.linspace(12,22,num=11), (gets set automatically if None)
248
248
cmap='Spectral_r',
249
249
extents=None, # [lon0,lon1,lat0,lat1] whole domain plotted if None
250
250
ref_date=None, # datetime, from CROCO model setup
251
251
add_cbar=True, # add a colorbar?
252
252
cbar_loc=None, # [left, bottom, width, height] (gets set automatically if None)
253
-
cbar_label='temperature ($\degree$C)',
253
+
cbar_label=None, # 'temperature ($\degree$C)', we just use 'var' is None
254
254
add_vectors=True, # add vectors?
255
255
scale_uv=None, # define the vector scaling (gets set automatically if None)
256
256
ref_vector=None, # value of reference vector
@@ -260,6 +260,7 @@ def plot(fname,
260
260
isobaths=None, # optional list of isobaths to overlay over plot
261
261
jpg_out=None, # full path to jpg output
262
262
gif_out=None, # full path to gif output
263
+
mp4_out=None, # option to rather write an mp4
263
264
):
264
265
'''
265
266
this is a convenience function for doing a quick 2D plot with minimal coding.
@@ -293,7 +294,22 @@ def plot(fname,
293
294
else:
294
295
# this will be an animation, starting with the first time-step
295
296
data_plt=da_var.isel(time=0).values
296
-
297
+
298
+
ifticksisNone:
299
+
# get the range of the data to plot (using 5th and 95th percentiles)
0 commit comments