Last change
on this file since 930 was
930,
checked in by aslmd, 12 years ago
|
UTIL PYTHON planetoplot_v2. Added attribute allfield so that the user can easily access values. See examples/easy_get_field.py. Added attribute includedate to select option for naming files. Corrected index bug in meanarea mode. Added an example intercompare.py which shows how to easily compare results in two quite different netCDF files.
|
-
Property svn:executable set to
*
|
File size:
939 bytes
|
Line | |
---|
1 | #! /usr/bin/env python |
---|
2 | from ppclass import pp |
---|
3 | import numpy as np |
---|
4 | import matplotlib.pyplot as mpl |
---|
5 | |
---|
6 | test = pp() |
---|
7 | test.file = [ \ |
---|
8 | "/planeto/jllmd/Earth/Nmix/F1525/output/diagfi4.nc", \ |
---|
9 | "/planeto/jllmd/Earth/Nmix/F1550/output/diagfi4.nc", \ |
---|
10 | "/planeto/jllmd/Earth/Nmix/F1500/output/diagfi4.nc" ] |
---|
11 | test.var = ["tsurf","ASR"] |
---|
12 | test.x = "-180.,175." |
---|
13 | test.y = "-90.,90." |
---|
14 | test.t = "0,1000" |
---|
15 | #test.verbose = True |
---|
16 | test.compute = "meanarea" |
---|
17 | test.get() |
---|
18 | |
---|
19 | # ----------------------------- |
---|
20 | # self.allfield contains data ! |
---|
21 | # ----------------------------- |
---|
22 | # index ordering: |
---|
23 | # - file |
---|
24 | # - var |
---|
25 | # - request t |
---|
26 | # - request z |
---|
27 | # - request y |
---|
28 | # - request x |
---|
29 | # - field dimensions |
---|
30 | # ----------------------------- |
---|
31 | # ALL DIM == 1 HAVE BEEN SQUEEZED |
---|
32 | # ----------------------------- |
---|
33 | |
---|
34 | # for instance here, shape of allfield is (3,2) |
---|
35 | # because the user requested 3 files, 2 vars, 0D values |
---|
36 | |
---|
37 | tsurf = test.allfield[:,0] |
---|
38 | asr = test.allfield[:,1] |
---|
39 | |
---|
40 | mpl.plot(tsurf,asr) |
---|
41 | mpl.show() |
---|
Note: See
TracBrowser
for help on using the repository browser.