Last change
on this file since 921 was
910,
checked in by aslmd, 12 years ago
|
PLANETOPLOT v2
- Spiga LMD/UPMC 24/03/2013
Contents
core
- ppclass.py --> main class with pp() objects (need ppplot and ppcompute)
- ppplot.py --> plot class (can be used independently, need ppcompute)
- ppcompute.py --> computation class (can be used independently)
scripts
- pp.py --> command line utility to use ppclass
- pp_reload.py --> command line utility to load saved plot objects *.ppobj
- example/* --> example scripts using ppclass
settings files
- set_area.txt --> setting file: predefined areas for plotting (can be omitted)
- set_back.txt --> setting file: predefined backgrounds for plotting (can be omitted)
- set_multiplot.txt --> setting file: predefined coefficients for multiplots (can be omitted)
- set_ppclass.txt --> setting file: predefined variables for x,y,z,t (can be omitted)
- set_var.txt --> setting file: predefined colorbars, format, labels, etc... for variables (can be omitted)
documentation
- README.TXT --> this README file
data
- demo_data/* --> plot objects for a demonstration tour and customizing tests
Requirements
python + numpy + matplotlib + netCDF4
- for mapping --> Basemap
- for scientific computations --> scipy
[recommended: Enthought Python Distribution (free for academics)]
Installation
- install required softwares and librairies in requirements
- add planetoplot_v2 in your PYTHONPATH environment variable (and in your PATH to use pp.py)
Take a demo tour
pp_reload.py demo_data/*
Improvements compared to v1
- code readability and structuration for future improvements
- modularity (class formulation)
+ easy definition/addition of attributes
- separation between data retrieval and plotting
- versatility
+ command line (pp.py)
--> for quick inspection
+ interactive session (ipython)
--> for testing and exploring
+ scripts
--> for powerful and fully customized results
- performance (overall and on large files)
+ memory consumption (only retrieve what is needed)
- saving/loading plot objects in/from *.ppobj
- plot aesthetics and customizing (see header in ppplot)
- multiplot flexibility with .plotin attribute
- easy definition of presets with set_*.txt files
- function: one field vs. another one
- emulation of + - / * operations on fields
(between two fields or between a field and a int/float)
- computations of min/max in addition to mean
- simple inspection of dimensions+variables in a file (pp.py -f file)
- verbose / non verbose mode
Acknowledgements
Thanks to A. Colaitis, T. Navarro, J. Leconte
for feedbacks and contributions on version 1
|
-
Property svn:executable set to
*
|
File size:
1.1 KB
|
Rev | Line | |
---|
[910] | 1 | #! /usr/bin/env python |
---|
| 2 | from ppclass import pp |
---|
| 3 | |
---|
| 4 | tsurf = pp() |
---|
| 5 | tsurf.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc" |
---|
| 6 | tsurf.var = "tsurf" |
---|
| 7 | tsurf.x = None |
---|
| 8 | tsurf.y = 10. |
---|
| 9 | tsurf.t = 2. |
---|
| 10 | tsurf.getdefineplot() |
---|
| 11 | |
---|
| 12 | ps = pp() |
---|
| 13 | ps << tsurf |
---|
| 14 | ps.var = "ps" |
---|
| 15 | ps.getdefineplot() |
---|
| 16 | |
---|
| 17 | S = ps.f(tsurf) |
---|
| 18 | S.p[0].lstyle="" |
---|
| 19 | S.p[0].marker="h" |
---|
| 20 | S.p[0].color="g" |
---|
| 21 | S.makeplot() |
---|
| 22 | |
---|
| 23 | icetot = pp() |
---|
| 24 | icetot << tsurf |
---|
| 25 | icetot.var = "icetot" |
---|
| 26 | icetot.getdefineplot() |
---|
| 27 | |
---|
| 28 | S2 = icetot.f(tsurf) |
---|
| 29 | S2.p[0].lstyle="" |
---|
| 30 | S2.p[0].marker="D" |
---|
| 31 | S2.p[0].color="r" |
---|
| 32 | S2.makeplot() |
---|
| 33 | |
---|
| 34 | u = pp() |
---|
| 35 | u << tsurf |
---|
| 36 | u.var = "u" |
---|
| 37 | u.z = 1. |
---|
| 38 | u.get() |
---|
| 39 | |
---|
| 40 | v = pp() |
---|
| 41 | v << u |
---|
| 42 | v.var = "v" |
---|
| 43 | v.get() |
---|
| 44 | |
---|
| 45 | wind = u**2 + v**2 |
---|
| 46 | wind = wind**0.5 |
---|
| 47 | S3 = wind.f(ps) |
---|
| 48 | S3.p[0].lstyle="" |
---|
| 49 | S3.p[0].marker="o" |
---|
| 50 | S3.p[0].color="k" |
---|
| 51 | S3.p[0].ylabel="wind speed $\sqrt{u^{2}+v^{2}}$ (m s$^{-1}$)" |
---|
| 52 | S3.makeplot() |
---|
| 53 | |
---|
| 54 | ## multidim scatter also possible |
---|
| 55 | ## the important thing is forcedimplot |
---|
| 56 | |
---|
| 57 | tsurf = pp() |
---|
| 58 | tsurf.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc" |
---|
| 59 | tsurf.var = "tsurf" |
---|
| 60 | tsurf.x = None |
---|
| 61 | tsurf.y = None |
---|
| 62 | tsurf.t = 2. |
---|
| 63 | tsurf.forcedimplot = 1 |
---|
| 64 | tsurf.getdefineplot() |
---|
| 65 | |
---|
| 66 | ps = pp() |
---|
| 67 | ps << tsurf |
---|
| 68 | ps.var = "ps" |
---|
| 69 | ps.getdefineplot() |
---|
| 70 | |
---|
| 71 | S = ps.f(tsurf) |
---|
| 72 | S.p[0].lstyle="" |
---|
| 73 | S.p[0].marker="h" |
---|
| 74 | S.p[0].color="g" |
---|
| 75 | S.makeplot() |
---|
Note: See
TracBrowser
for help on using the repository browser.