Skip to content
Cameron edited this page Dec 5, 2017 · 18 revisions

FlaPyDisaster

Hurricane modelling and mapping program written in Python and Flask, with Leaflet for mapping, implementing the NOAA NWS 23 parametric hurricane model. AkkaDisaster is a companion app for FlaPyDisaster. AkkaDisaster will implement the model calculations in Scala, using the play framework for an api, for better performance than the Python implementation.

ToDo

See the todo list here

Installation

Anaconda installation

Anaconda is recommended for setting up the python environment for this program. Everything targets Python 3.5, and everything should work on Windows and Linux. Everything will run on OSX as well, use the conda_requirements_darwin***.txt files to set up the Anaconda environment, but support will be sparse since I don't have a Mac to test with, only a virtual machine.

First, add the conda-forge channel using

conda config --add channels conda-forge

Then install from the appropriate requirements file using

conda install --file conda_requirements_XXXX.txt

Updating requirements

Explicit requirements files have specific web URLs for the conda packages, but have the possibility of breaking, especially on Windows. If this happens, install each package listed in top_level_requirements.txt, test the program to make sure everything works with new package versions, and generate a new conda_requirements.txt file for your platform by running

python generate_requirements.py

Once the file is generated, test with a new virtual environment and push it up to get merged.

Pip

Pip can also work, but its not supported right now because GDAL has dependency problems with pip. GDAL has to be installed on the host machine, and the gdal package will have to be replaced with pygdal. Note that these restrictions on GDAL might not matter when not using a virtual environment.

Example Workflow

An example workflow is here to test that everything is working correctly.

Development

IMPORTANT: To run in IDEs in windows with anaconda, the anaconda environment directory (ex: ...\Anaconda2\envs\EnvironmentName) must be included in PATH

It can either be included globally or as a setting in the IDE, doesn't really matter. Alternatively, activate the anaconda environment and run app.py, that will handle setting the PATH.

I've used both IntelliJ Idea and Visual Studio 2015 Community Edition with success, there shouldn't be anything preventing other IDEs though.

Documentation

Scala Calculation Server

There is a companion program for running calculations in Scala, AkkaDisaster. This is a Akka Http progam to run hurricane calculations separate from the application server. Early prototyping on my Intel i5 is showing that in Python:

  • Hurricane Matthew 2016 10px per degree, 3 processes, 9 minutes
  • Hurricane Matthew 2016 100px per degree, 3 processes, 2 hours

And for Scala:

  • For Matthew 2016 10px per degree, Scala at 2 cores runs in approximately 10 seconds
  • For Matthew 2016 100px per degree, Scala at 2 cores runs in approximately 6 min