1
2
3
4 from Timba.TDL import *
5 from Timba.Meq import meq
6 from Timba.Meq import meqds
7 from numarray import *
8
9
10
11 Settings.forest_state.cache_policy = 100;
12
13 def _define_forest (ns):
14 """define_forest() is a standard TDL name. When a forest script is
15 loaded by, e.g., the browser, this method is automatically called to
16 define the forest. The 'ns' argument is a NodeScope object in which
17 the forest is to be defined, usually this is simply the global scope.
18 """;
19
20
21
22 ra = 0.0
23 dec = 0.57595865
24 ns.ra0 << Meq.Parm(ra,node_groups='Parm')
25 ns.dec0 << Meq.Parm(dec,node_groups='Parm')
26
27
28 ns.RADec <<Meq.Composer(ns.ra0, ns.dec0)
29
30
31
32
33 X_pos = -1597262.96
34 Y_pos = -5043205.54
35 Z_pos = 3554901.34
36 ns.x_pos << Meq.Parm(X_pos,node_groups='Parm')
37 ns.y_pos << Meq.Parm(Y_pos,node_groups='Parm')
38 ns.z_pos << Meq.Parm(Z_pos,node_groups='Parm')
39
40
41 ns.XYZ <<Meq.Composer(ns.x_pos, ns.y_pos, ns.z_pos)
42
43
44 ns.AzEl << Meq.AzEl(radec=ns.RADec, xyz=ns.XYZ)
45
46
47 ns.AzEl1 << Meq.AzEl(radec=ns.RADec, observatory='VLA')
48
49
50 ns.reqseq <<Meq.ReqSeq(ns.AzEl,ns.AzEl1)
51
52 def _test_forest (mqs,parent):
53 """test_forest() is a standard TDL name. When a forest script is
54 loaded by, e.g., the browser, and the "test" option is set to true,
55 this method is automatically called after define_forest() to run a
56 test on the forest. The 'mqs' argument is a meqserver proxy object.
57 """;
58
59
60
61
62 t0 = 0.01;
63 t1 = 86400.01;
64
65
66 f1 = 299792458.0;
67 f0 = 0.9*f1;
68
69
70
71
72 cells = meq.cells(meq.domain(f0,f1,t0,t1),num_freq=1,num_time=120);
73
74
75 request = meq.request(cells,rqtype='e1')
76
77
78 a = mqs.meq('Node.Execute',record(name='reqseq',request=request),wait=True);
79
80
81
82 if __name__ == '__main__':
83 Timba.TDL._dbg.set_verbose(5);
84 ns = NodeScope();
85 _define_forest(ns);
86
87 ns.Resolve();