nctoolkit.DataSet.surface_mask

DataSet.surface_mask()

surface_mask: Create a mask identifying the shallowest cell without missing values.

This converts a dataset to a mask identifying which cell represents top level, for example the sea surface. 1 identifies the shallowest cell with non-missing values. Everything else is 0, or missing. At present this method only uses the first available variable from netCDF files, so it may not be suitable for all data

Examples

If you wanted to create a mask identifying the surface, you would do this:

>>> ds.surface_mask()