Getting Started
See Overview for installation instructions.
Authentication
Credentials depend on which STACSource you use, and only one is needed:
MPCSource(Microsoft Planetary Computer) works with no credentials at all – search and asset access both fall back to anonymous requests. A subscription key is optional and only raises the request rate limit, useful for large batch runs. Get one free at planetarycomputer.microsoft.com/account, then set it as an environment variable:export MPC_SUBSCRIPTION_KEY=your-key-hereIt’s picked up automatically; nothing needs to be passed in code or in a config file. Never commit the key value itself anywhere in the repo.
OPERASource(NASA OPERA RTC-S1 via ASF/CMR) requires a NASA Earthdata Login. Create a free account at urs.earthdata.nasa.gov, then set up a~/.netrcentry for it. The recommended way is the built-in helper:from autofloods.authenticate import setup_earthdata_login setup_earthdata_login()This prompts for your username (
input()) and password (getpass.getpass(), never echoed or logged), writes/updates theurs.earthdata.nasa.goventry in~/.netrcwithout touching any other entries already there, and restricts the file to owner-only permissions (chmod 600, skipped on Windows). For scripted or non-interactive setup, pass credentials directly instead of prompting (e.g. from an environment variable or secrets manager):setup_earthdata_login(username=my_username, password=my_password)Alternatively, you can set up
~/.netrcby hand, following NASA’s own.netrcsetup instructions: urs.earthdata.nasa.gov/documentation/for_users/data_access/curl_and_wget. In short, add an entry to~/.netrc:machine urs.earthdata.nasa.gov login your-username password your-passwordand restrict its permissions so other users on the machine can’t read your credentials:
chmod 600 ~/.netrcEither way,
requestspicks this up automatically on the OAuth redirect; no environment variable or code change needed elsewhere.OPERASourcealso requires the GDAL command-line tools (gdalbuildvrt) to be installed separately – see Installation for theapt-get/condacommands.
Running AutoFloods
There are two ways to run AutoFloods: the flood_mapper class directly in a notebook/script (more control), or a config file + the runner script (fastest way to launch a real job, no code to write). Both use the same underlying pipeline and produce the same output. See Examples for grid generation and full walkthroughs of both.