FLEXPART Testing Environment CTBTO WO8
 All Classes Namespaces Files Functions Variables Pages
probe1.py
Go to the documentation of this file.
1 import pflexible as pf
2 import read_header as readh
3 import read_grid as readg
4 
5 import numpy as np
6 
7 #OUTPUT_DIR='../unittest_data/flexout_forward_tiny_complex_withnest'
8 #OUTPUT_DIR='../unittest_data/flexout_backward_tiny_complex_withnest'
9 OUTPUT_DIR='output'
10 TIME='20140924000000'
11 AGE_CLASS_NUM = 0
12 RELEASE_NUM = 0
13 SPEC_NUM = 0 # Indexed from 0. So, species 1 should be 0...
14 NEST=False
15 DRY=True
16 WET=True
17 
18 #H = pf.Header(OUTPUT_DIR)
19 H = readh.Header(OUTPUT_DIR, nested=NEST)
20 print H
21 
22 
23 '''
24 G = pf.read_grid(H, nspec_ret=SPEC_NUM,
25  age_ret=AGE_CLASS_NUM,
26  pspec_ret=RELEASE_NUM,
27  date=TIME)
28 '''
29 
30 
31 
32 G = readg.read_grid(H, nspec_ret=SPEC_NUM,
33  age_ret=AGE_CLASS_NUM,
34  pspec_ret=RELEASE_NUM,
35  date=TIME,
36  getdry=DRY,
37  getwet=WET)
38 '''
39 G = readg.read_grid(H, nspec_ret=SPEC_NUM,
40  age_ret=AGE_CLASS_NUM,
41  pspec_ret=RELEASE_NUM,
42  date=TIME)
43 '''
44 #print G
45 
46 print '==============================='
47 
48 '''
49 G = readg.read_grid(H,
50  date=TIME,
51  age_ret=AGE_CLASS_NUM,
52  nspec_ret=SPEC_NUM,
53  pspec_ret=RELEASE_NUM,
54  getwet=WET,
55  getdry=DRY,
56  )
57 '''
58 
59 the_grid = G[ (SPEC_NUM, TIME) ]
60 #print the_grid.grid
61 print 'Dry Grid'
62 print the_grid.dry.shape
63 print 'Nonzero elements: ', np.count_nonzero(the_grid.dry)
64 print the_grid['dry']
65 print '---------'
66 print 'Wet Grid'
67 print the_grid.wet.shape
68 print 'Nonzero elements: ', np.count_nonzero(the_grid.wet)
69 print the_grid['wet']
70 print '---------'
71 
72 
73