Skip to main content

preprocessing.cloud_mask

preprocessing.cloud_mask(qa_band, spec)

Build a boolean cloud / shadow mask from a quality band.

Driven by a mission’s cloud_mask spec (see missions.py). Returns a boolean array (True = masked) or None if the mission has no cloud mask.

Two kinds are supported:

  • "scl" – Sentinel-2 Scene Classification Layer; mask where the class is in flag_values (e.g. cloud / shadow / cirrus classes).
  • "qa_bits" – Landsat BQA / QA_PIXEL; mask where any of flag_bits is set in the bit-packed integer.