Table of Contents
This tool was developed as a trigger mechanism for the typhoon Early action protocol of the Philippines Red Cross FbF project. The model will predict the potential damage of a typhoon before landfall, and the prediction will be percentage of completely damaged houses per municipality. The tool is available under the GPL license
To run the operational pipeline, you need access to an Data.zip, and credentiials for 510 Datalake and FTP server. If you or your organization is interested in using the pipeline,
please contact 510 Global to obtain the credentials. update the file secrets_template
based on the credentials and save it assecrets
.
- Clone the repo
- Change
/IBF-Typhoon-model/src/settings.py.template
tosettings.py
and fill in the necessary username/passwords. - Download data.zip from sharepoint and unzip in under /IBF-Typhoon-model
- Install Docker-compose follow this link
- Start Docker and make sure WSL 2 based engine is enabled in docker. check “Use the WSL 2 based engine” under Settings--> “General” and did “Apply & Restart”
You will need to have docker
and docker-compose
installed.
You need to create an environment variable called TYPHOONMODEL_OUTPUT
that contains
the path to where you would like the model run output data to go.
To build and run the image, ensure you are in the top-level directory and execute:
docker-compose up --build
When you are finished, runing run the following command to stop containers and remove containers, networks, volumes, and images created by 'up' .
docker-compose down
you can also define how you want to run the model in docker-compose.yml file by passing options to the command run-typhoon-model [OPTIONS]
Options:
--path TEXT main directory defult
--remote_directory TEXT remote directory
--typhoonname TEXT name for active typhoon
```
if you don define an option the defult run will be if there is an active typhoon in the PAR polygon the model will run for the active typhoons,
unless you specify a remote directory and typhoon name under options.
Here you can find a guideline, a Jupyter Notebook Tutorial. Folow the step in this page to understand the workflow used to build the model
This will be running inside the docker container
Excute:
docker run -it -p 8888:8888 rodekruis510/typhoonmodel
Pressing Ctrl-C twice shuts down the notebook server
yyou can stop the not
The main code for the pipeline is IBF-Typhoon-model/src/
, which can in principle be run locally,
however we do recommend using Docker if you can.
To run locally:
- Enter the
IBF-Typhoon-model
directory and install the required Python packages, as well as thetyphoonmodel
package:pip install -r requirements.pip pip install .
- Install all packages listed at the top of the R script
run_model_v2.R
. - Ensure that all the parameters from the
secrets
file have been exported as environment variables - Execute:
When there is an active typhoon in the PAR polygon the model will run for the active typhoons, unless you specify a remote directory and typhoon name.
run-typhoon-model [OPTIONS] Options: --path TEXT main directory defult --remote_directory TEXT remote directory --typhoonname TEXT name for active typhoon