Last change
on this file since 919 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:
858 bytes
|
Line | |
---|
1 | #! /usr/bin/env python |
---|
2 | from ppclass import pp |
---|
3 | |
---|
4 | u = pp() |
---|
5 | u.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc" |
---|
6 | u.var = "u" |
---|
7 | u.t = "0.5,0.8" |
---|
8 | u.z = "10,20" |
---|
9 | u.getdefineplot(extraplot=2) # prepare 2 extraplots (do not show) |
---|
10 | u.p[0].proj = "ortho" |
---|
11 | u.p[0].title = "$u$ (m s$^{-1}$)" |
---|
12 | u.makeplot() |
---|
13 | |
---|
14 | v = pp() |
---|
15 | v << u # NB: initialize v object with u object's attributes |
---|
16 | v.var = "v" |
---|
17 | v.get() |
---|
18 | v.plotin = u # plotin must be defined before .defineplot() |
---|
19 | v.defineplot() |
---|
20 | v.p[1].proj = "ortho" |
---|
21 | v.p[1].title = "$v$ (m s$^{-1}$)" |
---|
22 | v.makeplot() # plot within the previous one (do not show) |
---|
23 | |
---|
24 | wind = u**2 + v**2 |
---|
25 | wind = wind**0.5 |
---|
26 | wind.plotin = v |
---|
27 | wind.defineplot() |
---|
28 | wind.p[2].title = "$\sqrt{u^2+v^2}$ (m s$^{-1}$)" |
---|
29 | wind.p[2].proj = "ortho" |
---|
30 | wind.makeplot() # plot within the previous one (show because complete) |
---|
31 | |
---|
32 | |
---|
33 | ## in this case it is not possible to make another plot afterwards... |
---|
34 | |
---|
Note: See
TracBrowser
for help on using the repository browser.