Giter VIP home page Giter VIP logo

project's Introduction

Flood Risk Prediction tool

In environmental hazard assessment, risk is defined as the probability of a hazardous event occuring multiplied by the consequences of that event. Thus high risk can be the result of frequent events of low consequence or rare events of high consequence; the highest risk scenarios are often not obvious.

The Environment Agency routinely collects data on rainfall, sea level and river discharge and has published flooding probability maps that indicate areas of England that fall within four flood probability bands, based on the recurrence interval of flood levels that cause property damage and threat to life. These bands are very low probability (flooding expected once per 1000 years), low probability (flooding expected once per 100 years), medium probability (flooding expected once per 50 years), and high probability (flooding expected once per 10 years).

This tool calculates flood probabilities and risks for postcodes in England.

Installation Guide

To install the Tool, the user must run, in the command line, either:

python setup.py install

or

python setup.py install --user

User instructions

To use the Tool in command line:

  1. Open Python

  2. import assignment

  3. There are 4 functions to run in assignment (see table below for what each function achieves). To run a specific function, type:

    assignment.questionX(input)

    Where X is the number of the function you want to use and input is a list of postcodes (q1-3) or a date (q4).

Function list

question1(postcodes) : For a list of postcodes, this function returns a Dataframe of flood probabilities ordered from High to Zero, then by lexagraphic (dictionary) order on postcode. The index is named Postcode and the d data column is named Probability Band. Invalid postcodes and duplicates are removed.

question2(postcodes) : For a list of postcodes, this function returns a Dataframe of flood risks, ordered by risk, then by lexagraph (dictionary) order on the postcode. The index is named Postcode and the data column Flood Risk. Invalid postcodes and duplicates are removed.

question3(postcodes) : For a list of postcodes, this function returns a map of flood alerts at the location of the postcodes. Alerts will either be "Red" (High Warning), "Amber" (Medium Warning), Green (No warning) or will return "No data".

question4(postcodes) : For a list of postcodes, this function returns a bar chart of mean total rainfall in the North, Midlands, South East and South West regions of England for a specific date.

For information on what every function inside the assignment python module achieves, view the index.html from the Sphinx documentation (see 'Documentation section below).

Functions question3 and quesiton4 use Environment Agency rainfall data from the real-time data API (Beta).

Documentation

The code includes Sphinx documentation. On systems with Sphinx installed, this can be built by running

python -m sphinx docs html

then viewing the index.html file in the html directory in your browser.

For systems with LaTeX installed, a manual pdf can be generated by running

python -m sphinx  -b latex docs latex

Then following the instructions to process the FloodTool.tex file in the latex directory in your browser.

Testing

The tool includes several tests, which you can use to check its operation on your system. With [pytest installed, these can be run with

python -m pytest flood_tool
``

The current version also includes a speed scoring algorithm. This can be run with.

python -m score


in the main repository directory.

project's People

Contributors

zhangweilin1 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.