Compositors.md

June 5, 2026 ยท View on GitHub

Compositors

This document lists compositors available for raster layers in rslearn. Set compositing_method in a layer config to either:

  • a built-in enum name (for example "FIRST_VALID"), or
  • a custom compositor config (class_path + init_args).

See Dataset Configuration for where this field appears.

Built-In Compositors

Compositing MethodNotes
FIRST_VALIDDefault. First non-nodata pixel in item order.
MEANPer-pixel mean across valid pixels.
MEDIANPer-pixel median across valid pixels.
SPATIAL_MOSAIC_TEMPORAL_STACKSpatial first-valid per timestep, stacked along T.
TEMPORAL_MEANTemporal reduction over stacked timesteps.
TEMPORAL_MAXTemporal reduction over stacked timesteps.
TEMPORAL_MINTemporal reduction over stacked timesteps.

Custom Cloud-Aware Compositors

These compositors use cloud or classification signals inside each materialized item group to rank or select items.

Class PathDescription
rslearn.dataset.hls_fmask.HlsFmaskFirstValidUses HLS Fmask QA bits to score cloudiness.
rslearn.dataset.omni_cloud_mask.OmniCloudMaskFirstValidUses OmniCloudMask model inference on R/G/NIR.
rslearn.dataset.sentinel2_scl.Sentinel2SCLBestClearSelects the single Sentinel-2 item with highest SCL clear cover.
rslearn.dataset.sentinel2_scl.Sentinel2SCLFirstValidUses Sentinel-2 SCL classes to score cloudiness.