Skip to content

Commit 6add2ec

Browse files
committed
fix gridded plots for adcp and non adcp use
1 parent 253a202 commit 6add2ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gridded_plots.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def multiplotter(dataset, variables, plots_dir, glider='', mission='', grid=True
213213
The intended use of the plotter function is to iterate over a list of variables,
214214
plotting a pcolormesh style plot for each variable, where each variable has a colourmap assigned using a dict"""
215215

216-
if 'profile' in dataset.dims:
216+
if 'profile' in dataset.dims and 'time' in dataset.dims:
217217
time = dataset.time.values
218218
dataset = dataset.drop_dims('time')
219219
dataset['time'] = ('profile', time)
@@ -265,7 +265,7 @@ def multiplotter(dataset, variables, plots_dir, glider='', mission='', grid=True
265265
norm=matplotlib.colors.LogNorm(vmin=np.nanmin(vals), vmax=np.nanmax(vals)))
266266
else:
267267
if grid:
268-
pcol = ax.pcolor(ds.time.values, ds.depth, ds.values, cmap=colormap, shading='auto')
268+
pcol = ax.pcolor(dataset.time.values, ds.depth, ds.values, cmap=colormap, shading='auto')
269269
else:
270270
time = dataset.time.values.T
271271
depth = np.tile(dataset.depth.values, (len(dataset.profile), 1)).T
@@ -380,4 +380,5 @@ def make_map(nc, filename):
380380

381381

382382
if __name__ == '__main__':
383-
create_plots(Path("/data/data_l0_pyglider/complete_mission/SEA55/M85/gridfiles/gridded_adcp_gliderad2cp.nc"), Path("/home/callum/Downloads"), True)
383+
create_plots(Path("/data/data_l0_pyglider/complete_mission/SEA77/M41/gridfiles/gridded.nc"), Path("/home/callum/Downloads"), True)
384+
create_plots(Path("/data/data_l0_pyglider/complete_mission/SEA55/M85/gridfiles/gridded.nc"), Path("/home/callum/Downloads"), True)

0 commit comments

Comments
 (0)