The two depth variables are equally as valid as depth coordinates as far as emsarray can tell. dataset.ems.get_depth_name() will return "Mesh2_layerfaces", as the variables are processed in order and Mesh2_layerfaces happens to be first in this dataset. This causes problems when plotting transects, for example, which assumes the variable passed in for plotting is defined on the default depth coordinate.
Things to consider:
In this case we could detect which is the cell coordinate and which is the boundary coordinate by examining the dimension sizes. Perhaps the coordinate with the smallest dimension size should be the 'default' depth coordinate?
Perhaps the concept of a 'default' depth coordinate is invalid, as the depth coordinate depends on the data variable in question. Consider adding a Convention.get_depth_coordinate_for_variable(variable) function.
Transect plotting should detect the correct depth coordinate to use for the variable passed in using the Convention.get_coordinate_for_variable(variable) so transects can be plotted for data on any depth coordinate.
A UGrid dataset with two depth coordinates:
The two depth variables are equally as valid as depth coordinates as far as emsarray can tell.
dataset.ems.get_depth_name()
will return"Mesh2_layerfaces"
, as the variables are processed in order andMesh2_layerfaces
happens to be first in this dataset. This causes problems when plotting transects, for example, which assumes the variable passed in for plotting is defined on the default depth coordinate.Things to consider:
Convention.get_depth_coordinate_for_variable(variable)
function.Convention.get_coordinate_for_variable(variable)
so transects can be plotted for data on any depth coordinate.