GithubHelp home page GithubHelp logo

kyubisystems / pynameplot Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 640.08 MB

Read, analyse and plot results of Met Office Numerical Atmospheric-dispersion Modelling Environment (NAME) dispersion models.

License: Other

Python 99.32% Shell 0.68%
python science meteorology maps

pynameplot's Introduction

NAME file analysis and plotting software

(c)2017 J. Duncan Law-Green, Kyubi Systems

+++ SET UP ENVIRONMENT:

To set up the correct Python environment to run the NAME scripts

source ./setup.sh

The prompt will change to include '(venv.geo)'.

+++ SOFTWARE:

There are three main pieces of software available for NAME processing and analysis:

  • makemastergrid.py - given a list of ESRI shapefiles and an example NAME file, will computer a 'master grid file' listing covering factors for each square in the input NAME grid.

  • zonecsv.py - given a master grid file and a NAME file, or a directory containing NAME files, will calculate summed particle concentrations by zone, outputting a CSV file, one row per timestamp in the input name file(s).

  • plotter.py - given a configuration file, will plot an input NAME file (or a sum of multiple NAME files) on a map.

+++ COMMAND-LINE HELP:

Each software script has a simple help function which displays the options available on the command line, accessible by appending '-h' or '--help' to the script name, e.g.

./makemastergrid.py --help

+++ SHAPEFILE LIST:

In order to build a master grid file, the first step is to compile an input list of the input ESRI shapefiles used to denote the zones required. The shapefile list is a simple ASCII CSV file, with one row per ESRI zone, in the following format

/data/name/Python/Final_PML_shapefiles_04_05_17_new/Africa.shp, Tomato

The first element is the full path to the ESRI '.shp' shapefile, the second is the HTML colour desired for that zone on map plots.

A text file listing all .shp shapefiles in a given directory can be generated by the simple command:

ls /data/name/Python/Final_PML_shapefiles_04_05_17_new/*.shp > PML_shapefiles.example

+++ MAKEMASTERGRID

usage: makemastergrid [-h] -n NAMEFILE -s SHAPELIST -o OUTFILE

Generate master grid file from ESRI zones.

optional arguments: -h, --help show this help message and exit -n NAMEFILE, --namefile NAMEFILE Input NAME file to define grid shape -s SHAPELIST, --shapelist SHAPELIST File containing list of input shapefiles -o OUTFILE, --outfile OUTFILE Output master grid file name

+++ ZONECSV

usage: zonecsv [-h] (-d INDIR | -n NAMEFILE) -g GRID -o OUTFILE [-w WEEK | -m MONTH | -y YEAR]

Sum NAME concentration files over ESRI zones.

optional arguments: -h, --help show this help message and exit -d INDIR, --indir INDIR Input NAME file directory -n NAMEFILE, --namefile NAMEFILE Input NAME file to sum over -g GRID, --grid GRID Input master grid file -o OUTFILE, --outfile OUTFILE Output CSV results file -w WEEK, --week WEEK Select NAME files from ISO week number -m MONTH, --month MONTH Select NAME files from Month number -y YEAR, --year YEAR Select NAME files from Year

pynameplot's People

Contributors

kyubisystems avatar

Stargazers

 avatar

Watchers

 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.