Skip to content

Commit 4c95947

Browse files
committed
Plot transect on horiz plots
1 parent 83b96ef commit 4c95947

File tree

1 file changed

+13
-8
lines changed
  • polaris/ocean/tasks/isomip_plus/init

1 file changed

+13
-8
lines changed

polaris/ocean/tasks/isomip_plus/init/init.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def _plot(self):
297297
ds_fix['yVertex'] = ds_fix['yIsomipVertex']
298298
ds_fix['zVertex'] = xr.zeros_like(ds_fix.xVertex)
299299

300-
x = np.linspace(320e3, 800e3, 11)
300+
x = np.linspace(320e3, 800e3, 2)
301301
y = 40.0e3 * np.ones_like(x)
302302

303303
x = xr.DataArray(data=x, dims=('nPoints',))
@@ -407,33 +407,37 @@ def _plot(self):
407407
field_name='layerThickness',
408408
figsize=figsize,
409409
vmin=min_layer_thickness + tol, vmax=50,
410-
cmap='cmo.deep_r', units='m', under='r', over='r')
410+
cmap='cmo.deep_r', units='m', transect_x=x,
411+
transect_y=y, under='r', over='r')
411412

412413
_plot_top_bot_slice(ds=ds, ds_mesh=ds_mesh, ds_transect=ds_transect,
413414
patches=patches, patch_mask=patch_mask,
414415
field_name='zMid',
415416
figsize=figsize,
416417
vmin=-720., vmax=0.,
417-
cmap='cmo.deep_r', units='m', under='r', over='r')
418+
cmap='cmo.deep_r', units='m', transect_x=x,
419+
transect_y=y, under='r', over='r')
418420

419421
_plot_top_bot_slice(ds=ds, ds_mesh=ds_mesh, ds_transect=ds_transect,
420422
patches=patches, patch_mask=patch_mask,
421423
field_name='temperature',
422424
figsize=figsize,
423425
vmin=-2., vmax=1.,
424-
cmap='cmo.thermal', units=r'$^\circ$C')
426+
cmap='cmo.thermal', units=r'$^\circ$C',
427+
transect_x=x, transect_y=y)
425428

426429
_plot_top_bot_slice(ds=ds, ds_mesh=ds_mesh, ds_transect=ds_transect,
427430
patches=patches, patch_mask=patch_mask,
428431
field_name='salinity',
429432
figsize=figsize,
430433
vmin=33.8, vmax=34.7,
431-
cmap='cmo.haline', units='PSU')
434+
cmap='cmo.haline', units='PSU', transect_x=x,
435+
transect_y=y)
432436

433437

434438
def _plot_top_bot_slice(ds, ds_mesh, ds_transect, patches, patch_mask,
435439
field_name, figsize, vmin, vmax, cmap, units,
436-
under=None, over=None):
440+
transect_x, transect_y, under=None, over=None):
437441
for suffix, z_index in [['Top', 0], ['Bot', ds.maxLevelCell - 1]]:
438442
plot_horiz_field(ds=ds, ds_mesh=ds_mesh,
439443
field_name=field_name,
@@ -443,10 +447,11 @@ def _plot_top_bot_slice(ds, ds_mesh, ds_transect, patches, patch_mask,
443447
vmin=vmin, vmax=vmax, cmap=cmap,
444448
cmap_set_under=under, cmap_set_over=over,
445449
figsize=figsize, patches=patches,
446-
patch_mask=patch_mask)
450+
patch_mask=patch_mask, transect_x=transect_x,
451+
transect_y=transect_y)
447452

448453
plot_transect(ds_transect=ds_transect, mpas_field=ds[field_name],
449454
title=f'{field_name} at y=40 km',
450455
out_filename=f'plots/{field_name}Section.png',
451-
cmap=cmap, figsize=figsize,
456+
vmin=vmin, vmax=vmax, cmap=cmap, figsize=figsize,
452457
colorbar_label=units)

0 commit comments

Comments
 (0)