fimserve


Namefimserve JSON
Version 0.1.71 PyPI version JSON
download
home_pagehttps://github.com/sdmlua/FIMserv
SummaryFramework 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).
upload_time2025-01-31 04:01:56
maintainerSupath Dhital
docs_urlNone
authorSupath Dhital
requires_python<3.13,>=3.10
licenseGPL-3.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Flood Inundation Mapping Tool using the OWP HAND-FIM operational framework
<hr style="border: 1px solid black; margin: 0;">  

[![Version](https://img.shields.io/github/v/release/sdmlua/FIMserv)](https://github.com/sdmlua/FIMserv/releases)
[![Issues](https://img.shields.io/github/issues/sdmlua/FIMserv)](https://github.com/sdmlua/FIMserv/issues)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://opensource.org/licenses/GPL-3.0)
[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fsdmlua%2FFIMserv&count_bg=%231A93AE&title_bg=%23E48A8A&icon=clyp.svg&icon_color=%23E7E7E7&title=Views&edge_flat=false)](https://hits.seeyoufarm.com)
[![PyPI version](https://badge.fury.io/py/fimserve.svg?icon=si%3Apython)](https://badge.fury.io/py/fimserve)
[![PyPI Downloads](https://static.pepy.tech/badge/fimserve)](https://pepy.tech/projects/fimserve)



### **OWP HAND-FIM 'as a service' (FIMserv)**
<hr style="border: 1px solid black; margin: 0;">  

| | |
| --- | --- |
| <a href="https://sdml.ua.edu"><img src="https://sdml.ua.edu/wp-content/uploads/2023/01/SDML_logo_Sq_grey.png" alt="SDML Logo" width="400"></a> | 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**
<hr style="border: 1px solid black; margin: 0;">  

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). 

### **Package structures**
<hr style="border: 1px solid black; margin: 0;">  

This FIMserv framework is published as python package and published on [PyPI](https://pypi.org/project/fimserve/0.1.62/) [![PyPI version](https://badge.fury.io/py/fimserve.svg?icon=si%3Apython)](https://badge.fury.io/py/fimserve). It contains multiple modules to perform different functionalities which are structured into the fimserve folder while development of python packaging.
```bash
FIMserv/
├── docs/                   # Documentation (contains 'FIMserv' Tool usage sample codes)
├── GeoGLOWS/               # Streamflow download using GeoGLOWS hydrofabrics
├── src/
│   └── fimserve/         
│       ├── streamflowdata/ # Handles streamflow data
│       │   ├── nwmretrospectivedata.py   # Processes NWM retrospective 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](./docs/code_usage.ipynb)) to download and process one or multiple hucs. 

<img src="./images/flowchart.jpg" alt="Flowchart" style="border: 1px solid black; padding: 1px;">

<em>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.</em>
### **Tool Usage**
<hr style="border: 1px solid black; margin: 0;">  

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.**
```bash
#creating a virtual environment using conda
conda create --name fimserve python==3.10

#Activate environment
conda activate fimserve
```
**Install or add fimserve into your workflows**
```bash
#Using pip
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](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1LLagzuLKTDu3WzwjqRoIgnn2iiAveU2f?usp=sharing) 

```bash
#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: **<a href="https://ualabama.maps.arcgis.com/apps/instant/basic/index.html?appid=88789b151b50430d8e840d573225b36b" target="_blank">ArcGIS Instant App</a>**.

```bash
fm.DownloadHUC8(huc)    #Download the HUC8 data
```
**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.
```bash
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.

```bash
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)](./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)](./docs/FIMin3steps.ipynb). 

Use Google Colab. Here is **Detailed code Usage of FIMserv in Google Colab**: [![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1mAjgkkCvR3Tcbdz48SwlkHmEo1GZvsh7?usp=sharing)


**Different HUC8 IDs, USGS gauge stations and flowline information that might be required to further understand/running this framework can be found in this <a href="https://ualabama.maps.arcgis.com/apps/instant/basic/index.html?appid=88789b151b50430d8e840d573225b36b" target="_blank">ArcGIS Instant App</a>.** 

 
### **Acknowledgements**
<hr style="border: 1px solid black; margin: 0;">  

| | |
| --- | --- |
| ![alt text](https://ciroh.ua.edu/wp-content/uploads/2022/08/CIROHLogo_200x200.png) | 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 (#Funding ID). |
| | 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**
<hr style="border: 1px solid black; margin: 0;">  

#### **Contact**

<a href="https://geography.ua.edu/people/sagy-cohen/" target="_blank">Dr. Sagy Cohen</a>
 (sagy.cohen@ua.edu),
Dr Anupal Baruah,(abaruah@ua.edu), Supath Dhital (sdhital@crimson.ua.edu)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/sdmlua/FIMserv",
    "name": "fimserve",
    "maintainer": "Supath Dhital",
    "docs_url": null,
    "requires_python": "<3.13,>=3.10",
    "maintainer_email": "sdhital@crimson.ua.edu",
    "keywords": null,
    "author": "Supath Dhital",
    "author_email": "sdhital@crimson.ua.edu",
    "download_url": "https://files.pythonhosted.org/packages/f7/34/517bf9ea3e7eecf586c28eeef2a06ac48b20faa8fdcdf309894b4f6549ae/fimserve-0.1.71.tar.gz",
    "platform": null,
    "description": "# Flood Inundation Mapping Tool using the OWP HAND-FIM operational framework\n<hr style=\"border: 1px solid black; margin: 0;\">  \n\n[![Version](https://img.shields.io/github/v/release/sdmlua/FIMserv)](https://github.com/sdmlua/FIMserv/releases)\n[![Issues](https://img.shields.io/github/issues/sdmlua/FIMserv)](https://github.com/sdmlua/FIMserv/issues)\n[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://opensource.org/licenses/GPL-3.0)\n[![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fsdmlua%2FFIMserv&count_bg=%231A93AE&title_bg=%23E48A8A&icon=clyp.svg&icon_color=%23E7E7E7&title=Views&edge_flat=false)](https://hits.seeyoufarm.com)\n[![PyPI version](https://badge.fury.io/py/fimserve.svg?icon=si%3Apython)](https://badge.fury.io/py/fimserve)\n[![PyPI Downloads](https://static.pepy.tech/badge/fimserve)](https://pepy.tech/projects/fimserve)\n\n\n\n### **OWP HAND-FIM 'as a service' (FIMserv)**\n<hr style=\"border: 1px solid black; margin: 0;\">  \n\n| | |\n| --- | --- |\n| <a href=\"https://sdml.ua.edu\"><img src=\"https://sdml.ua.edu/wp-content/uploads/2023/01/SDML_logo_Sq_grey.png\" alt=\"SDML Logo\" width=\"400\"></a> | 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). |\n\n\n### **Background**\n<hr style=\"border: 1px solid black; margin: 0;\">  \n\nOWP 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). \n\n### **Package structures**\n<hr style=\"border: 1px solid black; margin: 0;\">  \n\nThis FIMserv framework is published as python package and published on [PyPI](https://pypi.org/project/fimserve/0.1.62/) [![PyPI version](https://badge.fury.io/py/fimserve.svg?icon=si%3Apython)](https://badge.fury.io/py/fimserve). It contains multiple modules to perform different functionalities which are structured into the fimserve folder while development of python packaging.\n```bash\nFIMserv/\n\u251c\u2500\u2500 docs/                   # Documentation (contains 'FIMserv' Tool usage sample codes)\n\u251c\u2500\u2500 GeoGLOWS/               # Streamflow download using GeoGLOWS hydrofabrics\n\u251c\u2500\u2500 src/\n\u2502   \u2514\u2500\u2500 fimserve/         \n\u2502       \u251c\u2500\u2500 streamflowdata/ # Handles streamflow data\n\u2502       \u2502   \u251c\u2500\u2500 nwmretrospectivedata.py   # Processes NWM retrospective data\n\u2502       \u2502   \u2514\u2500\u2500 forecasteddata.py        # Processes all range forecasted streamflow data\n\u2502       \u251c\u2500\u2500 plots/          # Vizualization functionalities\n\u2502       \u251c\u2500\u2500 FIMsubset/      # Subsetting functionalities for FIM\n\u2502       \u2502   \u251c\u2500\u2500 xycoord.py  # Subset using Lat, Lon \n\u2502       \u2502   \u2514\u2500\u2500 shpsubset.py # Subset using boundary\n\u2502       \u251c\u2500\u2500 statistics/     # Statistical analysis\n\u2502       \u2502   \u2514\u2500\u2500 calculatestatistics.py  # Statistical analysis between NWM and USGS gauge data\n\u2502       \u251c\u2500\u2500 datadownload.py # Includes HUC8 data retrival and folder management module\n\u2502       \u251c\u2500\u2500 runFIM.py       # OWPHAND model execution\n\u2502       \u251c\u2500\u2500 vizualization.py # Interactive visualization of user-defined inundation files (in Jupyter Notebook)\n\u2514\u2500\u2500 tests/                  # Includes test cases for different functionality\n\n```\n**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](./docs/code_usage.ipynb)) to download and process one or multiple hucs. \n\n<img src=\"./images/flowchart.jpg\" alt=\"Flowchart\" style=\"border: 1px solid black; padding: 1px;\">\n\n<em>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.</em>\n### **Tool Usage**\n<hr style=\"border: 1px solid black; margin: 0;\">  \n\nAlthough not mandatory, \n**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.**\n```bash\n#creating a virtual environment using conda\nconda create --name fimserve python==3.10\n\n#Activate environment\nconda activate fimserve\n```\n**Install or add fimserve into your workflows**\n```bash\n#Using pip\npip install fimserve\n\n#OR add using poetry to your framework development for quick FIM generation\npoetry add fimserve\n```\n\n**FIM generation only in 3 steps using fimserve framework**\n\nThis 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](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1LLagzuLKTDu3WzwjqRoIgnn2iiAveU2f?usp=sharing) \n\n```bash\n#Import framework once it is installed in your workflows\nimport fimserve as fm\n\n# Initialize necessary variables\nhuc = \"03020202\"        #HUC8 ID\nstart_date = \"2016-10-08\"   #Start date of the streamflow data\nend_date = \"2016-10-10\"     #End date of the streamflow data\n\nvalue_time = [\"2016-10-09 03:00:00\"]   #Time of the streamflow data user want to generate FIM within start_date and end_date\n```\n**Step 1. Download HUC8 data**\n\nOWP 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: **<a href=\"https://ualabama.maps.arcgis.com/apps/instant/basic/index.html?appid=88789b151b50430d8e840d573225b36b\" target=\"_blank\">ArcGIS Instant App</a>**.\n\n```bash\nfm.DownloadHUC8(huc)    #Download the HUC8 data\n```\n**Step 2. Get the NWM Streamflow data**\n\nUsers 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.\n```bash\nfm.getNWMretrospectivedata(start_date, end_date, huc, value_time)\n```\n**Step 3. Generate the Flood Inundation Mapping**\n\nThis functionality automatically uses the recently downloaded and stored streamflow to generate FIM. This automation is based on the HUCID.\n\n```bash\nfm.runOWPHANDFIM(huc)       #Run the OWP-HAND FIM with the NWM retrospective streamflow data\n```\n\nThen 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)](./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)](./docs/FIMin3steps.ipynb). \n\nUse Google Colab. Here is **Detailed code Usage of FIMserv in Google Colab**: [![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1mAjgkkCvR3Tcbdz48SwlkHmEo1GZvsh7?usp=sharing)\n\n\n**Different HUC8 IDs, USGS gauge stations and flowline information that might be required to further understand/running this framework can be found in this <a href=\"https://ualabama.maps.arcgis.com/apps/instant/basic/index.html?appid=88789b151b50430d8e840d573225b36b\" target=\"_blank\">ArcGIS Instant App</a>.** \n\n \n### **Acknowledgements**\n<hr style=\"border: 1px solid black; margin: 0;\">  \n\n| | |\n| --- | --- |\n| ![alt text](https://ciroh.ua.edu/wp-content/uploads/2022/08/CIROHLogo_200x200.png) | 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 (#Funding ID). |\n| | 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.|\n\n### **For More Information**\n<hr style=\"border: 1px solid black; margin: 0;\">  \n\n#### **Contact**\n\n<a href=\"https://geography.ua.edu/people/sagy-cohen/\" target=\"_blank\">Dr. Sagy Cohen</a>\n (sagy.cohen@ua.edu),\nDr Anupal Baruah,(abaruah@ua.edu), Supath Dhital (sdhital@crimson.ua.edu)\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "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).",
    "version": "0.1.71",
    "project_urls": {
        "Homepage": "https://github.com/sdmlua/FIMserv",
        "Repository": "https://github.com/sdmlua/FIMserv"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bf9da3db04d94c585ab94d189a71772fb3694719f8bf66187ccbfabb40b11d99",
                "md5": "985f1c97178cf46780a5ea87ed775304",
                "sha256": "a10fdf05f20ad11233160280bcba8caceca4a7104abe003a5961aece3c80040d"
            },
            "downloads": -1,
            "filename": "fimserve-0.1.71-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "985f1c97178cf46780a5ea87ed775304",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.13,>=3.10",
            "size": 38610,
            "upload_time": "2025-01-31T04:01:55",
            "upload_time_iso_8601": "2025-01-31T04:01:55.096535Z",
            "url": "https://files.pythonhosted.org/packages/bf/9d/a3db04d94c585ab94d189a71772fb3694719f8bf66187ccbfabb40b11d99/fimserve-0.1.71-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f734517bf9ea3e7eecf586c28eeef2a06ac48b20faa8fdcdf309894b4f6549ae",
                "md5": "828bb2ac0bb405cfdbad4bcdde2cb3cb",
                "sha256": "3bae5c803161b6314dfa0e453d8b6d304e45916febff0eb3d156da0c857dec8a"
            },
            "downloads": -1,
            "filename": "fimserve-0.1.71.tar.gz",
            "has_sig": false,
            "md5_digest": "828bb2ac0bb405cfdbad4bcdde2cb3cb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.13,>=3.10",
            "size": 35103,
            "upload_time": "2025-01-31T04:01:56",
            "upload_time_iso_8601": "2025-01-31T04:01:56.354844Z",
            "url": "https://files.pythonhosted.org/packages/f7/34/517bf9ea3e7eecf586c28eeef2a06ac48b20faa8fdcdf309894b4f6549ae/fimserve-0.1.71.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-31 04:01:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sdmlua",
    "github_project": "FIMserv",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fimserve"
}
        
Elapsed time: 0.50204s