oceanspy
oceanspy copied to clipboard
add plot function for mooring arrays across faces
Description
Both subsample.stations
and subsample.mooring_array(... serial=True)
are decoupled from cutout
and so are more "efficient" and scalable. However, currently there is no easy way to visualize the sampled arrays on top of topography without having to perform a cutout
and then plot. Performing cutout
triggers the transformation of all grid variables (some of them are 3D+face), plus at least a field variable (say a snapshot of ssh
). Nevertheless, it is ideal whenever possible to not perform a cutout
specially if one is only interested in just to make a plot (it can trigger the generation of a lot of task graphs in the scheduler).
What I propose:
To plot either kind of array (stations
, mooring_array
) without triggering cutout
, while showing the "track" of the array over ocean depth. I adapted a plotting func written originally by Ryan several years ago, to plot surface data that does not interpolate. I can include snippets of code used by mooring array
and stations
within this function, to overlay ocean Depth
and the array
track. This is way faster and "more" scalable than the alternative. An example plot is:
Xmoor = np.arange(-170, 170, 100)
Ymoor = 25 * np.ones(np.shape(Xmoor))
Then call the function passing the array which looks like:
Right now, the plotting function needs a little bit of work. Ideally it would:
a) Only plot data involved in the subsampling. Right now it plots all of the faces. The trivial case is when only a single face is involved. But it needs a bit of work to better plot a subset of the faces. b) give the user flexibility (color schemes, field variables to use aside from depth, how many grid points to plot, and whether one wants to plot all horizontal data or not -- see above point). c) Represent in a better way the arctic. This can be in the crown-shape I used to the cutout, which is mimics lat-lon coordinates.
@Mikejmnez This sounds great to me! When it's done, I'll implement it in the Poseidon-viewer notebooks.