Fuse Landsat/Sentinel

In this example, we demonstrate how to fuse Sentinel and Landsat data together. The target resolution is 30m (Landsat). Sentinel is prioritized and the gaps from clouds are filled by Landsat data. The cloud masks from the datasets are used to mask out the clouds. The cloud coverage is limited to 0-20%.

Data Downoad¤

It is assumed that the user already performed this step depending on the data source and collection.

Pre-Processing¤

Python
import sipt.processing as process
from sipt.pipeline import preprocess

shapefile = './shape.geojson'
start_date = '2024-11-08'
end_date = '2024-11-14'

sentinel_src = f"./temp/sentinel-2/new_zealand_marlborough/src"
sentinel_out = f"./temp/sentinel-2/new_zealand_marlborough/processed"

# Landsat
# Bit Flag Description
# Fill (0), Dilated Cloud (1), Cirrus (2), Cloud (3), Cloud Shadow (4), Snow (5), Clear (6), Water (7)
preprocess("./landsat/src", "./landsat/processed", shapefile, "*QA_PIXEL*", process.MaskType.BITMASK,
                0b00011110, max_masked_area=20, num_processes=4)

# Sentinel
reference = os.path.join("./landsat/processed", os.listdir("./landsat/processed")[0])
# Value Description
# saturated/defect (1), cast shadow (2), cld shadow (3), cld medium prob (8), cld high prob (9), cirrus (10)
preprocess("./sentinel/src", "./sentinel/processed", shapefile, "*SCL_20m*", process.MaskType.VALUES,
                    [1,3,8,9,10], max_masked_area=20, reference=reference, num_processes=4)

Fusion¤

Python
from sipt.fusion import cross_source_fusion, CrossSourceFusionType

cross_source_fusion(["./sentinel/processed", "./landsat/processed"], "./fused", CrossSourceFusionType.COVERING)