source: trunk/web/tutorials/tutorial.html@ 2474

Last change on this file since 2474 was 1071, checked in by mar637, 18 years ago

minor updates and fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.6 KB
Line 
1<html>
2<head>
3<title>Mopra 2005 Workshop - Data reduction tutorial worksheet</title>
4<style type="text/css" media="all">
5div.shell {
6background-color: #dbfff9;
7padding: 0.1em;
8}
9div.code {
10background-color: #c9ffbf;
11padding: 0.1em;
12}
13div.main {
14margin: 0.2em 0.2em 0.2em 0.2em;
15text-align: left;
16font-family: sans-serif;
17width: auto;
18}
19h1.custom {
20background-color: #aaaaaa;
21color: #000000;
22padding: 0.5em;
23font-family: sans-serif;
24font-size: x-large;
25}
26</style>
27</head>
28<body>
29<div>
30<h1 class=custom>
31Introduction
32</h1>
33<div class=main align=center>
34This is a short tutorial on how to use ASAP for simple on of dual IF
35observations. It is highly customisable via ".aipsrc" parameters. It
36can read rpfits,sdfits and measurement sets, and export to sdfits, ms,
37ASCII and image fits. ASAP provides a lot more functionality, such as
38frequency alignment, averaging which can't be presented here.
39</div>
40<h1 class=custom>
41Part I - Reduction
42</h1>
43<div class=main align=center>
44To start ASAP type the follwing at the *nix command line prompt
45<div class=shell>
46<pre>
47localhost> asap
48</pre>
49</div>
50To get the list of available commands in asap type:
51<div class=code><pre>
52commands()
53</pre></div>
54Help can be accessed by using <em>help</em>:
55<div class=code><pre>
56help(scantable)
57help(scantable.summary)
58</pre></div>
59To start we are reading in the data into a scantable, which can be accessed via th variable <em>s</em>. After reading in we have a look at the data.
60<div class=code><pre>
61s = scantable("2005-05-08_0350.rpf")
62s.summary()
63</pre></div>
64We can plot the scan now. First we set up the plotter to plot "IF" as stcked colours and "time" across panels. Then we issue the plot command.
65<div class=code><pre>
66plotter.set_mode("IF","time")
67plotter.plot(s) # plot s
68</pre></div>
69Now we can build the quotient. This applies the quotient to both IFs.
70<div class=code><pre>
71q = s.auto_quotient()
72plotter.plot(q) # plot q
73</pre></div>
74Now we can set some information anbout the velocity setup. We set the rest frequencies for 13Co and SiO and want to operate in "LSRK".
75<div class=code><pre>
76restfreqs = [110.201,86.243] # 13CO-1/0, SiO the two IF
77q.set_restfreqs(restfreqs,"GHz") # set the restfrequencies, as not in data
78q.set_unit("km/s") # set the unit to be used from now on
79q.set_freqframe("LSRK") # set frequency frame
80plotter.plot() # replot, should show velocity now
81</pre></div>
82Now we can subtract a baseline. ASAP can do this automatically if ther is good S/N and the lines aren't too broad.
83<div class=code><pre>
84q.auto_poly_baseline() # determine and subtract a poly baseline automatically
85plotter.plot() # replot
86</pre></div>
87We can zoom in on the spectrum and format the title and legend. ASAP accepts LATEX math expressions.
88<div class=code><pre>
89plotter.set_range(-35,35) # zoom in bit
90plotter.set_legend([r"$^{13}CO(1\leftarrow 0)$",r"$SiO$"]) # make nice latex IF labels
91plotter.set_title(['Mopra Tutorial 2005']) # set the title
92</pre></div>
93Now convert Brightness temperature to Flux density.
94<div class=code><pre>
95q.convert_flux() # K -> Jy
96plotter.plot()
97</pre></div>
98This "final" plot can be saved now as "png", "ps" or "eps"
99<div class=code><pre>
100plotter.save("tutorial.png")
101plotter.save("tutorial.eps")
102</pre></div>
103We can also do some stats on the spectra. We select a line free region first, which get applied to the statistics.
104<div class=code><pre>
105msk = q.create_mask([-70,20], [20,70]) # line free region - two windows
106rms = q.stats("rms",msk)
107med = q.stats("median",msk)
108</pre></div>
109</div>
110<h1 class=custom>
111Part II - Fitting
112</h1>
113<div class=main align=center>
114This part shows how easy it is to fit gaussian line profiles.
115<div class=code><pre>
116f = fitter()
117</pre></div>
118We start with the first spectrum (IF=0) bys setting the selection. We want to fit two gaussian components.
119<div class=code><pre>
120sel = selector()
121sel.set_ifs(0)
122q.set_selection(sel)
123f.set_scan(q)
124f.set_function(gauss=2) # fit two gaussians
125f.fit()
126f.plot(
127</pre></div>
128The second IFs spectrum is more complex. We select it and fit seven gaussians to it. Here we also plot residuals, the individual components and the fit parameters.
129<div class=code><pre>
130sel.set_ifs(1)
131q.set_selection(sel)
132f.set_function(gauss=7)
133f.fit()
134f.plot(residual=True)
135f.plot(components=[0,1,2,3,4,5,6,-1])
136f.plot(components=[0,1,2,3,4,5,6,-1],plotparms=True)
137</pre></div>
138</div>
139<h1 class=custom>
140Appendix
141</h1>
142<div class=main align=center>
143More info can be found on the ASAP homepage
144<a href="http://www.atnf.csiro.au/computing/software/asap">
145http://www.atnf.csiro.au/computing/software/asap</a>
146</div>
147</body>
148</html>
Note: See TracBrowser for help on using the repository browser.