convert_mask_2d_to_3d#
- echoregions.convert_mask_2d_to_3d(mask_2d_da: xarray.core.dataarray.DataArray) xarray.core.dataset.Dataset#
Convert 2D multi-labeled mask data into its 3D one-hot encoded form.
- Parameters
- mask_2d_daDataArray
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.
- Returns
- mask_3d_dsDataset
A Dataset with a 3D DataArray/mask and each layer of the 3D mask will contain a 1s/0s mask for each unique label in the 2D mask. The layers will be labeled by a dictionary that maps the individual label layers of the 3D mask to an integer label in the 2D mask.
Notes
Emtpy dictionary data of mask_3d_ds means that there exists no masked values.