lnferris / ocean_data_tools

A MATLAB toolbox for interacting with bulk freely-available oceanographic data.
MIT License
83 stars 24 forks source link

general_depth_subset z-axis #20

Closed kakearney closed 4 years ago

kakearney commented 4 years ago

This issue is part of the JOSS review (openjournals/joss-reviews#2497)

The general_depth_subset function assumes that depth values do not cross z = 0, i.e. that the input depths are either all positive or all negative. While this is typically the case for in-situ measurement, where z = 0 is set at the water's surface, some datasets, particularly modeled ones, set z = 0 to mean sea level (in which case, depths are mostly negative but can exceed zero when sea surface height is higher than average). You may want to consider handling this not-too-uncommon case, given the plan to continue incorporating new data sources into the toolbox.

At the very least, a user trying to subset something across, for example, [-100 2] should be warned that the 2 will be treated as 2 below the surface, not above.

lnferris commented 4 years ago

I have fixed this to use the same sign convention as the struct to be subsetted.