Commit 55e975de authored by Tara Evaz Zadeh's avatar Tara Evaz Zadeh
Browse files

Modified README.md to match the updated losscalculator

parent 371de06e
Pipeline #37287 passed with stage
in 2 minutes and 1 second
......@@ -3,51 +3,73 @@
This program computes the probabilities of occurrence of damage states for scenario
earthquakes, given a ground-motion field, an exposure model representing the assets in the
region of interest and fragility functions that model the probability of exceeding different damage states given an intensity measure level.
For more information and input examples, please read the [manual](docs/manual.md).
## Requirements
## Prerequisites
* `python3`
* `pandas`
* `numpy`
* `scipy`
* `pyproj`
* `pygeotile`
* `shapely`
* `geopandas`
* `GDAL` header files. (can be installed with `apt-get install libgdal-dev`)
# How to install on Linux systems
Please clone the repository:
`git clone git@git.gfz-potsdam.de:dynamicexposure/globaldynamicexposure/loss-calculator.git`
Enter the local repository:
`cd loss-calculator`
Install the loss calculator:
`pip install .` or `pip3 install .`
## Usage
To run the program please call:
`python3 damage_calculator.py [OPTIONS] -c filepath -e filepath -f pathname -g filepath -p filepath -t filepath`
`losscalculator damage [OPTIONS] -e filepath -f pathname -g filepath -t filepath -w `
The execution command above is an example and could be changed to fit other available inputs and needs.
Please note that as of now this program only computes damage. Thus it can only be used with the command `damage` as shown above.
To check the version please exeure: `losscalculator --version`
### Required Parameters
`-c`, `--cell-ids=filepath`
Defines the filepath to the file with tile IDs.
`-c`, `--csv-directory=pathname`
Defines the file search pattern for fragility functions as CSV files (e.g. `pathname/*.csv`).
`-e`, `--exposure=filepath`
Defines the filepath to the exposure model file.
Defines the file path to the exposure model (only CSV or Spatialite database are allowed).
`-f`, `--fragilities=pathname`
`-f`, `--fragility-file=filepath`
Defines the pathname of the directory with all fragility-function files.
Defines the filepath to the XML fragility-function file.
`-g`, `--ground-motion-field=filepath`
Defines the filepath of the ground-motion field.
`-p`, `--geometry=filepath`
Defines the filepath of the polygon definitions.
Defines the file path of the ground-motion field file.
`-t`, `--taxonomy-map=filepath`
Defines the filepath to the taxonomy file.
File path of the file containing the mapping from complex taxonomy strings to the simpler taxonomy string as provided by the fragility functions. If not provided, taxonomy strings will be used as is requiring matching fragility functions.
### Optional Parameters
`-a`, `--aggregation`
Defines the type of the result aggregation. Options: [`no`, `building`, `tile`]. Default is `building`.
`no` provides detailed results, best used for debugging, and does not work with the output in Geopackage format. Options `building`/`tile` result in aggregation of the results per `building`/`tile`.
`-E`, `--exposure-format`
Defines format of the exposure model file. Options: [`spatialite`, `csv`]. Default is `csv`.
`-h`, `--help`
Provides information on the inputs and terminates the program.
......@@ -56,18 +78,35 @@ Provides information on the inputs and terminates the program.
Defines the method for interpolating ground-motion values. Default is `linear`.
`-o`, `--overwrite`
`-m`, `--intensity-measure-map=filepath`
If set, an existing result file will be overwritten, otherwise the program will terminate.
Defines the path to the file that maps the intensity-measure names in the ground-motion field file to the intensity-measure names used in the fragility functions. If not provided, a default set will be used
The default set is defined as follows:
`DEFAULT_INTENSITY_MEASURE_MAP = {
"SA(0.3)": "gmv_SA(0.3)",
"SA(0.6)": "gmv_SA(0.6)",
"SA(1.0)": "gmv_SA(1.0)",
"SA(1)": "gmv_SA(1.0)",
"PGA": "gmv_PGA",
"MMI": "gmv_MMI",
}`
`-o`, `--output-format`
Defines format of the result output, either Geopackage or CSV. Options: [`gpkg`, `csv`]. Default is `gpkg`.
Output to Geopackage only works WITHOUT option `-a`.
`-r`, `--results=filepath`
Defines the result filepath. Default is `damage_result.csv`.
Defines the result file path. Default is `damage_result.gpkg`.
`-s`, `--spatialite-extension=filepath`
`-x`, `--exposure-type={cell, building}`
Defines the file path of the Spatialite extension. Default is `mod_spatialite`.
Defines the exposure type. Default is `cell`.
`-w`, `--overwrite`
If set, an existing result file will be overwritten, otherwise the program will terminate.
## Copyright and copyleft
......@@ -79,7 +118,7 @@ This program is free software: you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment