Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

AutoFloods

AutoFloods is a Python package for automated flood mapping at scale from Sentinel-1 SAR imagery, with pluggable data sources (Microsoft Planetary Computer, NASA OPERA) and detection methods (Z-score, Otsu).

Quickstart

OPERASource requires a free NASA Earthdata Login; MPCSource works with no credentials at all (a free subscription key just raises rate limits) — see Authentication.

Pre-release: pip install --pre autofloods

Basic usage:

from autofloods import flood_mapper
from autofloods.sources import OPERASource

fm = flood_mapper(
    # AOI grid; needs id_col, dry_date_col, zone columns
    grid_shapefile='resources/india_utm_fishnet_buffer.gpkg',

    # which AOI IDs from the grid to process
    grid_id_list=[321],

    # dry-season years to build the baseline from
    dry_years=[2024, 2024],

    # where the terrain-slope mask is cached
    slope_dir='resources/slope/',

    # wet-season date range to classify
    wet_duration=['2024/07', '2024/10'],

    # or MPCSource() (the default)
    source=OPERASource(),

    # root dir for all outputs and caches
    output_dir='output/my_run',
)

# read each AOI's dry season into self.dry_months
fm.get_dry_dates()

# turn dry_months into per-year search date ranges
fm.generate_dry_date_ranges()

# STAC-search the source for dry-season scenes
fm.get_s1_items(dry_wet='dry')

# download + read those scenes
fm.read_scenes(dry_wet='dry', overview_level=None, max_workers=6)

# fit the dry-season Z-score baseline per AOI
fm.generate_mean_std_by_aoi()

# compute/cache the terrain-slope mask
fm.prepare_slope(dem_overview=0, buffer=500)

# search, read, reproject wet-season scenes
fm.prepare_wet_scenes(overview_level=None, max_workers=6)

# classify each scene against the baseline
fm.map_floods(vv_thd=-2.5, vh_thd=-2.5, rel_slope_thd=20,
              export_raster=False, export_vector=False, export_maps=False)

# collapse per-scene results into one band per date
fm.merge_floods_by_date(export_raster=True)

# per-pixel count of scenes with data gaps
fm.generate_number_of_scenes(export_raster=True)

# aggregate per-date results into per-month flood-day counts
fm.monthly_sum()

See the documentation for full usage, API reference, and citation details: https://autofloods.readthedocs.io/en/latest/

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autofloods-0.1.0a11.tar.gz (83.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autofloods-0.1.0a11-py3-none-any.whl (66.6 kB view details)

Uploaded Python 3

File details

Details for the file autofloods-0.1.0a11.tar.gz.

File metadata

  • Download URL: autofloods-0.1.0a11.tar.gz
  • Upload date:
  • Size: 83.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for autofloods-0.1.0a11.tar.gz
Algorithm Hash digest
SHA256 e401b025e457ca3b0dc3f661521be92ece33c139c1dc518033c3c563394fc592
MD5 9e76fb6e97b72b7ae5782635c1524ea2
BLAKE2b-256 95e74e75ed743f57fc124ac8d1c16cc103856fb4abcd825e504a8fbc3683d9fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for autofloods-0.1.0a11.tar.gz:

Publisher: publish.yml on PratyushTripathy/AutoFloods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file autofloods-0.1.0a11-py3-none-any.whl.

File metadata

  • Download URL: autofloods-0.1.0a11-py3-none-any.whl
  • Upload date:
  • Size: 66.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for autofloods-0.1.0a11-py3-none-any.whl
Algorithm Hash digest
SHA256 e1e47c021d43dbe96fc4b6456b1a1b13af20a4ff80135788174d6d8f08dc8c8b
MD5 88b97ef519a9c903eb9253eec193ab4f
BLAKE2b-256 8db2545fc691f479a620959af83938c377b44916a5fd9b662f662ae1ee58ec5c

See more details on using hashes here.

Provenance

The following attestation bundles were made for autofloods-0.1.0a11-py3-none-any.whl:

Publisher: publish.yml on PratyushTripathy/AutoFloods

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page