Landsat

In this example, we demonstrate how to retrieve Landsat satellite data for a specific week in May and process it to generate true-color images. The cloud coverage is limited to 0-20%.

Data Downoad¤

Python
from sipt.retrieval import USGS, copy
import os

shapefile = './shape.geojson'
start_date = '2024-05-10'
end_date = '2024-05-16'

usgs = USGS("username", "token")
usgs.retrieve("./data", USGS.Dataset.LANDSAT_8_9_L2, shapefile, start_date, end_date)
copy("./data", "./src", shapefile, ["*_B[234]*", "*QA_PIXEL*"], start_date, end_date, 8)

Pre-Processing¤

Python
from sipt.pipeline import preprocess
from sipt.processing.mask import MaskType

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

Post-Processing¤

Python
from sipt.processing import enhance, combine

combine("./processed", "./final", [4, 3, 2])
enhance("./final", "./final")