Skip to content

Commit

Permalink
Clean-up from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Xylar Asay-Davis <[email protected]>
  • Loading branch information
cbegeman and xylar authored Apr 12, 2023
1 parent e3593e8 commit af73520
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion polaris/ocean/tests/baroclinic_channel/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ def run(self):
plot_horiz_field(config, ds, ds_mesh, 'normalVelocity',
'final_normalVelocity.png',
t_index=t_index,
vmin=-1 * max_velocity, vmax=max_velocity,
vmin=-max_velocity, vmax=max_velocity,
cmap='cmo.balance', show_patch_edges=True)
4 changes: 2 additions & 2 deletions polaris/viz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ def plot_horiz_field(config, ds, ds_mesh, field_name, out_file_name,
if 'Time' in field.dims and t_index is None:
t_index = 0
if t_index is not None:
field = field[t_index, :]
field = field.isel(Time=t_index)
if 'nVertLevels' in field.dims and z_index is None:
z_index = 0
if z_index is not None:
field = field[:, z_index]
field = field.isel(nVertLevels=z_index)

if 'nCells' in field.dims:
ocean_mask = ds_mesh.maxLevelCell - 1 >= 0
Expand Down

0 comments on commit af73520

Please sign in to comment.