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 committed Apr 13, 2023
1 parent 9322859 commit 55233c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions 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,
cmap='cmo.balance', show_cell_edges=True)
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 @@ -82,11 +82,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 55233c6

Please sign in to comment.