Skip to content

Commit

Permalink
Make isomip plotting more flexible
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Oct 24, 2024
1 parent a28a73a commit 824648b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compass/ocean/tests/isomip_plus/viz/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@ def __init__(self, inFolder, streamfunctionFolder, outFolder, expt,
self.sectionY = sectionY
self.showProgress = showProgress

if 'Time' in dsMesh.dims:
dsMesh = dsMesh.isel(Time=0)
self.dsMesh = dsMesh
self.ds = ds

Expand Down Expand Up @@ -508,7 +510,9 @@ def plot_horiz_series(self, da, nameInTitle, prefix, oceanDomain,
The time indices at which to plot. If not provided, set to all.
"""

nTime = self.ds.sizes['Time']
if 'Time' not in da.dims:
da = da.expand_dims(dim='Time', axis=0)
nTime = da.sizes['Time']
if self.showProgress:
widgets = ['plotting {}: '.format(nameInTitle),
progressbar.Percentage(), ' ',
Expand Down

0 comments on commit 824648b

Please sign in to comment.