fimeval 0.1.52__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.
@@ -0,0 +1,17 @@
1
+ fimeval/__init__.py,sha256=HZJKq7XEhL6TnwFkhpf8NcEQ5h7zPQ3XJh3z5gF0gQ8,603
2
+ fimeval/utilis.py,sha256=JYpWTJx3WOuC0wRr3nb-cwMPf0SAGIli5dJdKFS23w8,6954
3
+ fimeval/BuildingFootprint/__init__.py,sha256=oP9YWLdo6ANzSQFxYLv7Ku_26AY5NkLNhZLK28ICMLo,109
4
+ fimeval/BuildingFootprint/evaluationwithBF.py,sha256=2QBYbuJg98B5_PKDLnmV7M1dDVuOkJd6_rP0EdmoF-8,15645
5
+ fimeval/BuildingFootprint/microsoftBF.py,sha256=73M_e_n_3lsejsnP9eX06hou0sr2-yaWdjuoUwZ8O2Y,4063
6
+ fimeval/ContingencyMap/PWBs3.py,sha256=UFICxO58c2fA9mIffH4ooqphv3ZXe6yX8QzpRjtI6fs,1275
7
+ fimeval/ContingencyMap/__init__.py,sha256=ckps2dyg6aci3TA-3P7oTMcCAcSTz9AA6sndHtZEwdE,259
8
+ fimeval/ContingencyMap/evaluationFIM.py,sha256=JiQfXiiQXZd5T4PBqEyU567PHGaEXr8RUsnGmWQxzjc,17390
9
+ fimeval/ContingencyMap/methods.py,sha256=kbutfo9FUH-yjvnOXxwLpdErUuebMJ8NjCroNWIYCjo,3299
10
+ fimeval/ContingencyMap/metrics.py,sha256=jwOia0Nl7aU7AuGJFAcQ4fVENnp2G_5W6JSJBzo1-_4,1094
11
+ fimeval/ContingencyMap/plotevaluationmetrics.py,sha256=3bKfPKZnMR39dA3teDVpQBeTFKnF9v_2Vku0JNVGggs,3921
12
+ fimeval/ContingencyMap/printcontingency.py,sha256=-1H_Ze2TbRSER7vy7bd0HvxnziNzPPOIPOm2YhB7r4A,5422
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,4 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 1.9.1
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ fimeval
@@ -1,23 +0,0 @@
1
- #!/bin/bash
2
-
3
- DIR="$1"
4
-
5
- if [ -z "$DIR" ]; then
6
- echo "No directory provided."
7
- exit 1
8
- fi
9
- echo "Fixing permissions for: $DIR"
10
-
11
- UNAME=$(uname)
12
- if [[ "$UNAME" == "Darwin" || "$UNAME" == "Linux" ]]; then
13
- chmod -R u+rwX "$DIR"
14
- echo "Permissions granted for user (u+rwX)"
15
-
16
- elif [[ "$UNAME" == *"MINGW"* || "$UNAME" == *"MSYS"* || "$UNAME" == *"CYGWIN"* ]]; then
17
- icacls "$DIR" /grant Everyone:F /T > /dev/null
18
- echo "Permissions granted for working folder"
19
-
20
- else
21
- echo "Unsupported OS: $UNAME"
22
- exit 1
23
- fi
@@ -1,184 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: fimeval
3
- Version: 0.1.52
4
- Summary: A Framework for Automatic Evaluation of Flood Inundation Mapping Predictions Evaluation
5
- License: GPLv3
6
- Author: Surface Dynamics Modeling Lab
7
- Maintainer: Supath Dhital
8
- Maintainer-email: sdhital@crimson.ua.edu
9
- Requires-Python: >=3.10,<4.0
10
- Classifier: License :: Other/Proprietary License
11
- Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.10
13
- Classifier: Programming Language :: Python :: 3.11
14
- Classifier: Programming Language :: Python :: 3.12
15
- Classifier: Programming Language :: Python :: 3.13
16
- Requires-Dist: boto3 (>=1.36.16,<2.0.0)
17
- Requires-Dist: geopandas (>=1.0.1,<2.0.0)
18
- Requires-Dist: kaleido (==0.2.1)
19
- Requires-Dist: matplotlib (>=3.9.2,<4.0.0)
20
- Requires-Dist: msfootprint (>=0.1.27,<0.2.0)
21
- Requires-Dist: nbformat (>=5.10.4,<6.0.0)
22
- Requires-Dist: notebook (>=7.3.2,<8.0.0)
23
- Requires-Dist: numpy (<2)
24
- Requires-Dist: pathlib (>=1.0.1,<2.0.0)
25
- Requires-Dist: plotly (>=5.24.1,<6.0.0)
26
- Requires-Dist: pyproj (>=3.7.0,<4.0.0)
27
- Requires-Dist: pytest (>=8.3.3,<9.0.0)
28
- Requires-Dist: rasterio (>=1.4.2,<2.0.0)
29
- Requires-Dist: shapely (>=2.0.6,<3.0.0)
30
- Description-Content-Type: text/markdown
31
-
32
- ## Flood Inundation Mapping Predictions Evaluation Framework (FIMeval)
33
- <hr style="border: 1px solid black; margin: 0;">
34
-
35
- [![Version](https://img.shields.io/github/v/release/sdmlua/fimeval)](https://github.com/sdmlua/fimeval/releases)
36
- [![Issues](https://img.shields.io/github/issues/sdmlua/fimeval)](https://github.com/sdmlua/fimeval/issues)
37
- [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://opensource.org/licenses/GPL-3.0)
38
- [![PyPI version](https://badge.fury.io/py/fimeval.svg?icon=si%3Apython)](https://badge.fury.io/py/fimeval)
39
- [![PyPI Downloads](https://static.pepy.tech/badge/fimeval)](https://pepy.tech/projects/fimeval)
40
-
41
- | | |
42
- | --- | --- |
43
- | <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.
44
-
45
-
46
- ### **Background**
47
- <hr style="border: 1px solid black; margin: 0;">
48
-
49
- 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.
50
-
51
- 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.
52
-
53
-
54
-
55
- ### **Repository structure**
56
- <hr style="border: 1px solid black; margin: 0;">
57
-
58
- 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.
59
- ```bash
60
- fimeval/
61
- ├── docs/ # Documentation (contains 'FIMserv' Tool usage sample codes)
62
- │ └── sampledata/ # Contains the sample data to demonstrate how this frameworks works
63
- │ └── fimeval_usage.ipynb #Sample code usage of the Evaluation framework
64
- ├── Images/ # have sample images for documentation
65
- ├── src/
66
- │ └── fimeval/
67
- │ ├──BuildingFootprint/ # Contains the evaluation of model predicted FIM with microsoft building footprint
68
- │ │ └── evaluationwithBF.py
69
- │ └── ContingencyMap/ # Contains all the metrics calculation and contingency map generation
70
- │ │ ├── evaluationFIM.py # main evaluation moodule
71
- │ │ └── methods.py # Contains 3 different methods of evaluation
72
- │ │ └── metrics.py # metrics calculation module
73
- │ │ └── plotevaluationmetrics.py # use to vizualize the different performance metrics
74
- │ │ └── printcontingency.py # prints the contingency map to quickly generate the Map layout
75
- │ │ └── PWBs3.py # module which helps to get permanent water bodies from s3 bucket
76
- │ └── utilis.py #Includes the resampling and reprojection of FIMs
77
- └── tests/ # Includes test cases for different functionality
78
- ```
79
- 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.
80
-
81
- <div align="center">
82
- <img width="900" alt="image" src="./Images/flowchart.jpg">
83
- </div>
84
- Figure 1: Flowchart showing the entire framework pipeline.
85
-
86
- ### **Framework Installation and Usage**
87
- <hr style="border: 1px solid black; margin: 0;">
88
-
89
- 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:
90
-
91
- ```bash
92
- #Install to use this framework
93
- pip install fimeval
94
-
95
- #Use this framework in your workflows using poetry
96
- poetry add fimeval
97
- ```
98
- Import the package to the jupyter notebook or any python IDE.
99
-
100
- ```bash
101
- #Import the package
102
- import fimeval as fp
103
- ```
104
- **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.
105
-
106
- #### **Main Directory Structure**
107
- 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)
108
- in tif format.
109
- 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.
110
- <div align="center">
111
- <img width="350" alt="image" src="./Images/directorystructure.png">
112
- </div>
113
- Figure 2: Main directory structure for one and multiple case study.
114
-
115
- This directory can be defined as follows while running framework.
116
- ```bash
117
- main_dir = Path('./path/to/main/dir')
118
- ```
119
-
120
- #### **Permanent Water Bodies (PWB)**
121
- 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
122
-
123
- 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,
124
- ```bash
125
- PWD_dir = Path('./path/to/PWB/vector/file')
126
- ```
127
- #### **Methods for Extracting Flood Extents**
128
- 1. **```smallest_extent```**
129
- 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.
130
-
131
- 2. **```convex_hull```**
132
- 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).
133
-
134
- 3. **```AOI```**
135
- 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,
136
-
137
- Depending upon user preference, they need to pass those method name as a argument while running the evaluation.
138
-
139
- 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.
140
- <div align="center">
141
- <img width="600" alt="image" src="./Images/methodslayout.jpg">
142
- </div>
143
- Figure 3: Layout showing the difference between smallest extent and convex hull FIM extent and evaluation result.
144
-
145
- Methods can be defined as follows.
146
- ```bash
147
- method_name = "smallest_extent"
148
- ```
149
-
150
- For the method 'AOI', user also need to pass the shapefile of the AOI along with method name as AOI.
151
- ```bash
152
- #For AOI based FIM evaluation
153
- method_name = "AOI"
154
- AOI = Path('./path/to/AOI/vectorfile')
155
- ```
156
-
157
- #### **Executing the Evaluation framework**
158
- 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.
159
-
160
- Table 1: Modules in `fimeval` are in order of execution.
161
- | Module Name | Objective | Arguments | Outputs |
162
- |------------|-----------|-----------|-----------|
163
- | `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.|
164
- | `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.|
165
- | `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.|
166
- | `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. | 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.|
167
-
168
- <p align="center">
169
- <img src="./Images/methodsresults_combined.jpg" width="750" />
170
- </p>
171
-
172
- 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.
173
-
174
- ### **Acknowledgements**
175
- | | |
176
- | --- | --- |
177
- | ![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.
178
-
179
- ### **For More Information**
180
- Contact <a href="https://geography.ua.edu/people/sagy-cohen/" target="_blank">Sagy Cohen</a>
181
- (sagy.cohen@ua.edu)
182
- Dipsikha Devi, (ddevi@ua.edu)
183
- Supath Dhital, (sdhital@crimson.ua.edu)
184
-
@@ -1,16 +0,0 @@
1
- fimeval/BuildingFootprint/__init__.py,sha256=oP9YWLdo6ANzSQFxYLv7Ku_26AY5NkLNhZLK28ICMLo,109
2
- fimeval/BuildingFootprint/evaluationwithBF.py,sha256=mnmcfyNPL_XBg9fIDXJjBWsRDKlCZ8HPjIhzCiFJkb8,14352
3
- fimeval/ContingencyMap/PWBs3.py,sha256=YAg03jzdplYIstG-pZM1MECse7gYjWrJNKAopjgt3uk,1294
4
- fimeval/ContingencyMap/__init__.py,sha256=ckps2dyg6aci3TA-3P7oTMcCAcSTz9AA6sndHtZEwdE,259
5
- fimeval/ContingencyMap/evaluationFIM.py,sha256=F9hI1N0AhBFZhGIimfkIK4MsbHborAyjmPiZ95mFZZE,16828
6
- fimeval/ContingencyMap/fix_permissions.sh,sha256=prIeJGXwAUO28nhgtCtvcpOxWK-J75rxN4FQ6QjGET4,508
7
- fimeval/ContingencyMap/methods.py,sha256=kbutfo9FUH-yjvnOXxwLpdErUuebMJ8NjCroNWIYCjo,3299
8
- fimeval/ContingencyMap/metrics.py,sha256=eEv1zAfmIjyg9OWM1b6-i25q_3jEBmeLZ7JeuvxS1QI,1070
9
- fimeval/ContingencyMap/plotevaluationmetrics.py,sha256=3bKfPKZnMR39dA3teDVpQBeTFKnF9v_2Vku0JNVGggs,3921
10
- fimeval/ContingencyMap/printcontingency.py,sha256=Ef0TlGNxvLlrliM2SCkhusgz9BsEGvVOBHAO62YC_QA,5421
11
- fimeval/__init__.py,sha256=kN114EvzG_BFjd65fKWXg29TqaWvR173EdCN3yj30oc,433
12
- fimeval/utilis.py,sha256=Cueji5DWGAaXTGCcQmkVaHGpIJeIIMNOuq_1KUKM2oA,6920
13
- fimeval-0.1.52.dist-info/LICENSE.txt,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
14
- fimeval-0.1.52.dist-info/METADATA,sha256=JojzN5T77mRJveolF1lYAJlnKpqDhieHwbwE-hbWF4I,14848
15
- fimeval-0.1.52.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
16
- fimeval-0.1.52.dist-info/RECORD,,