code: def _set_mask(self, mask):
          
          self.mask = mask.copy()
          if self.h5 is not None:
              if 'mask' in self.h5:
                  self.h5.pop('mask')
              self.h5.create_dataset('mask', mask.shape, dtype=self.mask.dtype, data=mask, compression="gzip", shuffle=True)
docs: Set mask array in both class and hdf5 file