eolearn.mask.extra.cloud_mask

Module for cloud masking

class eolearn.mask.extra.cloud_mask.CloudMaskTask(data_feature, valid_data_feature, output_mask_feature, output_proba_feature=None, all_bands=True, threshold=0.4, average_over=4, dilation_size=2)[source]

Bases: EOTask

Cloud masking with the s2cloudless model. Outputs a cloud mask and optionally the cloud probabilities.

Parameters:
  • data_feature (Feature) – A data feature which stores raw Sentinel-2 reflectance bands.

  • valid_data_feature (Feature) – A mask feature which indicates whether data is valid.

  • output_mask_feature (Feature) – The output feature containing cloud masks.

  • output_proba_feature (Feature | None) – The output feature containing cloud probabilities. By default this is not saved.

  • all_bands (bool) – Flag which indicates whether images will consist of all 13 Sentinel-2 L1C bands or only the required 10.

  • threshold (float) – Cloud probability threshold for the classifier.

  • average_over (int | None) – Size of the pixel neighbourhood used in the averaging post-processing step. Set to None to skip this post-processing step.

  • dilation_size (int | None) – Size of the dilation post-processing step. Set to None to skip this post-processing step.

execute(eopatch)[source]

Add selected features (cloud probabilities and masks) to an EOPatch instance.

Parameters:

eopatch (EOPatch) – Input EOPatch instance

Returns:

EOPatch with additional features

Return type:

EOPatch