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