source: trunk/tutorials/tutorial_4.rst@ 1933

Last change on this file since 1933 was 1636, checked in by Malte Marquarding, 15 years ago

Added sphinx project for ASAP tutorials

File size: 3.1 KB
RevLine 
[1636]1=========================================================
2Tutorial 4 – Data Reduction for Parkes Methanol Multibeam
3=========================================================
4
5.. sectionauthor:: Jimi Green
6
7Files
8-----
9
10* mmb-mx.rpf Data file (9.4 Mb)
11
12Data Log
13--------
14
15* 7 Spectra taken with Parkes Methanol Multibeam
16
17Instructions
18------------
19
201. Work through the list of commands given in the text file to
21 calibrate data taken with the Parkes Methanol Multibeam.
22 Commands should be typed line-by-line into ASAP. Seek help
23 from the tutors if there are any commands you don’t
24 understand.
252. Write a python script to automate the calibration procedure for
26 data taken with the Parkes Methanol Multibeam. Incorporate
27 the list of commands used in step 1 as well as a routine to cycle
28 through the 7 different beams.
29
30 **Note:** Your python script should be executed in a terminal (and
31 not within ASAP) with the following command::
32
33 python -i myscript.py
34
35Commands
36--------
37
38.. code-block:: python
39
40 # Load data (with filename mmb-mx.rpf) into memory and display
41 data = scantable("mmb-mx.rpf")
42 print data
43 # Set the polarisation feed type
44 data.set_feedtype("circular")
45 # Select just the first IF (the data actually contains two, the
46 # methanol transition at 6.7GHz and the excited-state OH transition
47 # at 6GHz, but we will only look at methanol).
48 sel=selector()
49 sel.set_ifs(0)
50 data.set_selection(sel)
51 # Set the rest frequency
52 data.set_restfreqs(6.6685192e9)
53 # Set the cal values for the 7 beams, both polarisations.
54 calfact = (( 2.29, 2.28 ), ( 2.18, 1.93 ), ( 4.37, 4.37 ), \
55 (2.53,3.20 ), ( 3.69, 3.89 ), ( 3.74, 3.51 ), ( 1.98, 1.70 ))
56 # Apply cal factors to first beam, first polarisation
57 sel.reset()
58 sel.set_beams(0)
59 sel.set_polarisations(0)
60 data.set_selection(sel)
61 data.scale(calfact[0][0], insitu=True, tsys=True)
62 # Apply cal factors to first beam, second polarisation
63 sel.reset()
64 sel.set_beams(0)
65 sel.set_polarisations(1)
66 data.set_selection(sel)
67 data.scale(calfact[0][1], insitu=True, tsys=True)
68 # Now repeat above 10 steps for the other 6 beams
69 # Reset selection parameter
70 data.set_selection()
71 # Set plotter output to show both polarisations on the same plot,
72 # but each beam on a separate plot.
73 plotter.plot(data)
74 plotter.set_mode("p","b")
75 # Plot the first scan only
76 sel = selector()
77 sel.set_scans(1)
78 plotter.set_selection(sel)
79 # Average "off-source" scans for each beam, then use as the
80 # reference scan to form a quotient.
81 q = data.mx_quotient()
82 plotter.plot(q)
83 # Define the channel unit.
84 q.set_unit("km/s")
85 plotter.plot()
86 plotter.set_range(-60,-10)
87 # Average all the multiple beam data together to form
88 # a long integration spectrum.
89 avb = q.average_beam()
90 plotter.plot(avb)
91 plotter.set_range()
92 # Average polarisations together
93 avp = avb.average_pol()
94 plotter.plot(avp)
95 # Fit a linear baseline (avoiding the maser feature)
96 msk=avp.create_mask([-110,-70],[10,40])
97 avp.poly_baseline(msk,order=1)
98 plotter.plot(avp)
99 # Make a nice file
100 plotter.set_colors("black")
101 plotter.set_legend(mode=-1)
102 plotter.set_title("G300.969+1.148")
103 plotter.save("G300p96.ps")
Note: See TracBrowser for help on using the repository browser.