Skip to main content

Framework which is developed with the purpose of quickly generating Flood Inundation Maps (FIM) for emergency response and risk assessment. It is developed under Surface Dynamics Modeling Lab (SDML).

Project description

Flood Inundation Mapping Tool using the OWP HAND-FIM operational framework


Version Issues License: GPL v3 PyPI version PyPI Downloads Publish Status

OWP HAND-FIM 'as a service' (FIMserv)


SDML Logo This package presents a streamlined, user-friendly and cloud-enabled pipeline to generate Operational flood inundation map using the NOAA Office of Water Prediction (OWP) Height Above Nearest Drainage (HAND) Flood Inundation Mapping (FIM) framework using the National Water Model retrospective and forecasted streamflow. It is developed under the Surface Dynamics Modeling Lab (SDML) as part of a project funded by the Cooperative Institute for Research to Operations in Hydrology (CIROH).

Background


OWP HAND-FIM is a national-scale operational flood forecasting framework (https://github.com/NOAA-OWP/inundation-mapping). It is a terrain-based fluvial flooding model that uses model-predicted streamflow and reach-averaged Synthetic Rating Curves (SRCs) to generate inundation extent and depth rasters at HUC-8 scale (Hydrologic Unit Code-8). The model can produce FIMs for all order streams within the watershed at a very low computational cost. This notebook streamline the FIM generation process or the OWP HAND-FIM framework on the cloud. It allow users to run over mutiple HUC-8s simultaneously. This model can run using any temporal resolution available from the input streamflow data (hourly, daily, monthly etc). ### Currently we are hosting the FIM-4.5 and 4.8 version for Inundation Mapping.Based on user's choice HAND rasters from specific version can be called and used in FIM (Please refer to Step-1)

Package structures


This FIMserv framework is published as python package and published on PyPI PyPI version. It contains multiple modules to perform different functionalities which are structured into the fimserve folder while development of python packaging.

FIMserv/
├── docs/                   # Documentation (contains 'FIMserv' Tool usage sample codes)     ├── source/           #Contains  sphinx documentation (under development)     ├──code_usage.ipynb  #Contains the detailed documentation     └── FIMin3Steps.ipynb  #Focusing only on FIM generation within 3 steps  
├── GeoGLOWS/               # Streamflow download using GeoGLOWS hydrofabrics
├── src/
│   └── fimserve/                ├── streamflowdata/ # Handles streamflow data          ├── nwmretrospectivedata.py   # Processes NWM retrospective data          ├── geoglows.py   # Module to retrieve geoglows streamflow data           ├── usgsdata.py   # Retrieve USGS gauge station data          └── forecasteddata.py        # Processes all range forecasted streamflow data       ├── plots/          # Vizualization functionalities       ├── FIMsubset/      # Subsetting functionalities for FIM          ├── xycoord.py  # Subset using Lat, Lon           └── shpsubset.py # Subset using boundary       ├── statistics/     # Statistical analysis          └── calculatestatistics.py  # Statistical analysis between NWM and USGS gauge data       ├── datadownload.py # Includes HUC8 data retrival and folder management module       ├── runFIM.py       # OWPHAND model execution       ├── vizualization.py # Interactive visualization of user-defined inundation files (in Jupyter Notebook)
└── tests/                  # Includes test cases for different functionality

The structure of the framework consisting its applications and connection between different functionalities. The right figure, b), is the directory structure used in this package (for e.g. after using this code by following docs/code_usage.ipynb) to download and process one or multiple hucs.

Flowchart

Fig. (a)A complete workflow demonstrating the framework architecture, and (b) directory structure as it appears on the user's system after using the FIMserv for FIM generation.

Tool Usage


Although not mandatory, we strongly recommend users create a virtual environment and install this package on that virtual environment to avoid the conflict between system dependencies and package dependencies.

‼️ If your system doesnot have git, install it first. Download link of git for windows or MacOS: https://git-scm.com/downloads and GDAL (gdal-config) is also needed to setup the build of this installation, install it on your system - https://gdal.org/en/stable/download.html

For conda users

#creating a virtual environment using conda
conda create --name fimserve python==3.10

#Activate environment
conda activate fimserve

If you don't have conda

#create a virtual env using 'venv'
python -m venv fimserve python==3.10

#activate environment
#For MAC Users
source fimserve/bin/activate

#For WINDOW Users
fimserve\Scripts\activate

Once Virtual env is ready, install or add fimserve into your workflows

#Using pip
pip install uv
uv pip install fimserve 
'OR'
pip install fimserve


#OR add using poetry to your framework development for quick FIM generation
poetry add fimserve

FIM generation only in 3 steps using fimserve framework

