Ticket #228: scantable_behaviour

File scantable_behaviour, 4.0 KB (added by kuiper@…, 13 years ago)

more detailed description with asap outputs

Line 
1It appears that asap has some way of marking scans as bad not
2and including them in the summary.  However, the scans are in the
3scantable.  From a 50 row SDFITS bintable::
4
5In [1]: len(s_table.get_sourcename())
6Out[1]: 50
7
8In [2]: np.array(s_table.get_sourcename())
9Out[2]:
10array(['n159 D', 'n159 D', 'G309.92', 'N159 C', 'N159 C', 'N159 C',
11    'N159 C', 'N159 C', 'N159 C', 'N159 A', '0637-752', '0637-752',
12    '0637-752', '0637-752', 'G309.92', 'G309.92', 'G309.92', 'G309.92',
13    '1226+023', 'G339.88', 'G339.88', 'G339.88', 'G339.88', 'G188.95',
14    'G188.95', 'G188.95', 'G323.74', 'G323.74', 'SGR B2', 'SGR B2',
15    'SGR B2', 'SGR B2', 'G1.6', 'G1.6', 'G1.6', 'G1.6', 'SGR AB',
16    'SGR AB', 'SGR A 2E0N', 'Sgr A meth pk1', 'Sgr A meth pk1', '30dor',
17    'lmc-co-1', 'lmc-co-1', 'lmc-co-1', 'lmc-co-1', 'lmc-co-1',
18    'lmc-co-1', 'lmc-co-1', 'lmc-co-1'],
19    dtype='|S14')
20
21In [3]: s_table.data.field('OBJECT')
22Out[3]:
23chararray(['n159 D', 'n159 D', 'G309.92', 'N159 C', 'N159 C', 'N159 C',
24    'N159 C', 'N159 C', 'N159 C', 'N159 A', '0637-752', '0637-752',
25    '0637-752', '0637-752', 'G309.92', 'G309.92', 'G309.92', 'G309.92',
26    '1226+023', 'G339.88', 'G339.88', 'G339.88', 'G339.88', 'G188.95',
27    'G188.95', 'G188.95', 'G323.74', 'G323.74', 'SGR B2', 'SGR B2',
28    'SGR B2', 'SGR B2', 'G1.6', 'G1.6', 'G1.6', 'G1.6', 'SGR AB',
29    'SGR AB', 'SGR A 2E0N', 'Sgr A meth pk1', 'Sgr A meth pk1', '30dor',
30    'lmc-co-1', 'lmc-co-1', 'lmc-co-1', 'lmc-co-1', 'lmc-co-1',
31    'lmc-co-1', 'lmc-co-1', 'lmc-co-1'],
32    dtype='|S16')
33
34So the scantable.get_sourcename() agrees with the SDFITS extension.
35Likewise, the other gets give the right number of values::
36
37In [7]: len(s_table.get_azimuth())
38Out[7]: 50
39
40In [8]: len(s_table.get_direction())
41Out[8]: 50
42
43In [9]: len(s_table.get_inttime())
44Out[9]: 50
45
46In [10]: len(s_table.get_time())
47Out[10]: 50
48
49In [11]: len(s_table.get_tsys())
50Out[11]: 50
51
52In [12]: len(s_table.getscannos())
53Out[12]: 45
54
55In [16]: np.array(s_table.getscannos())
56Out[16]:
57array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,
58       10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
59       20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
60       30, 31, 32, 33, 34,                 39,
61       43, 44, 45, 46, 47, 48, 49,
62       50, 51])
63
64In [18]: s35 = s_table.get_scan([35])
65Couldn't find any match.
66
67In [19]: s51 = s_table.get_scan([51])
68
69In [20]:
70
71These absent scans cannot be extracted and are missing from
72s_table.summary().  Also, there are fanthom scan numbers in
73the sense that 50 scans counted from 0 should end at 49.
74So we can't use the above scan numbers to index into the arrays
75of the scantable.
76
77Here's the clue::
78
79In [22]: for i in s_table.getscannos():
80....:       s = s_table.get_scan([i])
81....:       print i, s.get_sourcename()
82....:
830 ['n159 D']
841 ['n159 D']
852 ['G309.92']
863 ['N159 C']
874 ['N159 C']
885 ['N159 C']
896 ['N159 C']
907 ['N159 C']
918 ['N159 C']
929 ['N159 A']
9310 ['0637-752', '0637-752', 'G309.92']
9411 ['0637-752', 'G309.92', 'G309.92']
9512 ['0637-752', 'G309.92']
9613 ['1226+023']
9714 ['G339.88']
9815 ['G339.88']
9916 ['G339.88']
10017 ['G339.88']
10118 ['G188.95']
10219 ['G188.95']
10320 ['G188.95']
10421 ['G323.74']
10522 ['G323.74']
10623 ['SGR B2']
10724 ['SGR B2']
10825 ['SGR B2']
10926 ['SGR B2']
11027 ['G1.6']
11128 ['G1.6']
11229 ['G1.6']
11330 ['G1.6']
11431 ['SGR AB']
11532 ['SGR AB']
11633 ['SGR A 2E0N']
11734 ['Sgr A meth pk1']
11839 ['Sgr A meth pk1']
11943 ['30dor']
12044 ['lmc-co-1']
12145 ['lmc-co-1']
12246 ['lmc-co-1']
12347 ['lmc-co-1']
12448 ['lmc-co-1']
12549 ['lmc-co-1']
12650 ['lmc-co-1']
12751 ['lmc-co-1']
128
129Aha!  Fetching scan by number for 10, 11 and 12 returns scantables
130with more than one row.  Eight scans in three scantables reduces
131the number of rows by five.  Why should some rows be combined into
132mini-scantables?
133 
134In [23]: s10 = s_table.get_scan([10])
135
136In [25]: s10.get_direction()
137Out[25]: ['06:37:23.5 -75.13.36.8', '00:00:00.0 +00.00.00.0', '06:37:23.5 -61.20.17.2']
138
139In [26]: s11 = s_table.get_scan([11])
140
141In [27]: s11.get_direction()
142Out[27]: ['06:37:23.5 -75.13.36.8', '13:47:13.6 -61.20.17.2', '06:37:23.5 -61.20.17.2']
143
144In [28]: s12 = s_table.get_scan([12])
145
146In [29]: s12.get_direction()
147Out[29]: ['06:37:23.5 -75.13.36.8', '06:37:23.5 -61.20.17.2']