fimeval 0.1.53__py3-none-any.whl → 0.1.54__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fimeval/BuildingFootprint/evaluationwithBF.py +29 -36
- fimeval/BuildingFootprint/microsoftBF.py +1 -0
- fimeval/ContingencyMap/evaluationFIM.py +23 -12
- fimeval-0.1.54.dist-info/METADATA +896 -0
- {fimeval-0.1.53.dist-info → fimeval-0.1.54.dist-info}/RECORD +8 -8
- fimeval-0.1.53.dist-info/METADATA +0 -233
- {fimeval-0.1.53.dist-info → fimeval-0.1.54.dist-info}/WHEEL +0 -0
- {fimeval-0.1.53.dist-info → fimeval-0.1.54.dist-info}/licenses/LICENSE.txt +0 -0
- {fimeval-0.1.53.dist-info → fimeval-0.1.54.dist-info}/top_level.txt +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
fimeval/__init__.py,sha256=HZJKq7XEhL6TnwFkhpf8NcEQ5h7zPQ3XJh3z5gF0gQ8,603
|
|
2
2
|
fimeval/utilis.py,sha256=JYpWTJx3WOuC0wRr3nb-cwMPf0SAGIli5dJdKFS23w8,6954
|
|
3
3
|
fimeval/BuildingFootprint/__init__.py,sha256=oP9YWLdo6ANzSQFxYLv7Ku_26AY5NkLNhZLK28ICMLo,109
|
|
4
|
-
fimeval/BuildingFootprint/evaluationwithBF.py,sha256=
|
|
5
|
-
fimeval/BuildingFootprint/microsoftBF.py,sha256=
|
|
4
|
+
fimeval/BuildingFootprint/evaluationwithBF.py,sha256=2QBYbuJg98B5_PKDLnmV7M1dDVuOkJd6_rP0EdmoF-8,15645
|
|
5
|
+
fimeval/BuildingFootprint/microsoftBF.py,sha256=73M_e_n_3lsejsnP9eX06hou0sr2-yaWdjuoUwZ8O2Y,4063
|
|
6
6
|
fimeval/ContingencyMap/PWBs3.py,sha256=UFICxO58c2fA9mIffH4ooqphv3ZXe6yX8QzpRjtI6fs,1275
|
|
7
7
|
fimeval/ContingencyMap/__init__.py,sha256=ckps2dyg6aci3TA-3P7oTMcCAcSTz9AA6sndHtZEwdE,259
|
|
8
|
-
fimeval/ContingencyMap/evaluationFIM.py,sha256=
|
|
8
|
+
fimeval/ContingencyMap/evaluationFIM.py,sha256=JiQfXiiQXZd5T4PBqEyU567PHGaEXr8RUsnGmWQxzjc,17390
|
|
9
9
|
fimeval/ContingencyMap/methods.py,sha256=kbutfo9FUH-yjvnOXxwLpdErUuebMJ8NjCroNWIYCjo,3299
|
|
10
10
|
fimeval/ContingencyMap/metrics.py,sha256=jwOia0Nl7aU7AuGJFAcQ4fVENnp2G_5W6JSJBzo1-_4,1094
|
|
11
11
|
fimeval/ContingencyMap/plotevaluationmetrics.py,sha256=3bKfPKZnMR39dA3teDVpQBeTFKnF9v_2Vku0JNVGggs,3921
|
|
12
12
|
fimeval/ContingencyMap/printcontingency.py,sha256=-1H_Ze2TbRSER7vy7bd0HvxnziNzPPOIPOm2YhB7r4A,5422
|
|
13
|
-
fimeval-0.1.
|
|
14
|
-
fimeval-0.1.
|
|
15
|
-
fimeval-0.1.
|
|
16
|
-
fimeval-0.1.
|
|
17
|
-
fimeval-0.1.
|
|
13
|
+
fimeval-0.1.54.dist-info/licenses/LICENSE.txt,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
14
|
+
fimeval-0.1.54.dist-info/METADATA,sha256=MKaEZodfSX6Ot7pbV0uTqTy-E-dmc7zXC7C8X3YctR8,56090
|
|
15
|
+
fimeval-0.1.54.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
+
fimeval-0.1.54.dist-info/top_level.txt,sha256=F4QW50msI8sRrX_DK3NQ-s3swQ4-2_5Ty3mfm9ZMc6k,8
|
|
17
|
+
fimeval-0.1.54.dist-info/RECORD,,
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: fimeval
|
|
3
|
-
Version: 0.1.53
|
|
4
|
-
Summary: A Framework for Automatic Evaluation of Flood Inundation Mapping Predictions Evaluation
|
|
5
|
-
Author: Surface Dynamics Modeling Lab
|
|
6
|
-
Author-email: Supath Dhital <sdhital@crimson.ua.edu>, Dipshika Devi <ddevi@ua.edu>
|
|
7
|
-
Maintainer-email: Supath Dhital <sdhital@crimson.ua.edu>, Dipshika Devi <ddevi@ua.edu>
|
|
8
|
-
Requires-Python: >=3.10
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
License-File: LICENSE.txt
|
|
11
|
-
Requires-Dist: rasterio<2.0.0,>=1.4.2
|
|
12
|
-
Requires-Dist: numpy>=2
|
|
13
|
-
Requires-Dist: geopandas<2.0.0,>=1.0.1
|
|
14
|
-
Requires-Dist: shapely<3.0.0,>=2.0.6
|
|
15
|
-
Requires-Dist: matplotlib<4.0.0,>=3.9.2
|
|
16
|
-
Requires-Dist: plotly<6.0.0,>=5.24.1
|
|
17
|
-
Requires-Dist: kaleido==0.2.1
|
|
18
|
-
Requires-Dist: nbformat<6.0.0,>=5.10.4
|
|
19
|
-
Requires-Dist: pyproj<4.0.0,>=3.7.0
|
|
20
|
-
Requires-Dist: notebook<8.0.0,>=7.3.2
|
|
21
|
-
Requires-Dist: boto3<2.0.0,>=1.36.16
|
|
22
|
-
Requires-Dist: geemap
|
|
23
|
-
Provides-Extra: dev
|
|
24
|
-
Requires-Dist: pytest; extra == "dev"
|
|
25
|
-
Requires-Dist: black; extra == "dev"
|
|
26
|
-
Dynamic: license-file
|
|
27
|
-
|
|
28
|
-
## Flood Inundation Mapping Predictions Evaluation Framework (FIMeval)
|
|
29
|
-
<hr style="border: 1px solid black; margin: 0;">
|
|
30
|
-
|
|
31
|
-
[](https://github.com/sdmlua/fimeval/releases)
|
|
32
|
-
[](https://github.com/sdmlua/fimeval/issues)
|
|
33
|
-
[](https://opensource.org/licenses/GPL-3.0)
|
|
34
|
-
[](https://badge.fury.io/py/fimeval)
|
|
35
|
-
[](https://pepy.tech/projects/fimeval)
|
|
36
|
-
|
|
37
|
-
| | |
|
|
38
|
-
| --- | --- |
|
|
39
|
-
| <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="300"></a> | This repository provides a user-friendly Python package and source code for the automatic evaluation of flood inundation maps. It is developed under Surface Dynamics Modeling Lab (SDML), Department of Geography and the Environment at The University of Alabama, United States.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
### **Background**
|
|
43
|
-
<hr style="border: 1px solid black; margin: 0;">
|
|
44
|
-
|
|
45
|
-
The accuracy of the flood inundation mapping (FIM) is critical for model development and disaster preparedness. The evaluation of flood maps from different sources using geospatial platforms can be tedious and requires repeated processing and analysis for each map. These preprocessing steps include extracting the correct flood extent, assigning the same projection system to all the maps, categorizing the maps as binary flood maps, removal of permanent water bodies, etc. This manual data processing is cumbersome and prone to human error.
|
|
46
|
-
|
|
47
|
-
To address these issues, we developed Flood Inundation Mapping Prediction Evaluation Framework (FIMeval), a Python-based FIM evaluation framework capable of automatically evaluating flood maps from different sources. FIMeval takes the advantage of comparing multiple target datasets with large benchmark datasets. It includes an option to incorporate permanent waterbodies as non-flood pixels with a user input file or pre-set dataset. In addition to traditional evaluation metrics, it can also compare the number of buildings inundated using a user input file or a pre-set dataset.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
### **Repository structure**
|
|
52
|
-
<hr style="border: 1px solid black; margin: 0;">
|
|
53
|
-
|
|
54
|
-
The architecture of the ```fimeval``` integrates different modules to which helps the automation of flood evaluation. All those modules codes are in source (```src``` ) folder.
|
|
55
|
-
```bash
|
|
56
|
-
fimeval/
|
|
57
|
-
├── docs/ # Documentation (contains 'FIMserv' Tool usage sample codes)
|
|
58
|
-
│ └── sampledata/ # Contains the sample data to demonstrate how this frameworks works
|
|
59
|
-
│ └── fimeval_usage.ipynb #Sample code usage of the Evaluation framework
|
|
60
|
-
├── Images/ # have sample images for documentation
|
|
61
|
-
├── src/
|
|
62
|
-
│ └── fimeval/
|
|
63
|
-
│ ├──BuildingFootprint/ # Contains the evaluation of model predicted FIM with microsoft building footprint
|
|
64
|
-
│ │ └── microsoftBF.py
|
|
65
|
-
│ │ └── evaluationwithBF.py
|
|
66
|
-
│ └── ContingencyMap/ # Contains all the metrics calculation and contingency map generation
|
|
67
|
-
│ │ ├── evaluationFIM.py # main evaluation moodule
|
|
68
|
-
│ │ └── methods.py # Contains 3 different methods of evaluation
|
|
69
|
-
│ │ └── metrics.py # metrics calculation module
|
|
70
|
-
│ │ └── plotevaluationmetrics.py # use to vizualize the different performance metrics
|
|
71
|
-
│ │ └── printcontingency.py # prints the contingency map to quickly generate the Map layout
|
|
72
|
-
│ │ └── PWBs3.py # module which helps to get permanent water bodies from s3 bucket
|
|
73
|
-
│ └── utilis.py #Includes the resampling and reprojection of FIMs
|
|
74
|
-
└── tests/ # Includes test cases for different functionality
|
|
75
|
-
```
|
|
76
|
-
The graphical representation of fimeval pipeline can be summarized as follows in **```Figure 1```**. Here, it will show all the steps incorporated within the ```fimeval``` during packaging and all functionality are interconnected to each other, resulting the automation of the framework.
|
|
77
|
-
|
|
78
|
-
<div align="center">
|
|
79
|
-
<img width="900" alt="image" src="./Images/flowchart.jpg">
|
|
80
|
-
</div>
|
|
81
|
-
Figure 1: Flowchart showing the entire framework pipeline.
|
|
82
|
-
|
|
83
|
-
### **Framework Installation and Usage**
|
|
84
|
-
<hr style="border: 1px solid black; margin: 0;">
|
|
85
|
-
|
|
86
|
-
This framework is published as a python package in PyPI (https://pypi.org/project/fimeval/).For directly using the package, the user can install this package using python package installer 'pip' and can import on their workflows:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
#Install to use this framework
|
|
90
|
-
pip install uv #Makes the downloading much faster
|
|
91
|
-
uv pip install fimeval
|
|
92
|
-
|
|
93
|
-
#Use this framework in your workflows using poetry
|
|
94
|
-
poetry add fimeval
|
|
95
|
-
```
|
|
96
|
-
Import the package to the jupyter notebook or any python IDE.
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
#Import the package
|
|
100
|
-
import fimeval as fp
|
|
101
|
-
```
|
|
102
|
-
**Note: The framework usage provided in detailed in [Here (docs/fimeval_usage.ipynb)](./docs/fimeval_usage.ipynb)**. It has detail documentation from installation, setup, running- until results.
|
|
103
|
-
|
|
104
|
-
#### **Main Directory Structure**
|
|
105
|
-
The main directory contains the primary folder for storing the case studies. If there is one case study, user can directly pass the case study folder as the main directory. Each case study folder must include a Benchmark FIM (B-FIM) with a 'benchmark' word assigned within the B-FIM file and different Model Predicted FIM (M-FIM)
|
|
106
|
-
in tif format.
|
|
107
|
-
For mutilple case studies,the main directory could be structure in such a way that contain the seperate folders for individual case studies.For example, if a user has two case studies they should create two seperate folders as shown in the Figure below.
|
|
108
|
-
<div align="center">
|
|
109
|
-
<img width="350" alt="image" src="./Images/directorystructure.png">
|
|
110
|
-
</div>
|
|
111
|
-
Figure 2: Main directory structure for one and multiple case study.
|
|
112
|
-
|
|
113
|
-
This directory can be defined as follows while running framework.
|
|
114
|
-
```bash
|
|
115
|
-
main_dir = Path('./path/to/main/dir')
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
#### **Permanent Water Bodies (PWB)**
|
|
119
|
-
This framework uses PWB to first to delineate the PWB in the FIM and assign into different class so that the evaluation will be more fair. For the Contiguous United States (CONUS), the PWB is already integrated within the framework however, if user have more accurate PWB or using fimeval for outside US they can initialize and use PWB within fimeval framework. Currently it is using PWB publicly hosted by ESRI: https://hub.arcgis.com/datasets/esri::usa-detailed-water-bodies/about
|
|
120
|
-
|
|
121
|
-
If user have more precise PWB, they can input their own PWB boundary as .shp and .gpkg format and need to assign the shapefile of the PWB and define directory as,
|
|
122
|
-
```bash
|
|
123
|
-
PWD_dir = Path('./path/to/PWB/vector/file')
|
|
124
|
-
```
|
|
125
|
-
#### **Methods for Extracting Flood Extents**
|
|
126
|
-
1. **```smallest_extent```**
|
|
127
|
-
The framework will first check all the raster extents (benchmark and FIMs). It will then determine the smallest among all the rasters. A shape file will then be created to mask all the rasters.
|
|
128
|
-
|
|
129
|
-
2. **```convex_hull```**
|
|
130
|
-
Another provision of determining flood extent is the generation of the minimum bounding polygon along the valid shapes. The framework will select the smallest raster extent followed by the generation of the valid vector shapes from the raster. It will then generate the convex hull (minimum bounding polygon along the valid shapes).
|
|
131
|
-
|
|
132
|
-
3. **```AOI```**
|
|
133
|
-
User can give input an already pre-defined flood extent vector file. This method will only be valid if user is working with their own evaluation boundary,
|
|
134
|
-
|
|
135
|
-
Depending upon user preference, they need to pass those method name as a argument while running the evaluation.
|
|
136
|
-
|
|
137
|
-
The FIM evaluation extent for ```smallest_extent``` and ```convex_hull``` can be seen in below **Figure 3** which is GIS layout version of an contengency map output of `EvaluateFIM` module defined in Table 1.
|
|
138
|
-
<div align="center">
|
|
139
|
-
<img width="600" alt="image" src="./Images/methodslayout.jpg">
|
|
140
|
-
</div>
|
|
141
|
-
Figure 3: Layout showing the difference between smallest extent and convex hull FIM extent and evaluation result.
|
|
142
|
-
|
|
143
|
-
Methods can be defined as follows.
|
|
144
|
-
```bash
|
|
145
|
-
method_name = "smallest_extent"
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
For the method 'AOI', user also need to pass the shapefile of the AOI along with method name as AOI.
|
|
149
|
-
```bash
|
|
150
|
-
#For AOI based FIM evaluation
|
|
151
|
-
method_name = "AOI"
|
|
152
|
-
AOI = Path('./path/to/AOI/vectorfile')
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
#### **Executing the Evaluation framework**
|
|
156
|
-
The complete description of different modules, what they are meant for, arguments taken to run that module and what will be the end results from each is described in below **Table 1**. If user import `fimeval` framework as `fp` into workflows, they can call each module mentioned in **Table 1** as `fp.Module_Name(args)`. Here arguments in italic represents the optional field, depending upon the user requirement.
|
|
157
|
-
|
|
158
|
-
Table 1: Modules in `fimeval` are in order of execution.
|
|
159
|
-
| Module Name | Objective | Arguments | Outputs |
|
|
160
|
-
|------------|-----------|-----------|-----------|
|
|
161
|
-
| `EvaluateFIM` | It runs all the evaluation of FIM between B-FIM and M-FIMs. | `main_dir`: Main directory containing the case study folders, <br> `method_name`: How users wants to evaluate their FIM, <br> `outpur_dir`: Output directory where all the results and the intermidiate files will be saved for further calculation, <br> *`PWB_dir`*: The permanenet water bodies vectory file directory if user wants to user their own boundary, <br> *`target_crs`*: this fimeval framework needs the floodmaps to be in projected CRS so define the projected CRS in epsg code format, <br> *`target_resolution`*: sometime if the benchmark is very high resolution than candidate FIMs, it needs heavy computational time, so user can define the resolution if there FIMs are in different spatial resolution, else it will use the coarser resolution among all FIMS within that case. |The outputs includes generated files in TIFF, SHP, CSV, and PNG formats, all stored within the output folder. Users can visualize the TIFF files using any geospatial platform. The TIFF files consist of the binary Benchmark-FIM (Benchmark.tif), Model-FIM (Candidate.tif), and Agreement-FIM (Contingency.tif). The shp files contain the boundary of the generated flood extent.|
|
|
162
|
-
| `PlotContingencyMap` | For better understanding, It will print the agreement maps derived in first step. | `main_dir`, `method_name`, `output_dir` : Based on the those arguments, once all the evaluation is done, it will dynamically get the corresponding contingency raster for printing.| This prints the contingency map showing different class of evaluation (TP, FP, no data, PWB etc). The outputs look like- Figure 4 first row.|
|
|
163
|
-
| `PlotEvaluationMetrics` | For quick understanding of the evaluation metrics, to plot bar of evaluation scores. | `main_dir`, `method_name`, `output_dir` : Based on the those arguments, once all the evaluation is done, it will dynamically get the corresponding file for printing based on all those info.| This prints the bar plots which includes different performance metrics calculated by EvaluateFIM module. The outputs look like- Figure 4 second row.|
|
|
164
|
-
| `EvaluationWithBuildingFootprint` | For Building Footprint Analysis, user can specify shapefile of building footprints as .shp or .gpkg format. By default it consider global Microsoft building footprint dataset. Those data are hosted in Google Earth Engine (GEE) so, It pops up to authenticate the GEE account, please allow it and it will download the data based on evaluation boundary and evaluation is done. | `main_dir`, `method_name`, `output_dir`: Those arguments are as it is, same as all other modules. <br> *`building_footprint`*: If user wants to use their own building footprint file then pass the directory here, *`country`*: It is the 3 letter based country ISO code (eg. 'USA', NEP' etc), for the building data automation using GEE based on the evaluation extent, *`shapefile_dir`*: this is the directory of user defined AOI if user is working with their own boundary and automatic Building footprint download and evaluation, *`geeprojectID`*: this is the google earth engine google cloud project ID, which helps to access the GEE data and resources to work with building footprint download and process. | It will calculate the different metrics (e.g. TP, FP, CSI, F1, Accuracy etc) based on hit and miss of building on different M-FIM and B-FIM. Those all metrics will be saved as CSV format in `output_dir` and finally using that info it prints the counts of building foorpint in each FIMs as well as scenario on the evaluation end via bar plot.|
|
|
165
|
-
|
|
166
|
-
<p align="center">
|
|
167
|
-
<img src="./Images/methodsresults_combined.jpg" width="750" />
|
|
168
|
-
</p>
|
|
169
|
-
|
|
170
|
-
Figure 4: Combined raw output from framework for different two method. First row (subplot a and b) and second row (subplot c and d) is contingency maps and evaluation metrics of FIM derived using `PrintContingencyMaP` and `PlotEvaluationMetrics` module. Third row (subplot e and f) is the output after processing and calculating of evaluation with BF by unsing `EvaluateWithBuildingFoorprint` module.
|
|
171
|
-
|
|
172
|
-
## Installation Instructions
|
|
173
|
-
|
|
174
|
-
### 1. Prerequisites
|
|
175
|
-
|
|
176
|
-
Before installing `fimeval`, ensure the following software are installed:
|
|
177
|
-
|
|
178
|
-
- **Python**: Version 3.10 or higher
|
|
179
|
-
- **Anaconda**: For managing environments and dependencies
|
|
180
|
-
- **GIS Software**: For Visulalisation
|
|
181
|
-
- [ArcGIS](https://www.esri.com/en-us/arcgis/products/index) or [QGIS](https://qgis.org/en/site/)
|
|
182
|
-
- **Optional**:
|
|
183
|
-
- [Google Earth Engine](https://earthengine.google.com/) account
|
|
184
|
-
- Java Runtime Environment (for using GEE API)
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
### 2. Install Anaconda
|
|
189
|
-
|
|
190
|
-
If Anaconda is not installed, download and install it from the [official website](https://www.anaconda.com/products/distribution).
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
### 3. Set Up Virtual Environment
|
|
195
|
-
|
|
196
|
-
#### For Mac Users
|
|
197
|
-
|
|
198
|
-
Open **Terminal** and run:
|
|
199
|
-
```bash
|
|
200
|
-
# Create a new environment named 'fimeval'
|
|
201
|
-
conda create --name fimeval python=3.10
|
|
202
|
-
|
|
203
|
-
# Activate the environment
|
|
204
|
-
conda activate fimeval
|
|
205
|
-
|
|
206
|
-
# Install fimeval package
|
|
207
|
-
pip install uv
|
|
208
|
-
uv pip install fimeval
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### Google Colab Version
|
|
212
|
-
|
|
213
|
-
To use fimeval in Google Colab, follow the steps below:
|
|
214
|
-
|
|
215
|
-
## Upload Files
|
|
216
|
-
Upload all necessary input files (e.g., raster, shapefiles, model outputs) to your Google Drive.
|
|
217
|
-
## Open Google Colab
|
|
218
|
-
Go to Google Colab and sign in with a valid Google account.
|
|
219
|
-
## Mount Google Drive
|
|
220
|
-
In a new Colab notebook, mount the Google Drive
|
|
221
|
-
```bash
|
|
222
|
-
pip install fimeval
|
|
223
|
-
```
|
|
224
|
-
### **Acknowledgements**
|
|
225
|
-
| | |
|
|
226
|
-
| --- | --- |
|
|
227
|
-
|  | 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.
|
|
228
|
-
|
|
229
|
-
### **For More Information**
|
|
230
|
-
Contact <a href="https://geography.ua.edu/people/sagy-cohen/" target="_blank">Sagy Cohen</a>
|
|
231
|
-
(sagy.cohen@ua.edu)
|
|
232
|
-
Dipsikha Devi, (ddevi@ua.edu)
|
|
233
|
-
Supath Dhital, (sdhital@crimson.ua.edu)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|