[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')
|
---|
| 19 | data_1665.rotate_linpolphase(-45)
|
---|
| 20 | data_1665.rotate_xyphase(-2)
|
---|
| 21 | data_1665.set_unit('km/s')
|
---|
| 22 | data_1665.set_freqframe('LSRK')
|
---|
| 23 |
|
---|
[937] | 24 | # Look at the first scan
|
---|
| 25 | selection = selector()
|
---|
[968] | 26 | selection.set_scans(0)
|
---|
| 27 | data_1665.set_selection(selection)
|
---|
[744] | 28 |
|
---|
[937] | 29 | d1_5 = data_1665.copy()
|
---|
| 30 | d1_7 = data_1665.copy()
|
---|
[744] | 31 |
|
---|
[968] | 32 | d1_7.set_restfreqs([1667.3590],'MHz')
|
---|
| 33 |
|
---|
| 34 | # Baseline both
|
---|
| 35 | msk = d1_5.create_mask([-30,-25],[-5,0])
|
---|
| 36 | d1_5.poly_baseline(msk,1)
|
---|
| 37 | msk = d1_7.create_mask([-30,-25],[-5,0])
|
---|
| 38 | d1_7.poly_baseline(msk,1)
|
---|
| 39 |
|
---|
[937] | 40 | # merge the two scans back together into a new scantable
|
---|
| 41 | plotscans = merge(d1_5,d1_7)
|
---|
| 42 | print plotscans.summary()
|
---|
[968] | 43 | del d1_5,d1_7,data_1665
|
---|
[744] | 44 | # Plot the results
|
---|
| 45 | plotter.set_mode('p','s')
|
---|
| 46 | plotter.set_layout(2,1)
|
---|
| 47 | plotter.set_range(-30,0)
|
---|
[968] | 48 | selection.reset()
|
---|
[1432] | 49 | plotter.plot(plotscans)
|
---|
[968] | 50 | selection.set_polarisations(['I','Q', 'U', 'V'])
|
---|
[938] | 51 | plotter.set_selection(selection)
|
---|
[1432] | 52 | plotter.save('output/parkes_iquv.png',dpi=80)
|
---|
[968] | 53 | selection.set_polarisations(['I','Plinear'])
|
---|
[938] | 54 | plotter.set_selection(selection)
|
---|
[1432] | 55 | plotter.save('output/parkes_iplin.png',dpi=80)
|
---|
[968] | 56 | selection.set_polarisations(['RR','LL'])
|
---|
| 57 | plotter.set_selection(selection)
|
---|
[938] | 58 | plotter.save('output/parkes_rrll.png',dpi=80)
|
---|
[744] | 59 |
|
---|
| 60 | print "Parkes-Pol Test successful"
|
---|