Last change
on this file since 923 was
923,
checked in by aslmd, 12 years ago
|
UTIL PYTHON planetoplot_v2
PPCLASS AND PPPLOT
- added global plot settings in pp() objects
- self is returned for each method to allow e.g. one-line get + attribution
- added labeling of 1D plots
- fine-tuning of plot appearance (e.g. vector key)
- corrected a problem with plotin (same object can be referred to all along)
- fixed meanarea for 1D requests
PP.PY
- no more -f for pp.py (files are simply given as arguments!)
- added missing options to pp.py
- nice informative header
PP_RELOAD.PY
- pp_reload.py can now change colorbars and 1D markers
EXAMPLES
- general update of examples + few additions
- added a nice example tide with mixed 2D+1D plots
|
-
Property svn:executable set to
*
|
File size:
1.2 KB
|
Line | |
---|
1 | #! /usr/bin/env python |
---|
2 | from ppclass import pp |
---|
3 | |
---|
4 | # define object, file, var |
---|
5 | m = pp() |
---|
6 | m.file = "/home/aymeric/Big_Data/GALE/wrfout_d03_2024-06-09_00:00:00" |
---|
7 | m.var = "W" |
---|
8 | |
---|
9 | # define dimensions |
---|
10 | m.x = "136.,139." # computing over x interval |
---|
11 | m.y = -5. # setting a fixed y value |
---|
12 | m.z = None # leaving z as a free dimension |
---|
13 | m.t = [6.,12.,18.,24.] # setting 4 fixed t values |
---|
14 | |
---|
15 | # define settings |
---|
16 | m.superpose = True # superpose 1D plots |
---|
17 | #m.verbose = True # making the programe verbose |
---|
18 | #m.out = "pdf" # output format |
---|
19 | |
---|
20 | # get data and make plot with default settings |
---|
21 | m.getplot() |
---|
22 | |
---|
23 | # get potential temperature at same point. |
---|
24 | # don't plot it. do an operation on it. |
---|
25 | tpot = pp() |
---|
26 | tpot << m |
---|
27 | tpot.var = "T" |
---|
28 | tpot.get() |
---|
29 | tpot = tpot + 220. |
---|
30 | |
---|
31 | # get geopotential at same point. |
---|
32 | # don't plot it. do an operation on it (to get height). |
---|
33 | geop = pp() |
---|
34 | geop << m |
---|
35 | geop.var = "PHTOT" |
---|
36 | geop.get() |
---|
37 | z = geop/3.72/1000. |
---|
38 | |
---|
39 | # define potential temperature as a function of height |
---|
40 | S = tpot.f(z) |
---|
41 | |
---|
42 | # change a few plot settings |
---|
43 | for curve in S.p: |
---|
44 | curve.lstyle = "--" |
---|
45 | curve.marker = "" |
---|
46 | S.p[0].swaplab = False |
---|
47 | S.p[0].ylabel="Geopotential height (km)" |
---|
48 | S.p[0].xlabel="Potential temperature (K)" |
---|
49 | S.filename = "meso_profile" |
---|
50 | |
---|
51 | # make the plot |
---|
52 | S.makeplot() |
---|
Note: See
TracBrowser
for help on using the repository browser.