@@ -31,7 +31,7 @@ def plot_horiz_field(ds, ds_mesh, field_name, out_file_name=None, # noqa: C901
3131 A data set containing fieldName
3232
3333 ds_mesh : xarray.Dataset
34- A data set containing mesh variables
34+ A data set containing horizontal mesh variables
3535
3636 field_name: str
3737 The name of the variable to plot, which must be present in ds
@@ -83,9 +83,9 @@ def plot_horiz_field(ds, ds_mesh, field_name, out_file_name=None, # noqa: C901
8383 if title is None :
8484 title = field_name
8585
86- if 'maxLevelCell' not in ds_mesh :
86+ if 'maxLevelCell' not in ds :
8787 raise ValueError (
88- 'maxLevelCell must be added to ds_mesh before plotting.' )
88+ 'maxLevelCell must be added to ds before plotting.' )
8989 if field_name not in ds :
9090 raise ValueError (
9191 f'{ field_name } must be present in ds before plotting.' )
@@ -102,7 +102,7 @@ def plot_horiz_field(ds, ds_mesh, field_name, out_file_name=None, # noqa: C901
102102 field = field .isel (nVertLevels = z_index )
103103
104104 if 'nCells' in field .dims :
105- ocean_mask = ds_mesh .maxLevelCell - 1 >= 0
105+ ocean_mask = ds .maxLevelCell - 1 >= 0
106106 ocean_patches , ocean_mask = _compute_cell_patches (ds_mesh , ocean_mask )
107107 elif 'nEdges' in field .dims :
108108 ocean_mask = np .ones_like (field , dtype = 'bool' )
0 commit comments