Giter Site home page Giter Site logo

carloslizarragac / tephi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from scitools/tephi

0.0 2.0 0.0 4.57 MB

A package for plotting tephigrams of pressure, temperature and wind barb data.

Home Page: http://tephi.readthedocs.org

License: GNU Lesser General Public License v3.0

Python 100.00%

tephi's Introduction

tephi

Tephigram plotting in Python.

The tephi module provides plotting of tephigrams from ASCII text files.

A function is provided to load text files into a data structure that may be used for plotting tephigrams with tephi:

>>> import os.path
>>> import tephi
>>> winds = os.path.join(tephi.RESOURCES_DIR, 'barbs.txt')
>>> columns = ('pressure', 'dewpoint', 'wind_speed', 'wind_direction')
>>> barbs = tephi.loadtxt(winds, column_titles=columns)
>>> barbs
tephidata(
    pressure=array([ 1006.,   924.,   900.,   850.,   800.,   755.,   710.,   700.,
         600.,   500.,   470.,   459.,   400.,   300.,   250.], dtype=float32)
    dewpoint=array([ 26.39999962,  20.29999924,  19.79999924,  14.5       ,
        12.89999962,   8.30000019,  -5.        ,  -5.0999999 ,
       -11.19999981,  -8.30000019, -12.10000038, -12.5       ,
       -32.90000153, -46.        , -53.        ], dtype=float32)
    wind_speed=array([  0.,   1.,   5.,   5.,   7.,  10.,  12.,  15.,  25.,  35.,  40.,
        43.,  45.,  50.,  55.], dtype=float32)
    wind_direction=array([   0.,   15.,   25.,   30.,   60.,   90.,  105.,  120.,  180.,
        240.,  270.,  285.,  300.,  330.,  359.], dtype=float32))

These data structures can then be used to plot a tephigram:

>>> dews = zip(barbs.pressure, barbs.dewpoint)
>>> barb_vals = zip(barbs.wind_speed, barbs.wind_direction, barbs.pressure)
>>> tpg = tephi.Tephigram()
>>> profile = tpg.plot(dews)
>>> profile.barbs(barb_vals)
>>> plt.show()

tephi's People

Contributors

qulogic avatar dpeterk avatar bjlittle avatar esc24 avatar pelson avatar rhattersley avatar

Watchers

James Cloos avatar Carlos Lizarraga-Celaya 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.