Last change
on this file since 977 was
977,
checked in by aslmd, 12 years ago
|
UTIL PYTHON planetoplot_v2. Added rainbow spahetti plot based on an idea by Alizee. Simply set a colormap for a 1D plot and you get it. Also added in pp_reload (simple rainbow function in ppplot). Added also xmin and xmax capabilitiy. Fixed various bugs related to dummy axis, logarithmic axes. Removed time_counter from set_ppclass.txt it is useless in most cases.
|
-
Property svn:executable set to
*
|
File size:
1.3 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.,9.,12.,15.,18.,21.,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 | m.colorb = "spectral" # color cycle according to a color map |
---|
20 | |
---|
21 | # get data and make plot with default settings |
---|
22 | m.getplot() |
---|
23 | |
---|
24 | # get potential temperature at same point. |
---|
25 | # don't plot it. do an operation on it. |
---|
26 | tpot = pp() |
---|
27 | tpot << m |
---|
28 | tpot.var = "T" |
---|
29 | tpot.get() |
---|
30 | tpot = tpot + 220. |
---|
31 | |
---|
32 | # get geopotential at same point. |
---|
33 | # don't plot it. do an operation on it (to get height). |
---|
34 | geop = pp() |
---|
35 | geop << m |
---|
36 | geop.var = "PHTOT" |
---|
37 | geop.get() |
---|
38 | z = geop/3.72/1000. |
---|
39 | |
---|
40 | # define potential temperature as a function of height |
---|
41 | S = tpot.func(z) |
---|
42 | |
---|
43 | # change a few plot settings |
---|
44 | for curve in S.p: |
---|
45 | curve.lstyle = "--" |
---|
46 | curve.marker = "" |
---|
47 | S.p[0].swaplab = False |
---|
48 | S.p[0].ylabel="Geopotential height (km)" |
---|
49 | S.p[0].xlabel="Potential temperature (K)" |
---|
50 | S.filename = "meso_profile" |
---|
51 | S.colorb = None # come back to default color cycle |
---|
52 | |
---|
53 | # make the plot |
---|
54 | S.makeplot() |
---|
Note: See
TracBrowser
for help on using the repository browser.