source: trunk/tutorials/tutorial_2.rst@ 1762

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

Added sphinx project for ASAP tutorials

File size: 2.5 KB
RevLine 
[1636]1================================================
2Tutorial 2 – Data Reduction for multiple spectra
3================================================
4
5
6.. sectionauthor:: Kate Brooks
7
8**Main goal:** Handle multiple Spectral windows (IFs) and plot spectral-line catalogues
9
10
11Files
12-----
13
14* 2006-07-09_1431-M168.rpf Data file (63 Mb)
15
16* 3mm.txt Emission line catalogue
17
18* QuickData.py Data Reduction GUI (by Cormac Purcell)
19
20Data Log
21--------
22
23* ON-OFF-OFF-ON Position switching mode with Mopra
24
25* 4 Scans (2 OFF and 2 ON)
26
27* 4 x 2-GH bands (IF 0, 1, 2, 3)
28
29Instructions
30------------
31
321. Work through the list of commands given in the text file to
33 calibrate data taken with the Mopra telescope and identify the
34 emission lines. Commands should be typed line-by-line into
35 ASAP. Seek help from the tutors if there are any commands
36 you don’t understand.
37
382. The commands given in the text file are for 1 Mopra frequency
39 band only (IF0). Now work on the other 3 bands and make a
40 final plot showing all four frequency bands stitched together.
41
423. Now repeat the calibration steps using the Mopra Data
43 Reduction GUI. This GUI has been created via a python script
44 (QuickData.py).
45
46Commands
47--------
48
49.. code-block:: python
50
51 # Load data into memory and display short description
52 s = scantable('2006-07-09_1431-M168.rpf')
53 print s
54 # Set the plotting mode
55 plotter.set_mode(stacking='i', panelling='t')
56 plotter.set_histogram()
57 plotter.set_colours('black')
58 plotter.set_linestyles('solid')
59 # Plot all the raw data
60 plotter.plot(s)
61 # Form the quotient spectra
62 q = s.auto_quotient()
63 # Average all scans in time, weighting according to Tsys value
64 av = q.average_time(weight='tsys')
65 # Average the two polarisations together, weighting according to Tsys value
66 iav = av.average_pol(weight='tsys')
67 ### Work on IF0 only
68 # Define a selector
69 sel1 = selector()
70 # Select the first IF for scantable 'iav'
71 sel1.set_ifs(0)
72 iav.set_selection(sel1)
73 # Plot the first IF with x-axis in channel number
74 iav.set_unit('channel')
75 plotter.plot(iav)
76 # Flag out the end channels
77 msk1 = iav.create_mask([0,120])
78 iav.flag(msk1)
79 msk1 = iav.create_mask([7900,8200])
80 iav.flag(msk1)
81 # Redo the plot
82 plotter.plot(iav)
83 # Identify emission lines
84 iav.set_unit('GHz')
85 plotter.plot(iav)
86 # Load in catalogue of emission lines and overlay on plot
87 lc3 = linecatalog('3mm.txt')
88 plotter.plot_lines(lc3,location='top',rotate=90,doppler=-45)
Note: See TracBrowser for help on using the repository browser.