convert_mask_3d_to_2d#

echoregions.convert_mask_3d_to_2d(mask_3d_ds: xarray.core.dataset.Dataset) xarray.core.dataarray.DataArray#

Convert 3D one-hot encoded mask data into its 2D multi-labeled form.

Parameters
mask_3d_dsDataset

A Dataset with a 3D DataArray with the data_var masked by the specified region in one-hot encoded form and a dictionary that will be used to map the individual label layers of the 3D mask to an integer label in the 2D mask. The 3D DataArray will be in the form of 1s/0s: masked areas, and non-masked areas.

Returns
mask_2d_da: DataArray

A DataArray with the data_var masked by a specified region. This data will be in the form of integer, demarking labels of masked regions, and nan values, demarking non-masked areas.

Notes

Emtpy dictionary data of mask_3d_ds means that there exists no masked values.