Skip to content

Commit 620ec1e

Browse files
committed
Add circulation plot
1 parent c4dbbb6 commit 620ec1e

File tree

1 file changed

+12
-3
lines changed
  • polaris/tasks/ocean/barotropic_channel

1 file changed

+12
-3
lines changed

polaris/tasks/ocean/barotropic_channel/viz.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,14 @@ def run(self):
4848
cell_mask = ds_init.maxLevelCell >= 1
4949
vertex_mask = ds_init.boundaryVertex == 0
5050

51-
vmax = 0.1
52-
# vmax = np.max(np.abs(ds_init.normalVelocity.values))
53-
5451
# Uncomment these lines to get 10 evenly spaced time slices
5552
# nt = ds_out.sizes['Time']
5653
# for t_index in np.arange(0, nt, int(np.floor(nt / 10))):
5754

5855
# These indices correspond to the first and last time step
5956
for t_index in [0, -1]:
6057
ds = ds_out.isel(Time=t_index)
58+
vmax = np.max(np.abs(ds.velocityZonal.values))
6159
plot_horiz_field(
6260
ds_mesh,
6361
ds['velocityZonal'],
@@ -87,3 +85,14 @@ def run(self):
8785
cmap='cmo.balance',
8886
field_mask=vertex_mask,
8987
)
88+
89+
vmax = np.max(np.abs(ds.circulation.values))
90+
plot_horiz_field(
91+
ds_mesh,
92+
ds['circulation'],
93+
f'circulation_t{t_index}.png',
94+
vmin=-vmax,
95+
vmax=vmax,
96+
cmap='cmo.balance',
97+
field_mask=vertex_mask,
98+
)

0 commit comments

Comments
 (0)