Skip to main content

EniCCS banner
DOI License Python GitHub release

EnICCS is a tool for generating improved cloud and cloud shadow masks for EnMAP L2A scenes over land surfaces.

For details please refer to the accompanying paper.

Table of Contents


Background

Current operational cloud and cloud shadow masks often fail to detect small clouds and cloud shadows and lack proper cloud boundary delineation. Residual clouds and cloud shadows can significantly distort spectral signatures, such that the recorded signal no longer corresponds to the expected ‘clear-sky’ measurement of the observed surface. This, in turn, compromises any downstream analysis.

About EnICCS

EnICCS intends to improve existing cloud and cloud shadow masks through a series of steps.

  1. Operational masks are refined using a combination of narrowband indices, thresholding and masking.
  2. The refined masks are then used to fit a simple PLS-DA model to classify the respective scene.
  3. Predictions are post-processed with a simple cloud-to-shadow matching routine.

The overall workflow is illustrated below: workflow

EnICCS is simple to use with a single function call and requires only the directory path of the EnMAP L2A data as input.

Various parameters can be adjusted to improve performance while implementation level changes can help adapt the tool to different regions and surface types. For more details see the paper and customization section.

Example

Some exemplary pairs of EnMAP images with operational (left) and EnICCS masks (right) respectively:

Example Mask comparison

Installation

You can install EnICCS from GitHub or using pip:

pip install eniccs
# or
pip install git+https://github.com/leleist/eniccs.git

Usage

To use EnICCS, you can import it and run the main wrapper function with default parameters.
Just provide the directory path of the EnMAP L2A data on a tile-by-tile basis, i.e., as provided by DLR.

from eniccs import run_eniccs

dir_path = r"path/to/your/EnMAP/TIFFS"  

# simple call with default parameters
run_eniccs(dir_path)

# new cloud and cloudshadow masks will be saved to "dir_path"

Please note: EnICCS currently accepts two file types, TIFF and BSQ, with extensions (.TIFF, .TIF, .tiff, .tif, .BSQ, .bsq)

Note on Transferability:

EnICCS was developed and tested on EnMAP scenes over tropical western Kenya. Application to regions with differing surface characteristics may require adjustments. The code structure allows for some optimization with available parameters and simple adaptation, leveraging expert knowledge and/or visual inspection. For more details see the accompanying paper and Customization.

Customization

EnICCS has two points of contact for customization:

1. Parameter Adjustments

The following parameters can be adjusted when calling the run_eniccs function:

run_eniccs(
     dir_path: str,                     # path to EnMAP L2A data
     save_output: bool = True,          # save output masks
     return_mask_obj: bool = False,     # return mask object
     auto_optimize: bool = False,       # optimize the number of latent variables for PLS-DA automatically
     verbose: bool = False,             # print progress messages
     plot: bool = False,                # plot informative plots
     smooth_output: bool = True,        # apply conservative morphological processing for smooting the output masks
     contamination: float = 0.25,       # contamination parameter for LOF outlier detection
     percentile: int = 85,              # percentile for cloud-to-shadow matching routine distance threshold
     num_samples: int = 3000,           # number of samples for PLS-DA training
     buffer_size: int = 1,              # Buffer size for dilation of CCS mask outputs.
     n_jobs: int = -1,                  # number of parallel jobs (CPU)
     random_state: int = 42,            # random state for class balancing and data splitting
     output_dir: str = None,            # alterbative output directory for saving the new masks (if None, saves to dir_path)
)

2. Implementation Level Changes

The main module contains functions for mask refinement i.e. improve_cloud_mask_over_land and improve_cloud_shadow_mask as well as a wrapper refine_ccs_masks that integrates the two prior functions into the overall workflow. These functions can be modified. Here, bands, indices and thresholds can be changed to suit the surfaces of interest. Classification and post-processing steps can stay untouched in this scenario.

In the context of supervised ML classification, we recall the garbage-in-garbage-out principle. Thus, the quality of the refined masks used for training is crucial for the performance of the PLS-DA model, despite the available post-processing steps.

Contributions

Contributions are welcome!
Specifically regarding band indices and thresholds for different surface types (Desert, Snow, Urban).

Planned Features

  • "no reference data" mode for using EnICCS as a standalone cloud masking tool, without existing operational masks.
  • Selectable surface-type presets (e.g., tropical, desert, snow, urban) with band indices and thresholds for mask refinement.

EnMAP Cloud and Cloud Shadow Benchmarking Dataset

We provide the hand-drawn "gold standard" reference masks for five EnMAP scenes used in the accompanying paper as a benchmarking dataset on Zenodo 10.5281/zenodo.17350339.
For tile-wise performance metrics, please consult the paper supplemental information.

Citation

Please cite the accompanying paper and Zenodo sources:

Leander Leist, Boris Thies, Jörg Bendix, Evaluation and improvement of EnMAP’s cloud and cloud-shadow masks – An application in tropical western Kenya, International Journal of Applied Earth Observation and Geoinformation, Volume 144, 2025, 104914, ISSN 1569-8432, https://doi.org/10.1016/j.jag.2025.104914, https://www.sciencedirect.com/science/article/pii/S1569843225005618.

Funding and Acknowledgements

This work was funded by the German Space Agency at DLR via the German Federal Ministry of Economic Affairs and Climate Action under Grant 50EE2303A.

Illustrations contain EnMAP data and modified EnMAP data © DLR [2023, 2024]. All rights reserved.

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

Metadata

Release files for eniccs 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eniccs 0.2.4
File Size Uploaded Provenance Actions
eniccs-0.2.4.tar.gz 26.9 kB Without provenance Details for eniccs-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eniccs 0.2.4
File Interpreter ABI Platform Actions
eniccs-0.2.4-py3-none-any.whl Python 3 none any Details for eniccs-0.2.4-py3-none-any.whl

Total release size: 52.8 kB

Release files / eniccs-0.2.4.tar.gz

Download URL eniccs-0.2.4.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f0c8f92962671f6c03c51c88d3654c5898caf9f083484baeba02caf3544671f2
BLAKE2b-256 checksum
How to use checksums
6d93f6ca53128f365aac4071cc4240f9b93e6502357d9d31349313f96b24d05c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Release files / eniccs-0.2.4-py3-none-any.whl

Download URL eniccs-0.2.4-py3-none-any.whl
Size 25.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96f8c1c6fc8c6c831eb2227dd89073f92c500ad003c114289b48ae46ba547311
BLAKE2b-256 checksum
How to use checksums
62220a4cccf6411d28a89c63b58fc8416f4d6984aa75b2a9357fa1010d1e5eec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.13

Security for eniccs 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page