Last change
on this file since 960 was
960,
checked in by aslmd, 12 years ago
|
UTIL PYTHON planetoplot_v2. MAJOR: created an easy way to load a variable from a netcdf file, see easy_get_field.py [note: now to avoid confusion with .f attributes containing field, .f() method is named .func()] ; MINOR: generic units keyword, quiet mode, dummy xy axis when not given in ppplot, bug fixes for one-value 0D requests.
|
-
Property svn:executable set to
*
|
File size:
1.2 KB
|
Line | |
---|
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.func(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.func(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.func(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.filename="scatter" |
---|
53 | S3.makeplot() |
---|
54 | |
---|
55 | ## multidim scatter also possible |
---|
56 | ## the important thing is forcedimplot |
---|
57 | |
---|
58 | tsurf = pp() |
---|
59 | tsurf.file = "/home/aymeric/Big_Data/DATAPLOT/diagfired.nc" |
---|
60 | tsurf.var = "tsurf" |
---|
61 | tsurf.x = None |
---|
62 | tsurf.y = None |
---|
63 | tsurf.t = 2. |
---|
64 | tsurf.forcedimplot = 1 |
---|
65 | tsurf.getdefineplot() |
---|
66 | |
---|
67 | ps = pp() |
---|
68 | ps << tsurf |
---|
69 | ps.var = "ps" |
---|
70 | ps.getdefineplot() |
---|
71 | |
---|
72 | S = ps.func(tsurf) |
---|
73 | S.p[0].lstyle="" |
---|
74 | S.p[0].marker="h" |
---|
75 | S.p[0].color="g" |
---|
76 | S.makeplot() |
---|
Note: See
TracBrowser
for help on using the repository browser.