This framework have multiple other funtionalities, but the most important is to generate the FIM. The following step is the standard way to generate FIM using OWP Operation FIM framework with FIMserv. This is just a quick 3 steps for one huc and one event, user can use this framework as many case and event as per thier requirement. The google colab version of FIMin3Steps is here- Google Colab

#Import framework once it is installed in your workflows
import fimserve as fm

# Initialize necessary variables
huc = "03020202"        #HUC8 ID
start_date = "2016-10-08"   #Start date of the streamflow data
end_date = "2016-10-10"     #End date of the streamflow data

value_time = ["2016-10-09 03:00:00"]   #Time of the streamflow data user want to generate FIM within start_date and end_date

Step 1. Download HUC8 data

OWP HAND FIM model runs at HUC-8 watershed scale. User need to identify the HUC8 ID for their specific region of interest. In this example we are using the Neuse River Flooding in North Carolina from Hurricane Mathhew,2016. The HUC8 id is 03020202. The locations and informations about the HUC8 IDs are available here in: ArcGIS Instant App.

fm.DownloadHUC8(huc)    #Download the HUC8 data. By default this command will download the latest version of OWP HAND rasters
#for earlier version, use
fm.DownloadHUC8(huc,version='4.5')

Step 2. Get the NWM Streamflow data

Users can retrieve NWM forecasted and retrospective data for a specified date range (start date to end date). Additionally, they can store streamflow data for a specific date, as defined by value_times, during the initialization process to generate FIM.

fm.getNWMretrospectivedata(start_date, end_date, huc, value_time)

Step 3. Generate the Flood Inundation Mapping

This functionality automatically uses the recently downloaded and stored streamflow to generate FIM. This automation is based on the HUCID.

fm.runOWPHANDFIM(huc)       #Run the OWP-HAND FIM with the NWM retrospective streamflow data

Then there are a lot of different modules/funtionalities related to Syntetic Rating Curve (SRCs) analysis, NWM and USGS streamflow Evaluation, Subsetting of FIM, Domain filtering etc. For reference to run, Here (docs/code_usage.ipynb) is the sample usage of this FIMserv tool and which covers all modules in detailed and to generate FIM only, follow this shorter, FIM in 3 steps version Here (docs/FIMin3steps.ipynb).

Use Google Colab. Here is Detailed code Usage of FIMserv in Google Colab: Google Colab

Different HUC8 IDs, USGS gauge stations and flowline information that might be required to further understand/running this framework can be found in this ArcGIS Instant App.

Citing This Tool

Anupal Baruah, Supath Dhital, Sagy Cohen, et al. FIMserv v.1.0: A Tool for Streamlining Flood Inundation Mapping (FIM) Using the United States Operational Hydrological Forecasting Framework. Environmental Modelling & Software, Volume 192, 2025, 106581. https://doi.org/10.1016/j.envsoft.2025.106581

Acknowledgements


alt text Funding for this project was provided by the National Oceanic & Atmospheric Administration (NOAA), awarded to the Cooperative Institute for Research to Operations in Hydrology (CIROH) through the NOAA Cooperative Agreement with The University of Alabama (NA22NWS4320003).
We would like to acknowledge the TEEHR script developed by RTI International (https://github.com/RTIInternational/teehr). We use this script to get NWM discharge quickly.

For More Information


Contact

Dr. Sagy Cohen (sagy.cohen@ua.edu), Dr Anupal Baruah,(abaruah@ua.edu), Supath Dhital (sdhital@crimson.ua.edu)

Project details


Download files

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

Source Distribution

fimserve-0.1.96.tar.gz (82.8 kB view details)

Uploaded Source

Built Distribution

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

fimserve-0.1.96-py3-none-any.whl (89.2 kB view details)

Uploaded Python 3

File details

Details for the file fimserve-0.1.96.tar.gz.

File metadata

  • Download URL: fimserve-0.1.96.tar.gz
  • Upload date:
  • Size: 82.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for fimserve-0.1.96.tar.gz
Algorithm Hash digest
SHA256 d3a875508fd9037e8bb5ee518f6b235c85b9ae38e5699984d033be89d0f4e4ed
MD5 c3664678ea2a7d5c4c16d762141e9dea
BLAKE2b-256 758cf8be61b30a2dbbbcff00696366109b252f5178d84c50369741ab4b39c193

See more details on using hashes here.

File details

Details for the file fimserve-0.1.96-py3-none-any.whl.

File metadata

  • Download URL: fimserve-0.1.96-py3-none-any.whl
  • Upload date:
  • Size: 89.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for fimserve-0.1.96-py3-none-any.whl
Algorithm Hash digest
SHA256 b9806b40255aada2d34b56a368a95bb28afdf03693d361c7b5316e5cf5221ea6
MD5 44e8b5149f3dd1a4977dd0f0ae2e4780
BLAKE2b-256 b72b473dcbb193266d1be41651a40b47cf614ad4bc29b8032389280b491d23ee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page