[1636] | 1 | ========================
|
---|
| 2 | Tutorial #1 - Basic ASAP
|
---|
| 3 | ========================
|
---|
| 4 |
|
---|
| 5 | .. sectionauthor:: Kate Brooks
|
---|
| 6 |
|
---|
| 7 | **Main goal:** Get a basic understanding of ASAP commands to import and plot data
|
---|
| 8 |
|
---|
| 9 | Files
|
---|
| 10 | -----
|
---|
| 11 |
|
---|
| 12 | * 2008-03-12_09320-M999.rpf Data file (1.1 Mb)
|
---|
| 13 |
|
---|
| 14 |
|
---|
| 15 | Data Log
|
---|
| 16 | --------
|
---|
| 17 |
|
---|
| 18 | * ON-OFF Position switching mode with Mopra
|
---|
| 19 |
|
---|
| 20 | * 2 Scans (1 OFF and 1 ON)
|
---|
| 21 |
|
---|
| 22 | * 1 MOPS Zoom band
|
---|
| 23 |
|
---|
| 24 | Instructions
|
---|
| 25 | ------------
|
---|
| 26 |
|
---|
| 27 | 1. Work through the list of commands given in the text file to
|
---|
| 28 | calibrate data taken with the Mopra telescope. Commands
|
---|
| 29 | should be typed line-by-line into ASAP. Seek help from the
|
---|
| 30 | tutors if there are any commands you don't understand.
|
---|
| 31 |
|
---|
| 32 | To start asap simply run the following at your prompt::
|
---|
| 33 |
|
---|
| 34 | asap
|
---|
| 35 |
|
---|
| 36 | 2. Write a python script to automate the calibration procedure
|
---|
| 37 | used in step 1. Your python script should permit interaction
|
---|
| 38 | with the plotter and should be executed in a terminal (and not
|
---|
| 39 | within ASAP) with the following command::
|
---|
| 40 |
|
---|
| 41 | python -i myscript.py
|
---|
| 42 |
|
---|
| 43 | The python script to be run outside asap needs to have the following line
|
---|
| 44 | at the top of the file::
|
---|
| 45 |
|
---|
| 46 | from asap import *
|
---|
| 47 |
|
---|
| 48 | This will import all asap functionality into the "normal" python.
|
---|
| 49 |
|
---|
| 50 | Commands
|
---|
| 51 | --------
|
---|
| 52 |
|
---|
| 53 | .. code-block:: python
|
---|
| 54 |
|
---|
| 55 | # Load data file into memory and view description
|
---|
| 56 | s = scantable('2008-03-12_0932-M999.rpf')
|
---|
| 57 | print s
|
---|
| 58 |
|
---|
| 59 | # Set the plotting mode
|
---|
| 60 | plotter.set_mode(stacking='i', panelling='t')
|
---|
| 61 |
|
---|
| 62 | # Plot all raw data
|
---|
| 63 | plotter.plot(s)
|
---|
| 64 |
|
---|
| 65 | # Set the doppler convention
|
---|
| 66 | s.set_doppler('RADIO')
|
---|
| 67 |
|
---|
| 68 | # Set the rest frame
|
---|
| 69 | s.set_freqframe('LSRK')
|
---|
| 70 |
|
---|
| 71 | # Set the observed rest frequency in Hz
|
---|
| 72 | s.set_restfreqs([86243.37e6])
|
---|
| 73 |
|
---|
| 74 | # Define the channel unit
|
---|
| 75 | s.set_unit('km/s')
|
---|
| 76 |
|
---|
| 77 | # Form the quotient spectra
|
---|
| 78 | q=s.auto_quotient()
|
---|
| 79 |
|
---|
| 80 | # Average all scans in time, aligning in velocity
|
---|
| 81 | # Note: That for this dataset there is only 1 scan and so this step is redundant
|
---|
| 82 | av = q.average_time(align=True)
|
---|
| 83 |
|
---|
| 84 | # Average the two polarisations together
|
---|
| 85 | iav = av.average_pol()
|
---|
| 86 |
|
---|
| 87 | # Plot the spectrum
|
---|
| 88 | plotter.plot(iav)
|
---|
| 89 |
|
---|
| 90 | # Remove the baseline (set to 0 order). Specify the signal-free channels
|
---|
| 91 | msk = iav.create_mask([-200,-50],[50,180])
|
---|
| 92 | iav.poly_baseline(msk,0)
|
---|
| 93 | plotter.plot(iav)
|
---|
| 94 |
|
---|
| 95 | # Smooth the data with boxcar, full width = 3
|
---|
| 96 | siav = iav.smooth(kernel = 'boxcar', width = 3, insitu = False)
|
---|
| 97 | plotter.plot(siav)
|
---|
| 98 |
|
---|
| 99 | # Scale the data according to scaling fudge factor
|
---|
| 100 | # Eg. With beam efficiency of 0.49 at 86 GHz
|
---|
| 101 | iav.scale(2)
|
---|
| 102 |
|
---|
| 103 | # Make final plot for saving
|
---|
| 104 | plotter.set_range(-20,30)
|
---|
| 105 | plotter.plot(siav)
|
---|
| 106 | plotter.set_legend(mode=-1)
|
---|
| 107 | plotter.set_title(['Orion-SiO'], fontsize=18)
|
---|
| 108 | plotter.text(10,95,"SiO (2-1 v=1) at 86243.440 MHz", fontsize=12)
|
---|
| 109 | plotter.text(-19,95,"2008/03/12", fontsize=12)
|
---|
| 110 | plotter.text(-19,90,"Zoom Mode", fontsize=12)
|
---|
| 111 |
|
---|
| 112 | # Save plot as postscript file
|
---|
| 113 | plotter.save('Orion-SiO.ps')
|
---|