API Reference

Pipeline orchestrator

The main entry point most users need.

flood_mapper Orchestrates the full Z-score SAR flood-mapping pipeline for one or

Grid generation

Generate a tiling grid from an AOI when you don’t already have one.

grid.generate_grid Generate a tiling grid for an area of interest, in the schema

Data sources

STACSource and its implementations – how AutoFloods reads Sentinel-1/DEM data.

sources.STACSource Contract a STAC-based Sentinel-1/DEM provider must satisfy so that
sources.MPCSource Microsoft Planetary Computer (MPC) implementation of STACSource.
sources.OPERASource NASA OPERA RTC-S1 implementation of STACSource (search via NASA CMR’s

Flood detectors

FloodDetector and its implementations – the classification method.

detectors.FloodDetector Contract a flood-classification method must satisfy so that
detectors.ZScoreDetector Z-score anomaly detection on VV/VH backscatter, adapted from Tripathy
detectors.OtsuDetector Otsu thresholding on each wet-season scene’s own VV/VH histogram

Preprocessing

Reprojection, clipping, stacking, slope.

preprocessing.read_sentinel1_stac Read a STAC item’s VV/VH bands and convert them from decibel to linear
preprocessing.reproject_clip_stac Reproject each of AOI id’s scenes (native CRS, as returned by
preprocessing.stack_images Stack every scene’s clipped VV/VH into two multi-band DataArrays
preprocessing.clip_xarray_using_id Reproject data_xarray to AOI aoi_id’s UTM zone and resample it
preprocessing.smoothen_slope Compute slope from dem_xarray (xrspatial.slope, degrees) and smooth

Postprocessing

Polygonization and monthly aggregation.

postprocessing.polygonize_flood_raster Vectorize flood_data’s high-confidence flood cells (class 3 only –
postprocessing.flood_duration_count Per-pixel flood statistics across a (date, y, x) stack of binary/
postprocessing.aggregate_monthly Collapse a per-date flood-classification stack (from

Utilities

Raster I/O, date handling, STAC search helpers.

utils.open_rasterio_with_retry Open a (possibly remote) raster with rioxarray, under a bounded GDAL
utils.export_xarray Write a DataArray to filename as a Cloud Optimized GeoTIFF (COG) –
utils.date_range Inclusive [start, start + days] range, e.g. date_range(‘01/08/2023’, 10)
utils.string_to_date_range Expand ‘yyyy/mm’ month strings into a (first day, last day) date range,
utils.gpd_to_json Read infile, filter to id_list, and return each polygon’s bounding
utils.decibel_to_linear dB -> linear power. Sentinel-1 RTC backscatter is stored in dB;
utils.linear_to_decibel Linear power -> dB. Inverse of decibel_to_linear(); use for display