1 | #!/usr/bin/env python |
---|
2 | from asap import * |
---|
3 | |
---|
4 | rcParams['verbose'] = 0 |
---|
5 | rcParams['plotter.ganged'] = 0 |
---|
6 | |
---|
7 | # Don't plot to the screen... |
---|
8 | del plotter |
---|
9 | plotter = asapplotter(False) |
---|
10 | |
---|
11 | print "Test of Parkes polarimetry (P484)" |
---|
12 | |
---|
13 | data_1665 = scantable('data/parkes-pol.rpf') |
---|
14 | data_1665.rotate_linpolphase(-45) |
---|
15 | data_1665.rotate_xyphase(-2) |
---|
16 | data_1665.set_unit('km/s') |
---|
17 | data_1665.set_freqframe('LSRK') |
---|
18 | |
---|
19 | # Look at the first scan |
---|
20 | from asap._asap import selector |
---|
21 | selection = selector() |
---|
22 | selection._setscans([0]) |
---|
23 | data_1665._setselection(selection) |
---|
24 | |
---|
25 | d1_5 = data_1665.copy() |
---|
26 | d1_7 = data_1665.copy() |
---|
27 | |
---|
28 | d1_7.set_restfreqs([1667.0],'MHz') |
---|
29 | # merge the two scans back together into a new scantable |
---|
30 | plotscans = merge(d1_5,d1_7) |
---|
31 | print plotscans.summary() |
---|
32 | del d1_5,d1_7 |
---|
33 | |
---|
34 | # Baseline |
---|
35 | msk = plotscans.create_mask([-30,-25],[-5,0]) |
---|
36 | plotscans.poly_baseline(msk,1) |
---|
37 | # Plot the results |
---|
38 | plotter.set_mode('p','s') |
---|
39 | plotter.set_layout(2,1) |
---|
40 | plotter.set_range(-30,0) |
---|
41 | selection._reset() |
---|
42 | selection._setpolstrings(['I','Q', 'U', 'V']) |
---|
43 | plotter.set_selection(selection) |
---|
44 | selection._setpolstrings(['I','Plinear']) |
---|
45 | plotter.set_selection(selection) |
---|
46 | selection._setpolstrings(['RR','LL']) |
---|
47 | plotter.plot(plotscans) |
---|
48 | plotter.set_selection(selection) |
---|
49 | plotter.save('output/parkes_rrll.png',dpi=80) |
---|
50 | |
---|
51 | print "Parkes-Pol Test successful" |
---|