[744] | 1 | #!/usr/bin/env python |
---|
| 2 | from asap import * |
---|
| 3 | |
---|
[1038] | 4 | import os |
---|
| 5 | outdir = "./output" |
---|
| 6 | if not os.path.exists(outdir): |
---|
| 7 | os.mkdir(outdir) |
---|
| 8 | |
---|
[744] | 9 | rcParams['verbose'] = 0 |
---|
[937] | 10 | rcParams['plotter.ganged'] = 0 |
---|
[744] | 11 | |
---|
| 12 | # Don't plot to the screen... |
---|
| 13 | del plotter |
---|
| 14 | plotter = asapplotter(False) |
---|
| 15 | |
---|
| 16 | print "Test of Parkes polarimetry (P484)" |
---|
| 17 | |
---|
| 18 | data_1665 = scantable('data/parkes-pol.rpf') |
---|
[1847] | 19 | data_1665.parallactify(True) |
---|
[744] | 20 | data_1665.rotate_linpolphase(-45) |
---|
| 21 | data_1665.rotate_xyphase(-2) |
---|
| 22 | data_1665.set_unit('km/s') |
---|
| 23 | data_1665.set_freqframe('LSRK') |
---|
| 24 | |
---|
[937] | 25 | # Look at the first scan |
---|
| 26 | selection = selector() |
---|
[968] | 27 | selection.set_scans(0) |
---|
| 28 | data_1665.set_selection(selection) |
---|
[744] | 29 | |
---|
[937] | 30 | d1_5 = data_1665.copy() |
---|
| 31 | d1_7 = data_1665.copy() |
---|
[744] | 32 | |
---|
[968] | 33 | d1_7.set_restfreqs([1667.3590],'MHz') |
---|
| 34 | |
---|
| 35 | # Baseline both |
---|
| 36 | msk = d1_5.create_mask([-30,-25],[-5,0]) |
---|
| 37 | d1_5.poly_baseline(msk,1) |
---|
| 38 | msk = d1_7.create_mask([-30,-25],[-5,0]) |
---|
| 39 | d1_7.poly_baseline(msk,1) |
---|
| 40 | |
---|
[937] | 41 | # merge the two scans back together into a new scantable |
---|
| 42 | plotscans = merge(d1_5,d1_7) |
---|
| 43 | print plotscans.summary() |
---|
[968] | 44 | del d1_5,d1_7,data_1665 |
---|
[744] | 45 | # Plot the results |
---|
| 46 | plotter.set_mode('p','s') |
---|
| 47 | plotter.set_layout(2,1) |
---|
| 48 | plotter.set_range(-30,0) |
---|
[968] | 49 | selection.reset() |
---|
[1432] | 50 | plotter.plot(plotscans) |
---|
[968] | 51 | selection.set_polarisations(['I','Q', 'U', 'V']) |
---|
[938] | 52 | plotter.set_selection(selection) |
---|
[1432] | 53 | plotter.save('output/parkes_iquv.png',dpi=80) |
---|
[968] | 54 | selection.set_polarisations(['I','Plinear']) |
---|
[938] | 55 | plotter.set_selection(selection) |
---|
[1432] | 56 | plotter.save('output/parkes_iplin.png',dpi=80) |
---|
[968] | 57 | selection.set_polarisations(['RR','LL']) |
---|
| 58 | plotter.set_selection(selection) |
---|
[938] | 59 | plotter.save('output/parkes_rrll.png',dpi=80) |
---|
[744] | 60 | |
---|
| 61 | print "Parkes-Pol Test successful" |
---|