source: trunk/test/parkes-pol.py@ 2779

Last change on this file since 2779 was 2770, checked in by WataruKawasaki, 12 years ago

New Development: No

JIRA Issue: No

Ready for Test: Yes

Interface Changes: No

What Interface Changed:

Test Programs:

Put in Release Notes: No

Module(s): sd.scantable

Description: modified baselining function arguments to be 'name=value' style.


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