The data-reduction path given in Chris Salter's “IDL Cheat Sheet” invovles a number of steps that are repeated for each observation. Onoffred is a wrapper program for the various AO IDL routines that are called, enabling an experienced observer to do file-loading, on-off data reduction, baseline fitting, smoothing and polarization averaging in a single step. For standard usage, the format is:
onoffred, 〈filename〉, b, ball, /scljy, deg=1, smo=9, /box
which will load the corfile or wapp fits file 〈filename〉, do on-off data reduction with scaling to Jy (for scaling to K use /sclcal instead), fit a baseline with polynomial order 1 (deg=1, boxcar smooth this with a width of 9 (smo=9) (for Hanning smoothing, remove the /box), combine the polarizations, and return the result in the structure ball. The structure b contains the simple on-off reduction with no further processing.
A number of further options are available, such as using scan=N to position to a certain scan number inside a file - this should only be necessary if working on a file containing multiple on-off observations.
For anything other than simple detection-confirmations, it is normal to want to measure an HI spectrum after detecting the galaxy. These routines allow this to be done for Interim Correlator and WAPP data (cormeasure) and for Mock Spectrometer data (masmeasure) by calling an IDL implementation (mbmeasure) of the MIRIAD routine MBSPECT, which has been used to derive HI parameters for a number of HI surveys, including HIPASS, HIZOA, AGES and ALFA ZOA. The IDL implementation works on baseline-subtracted, polarization-combined single-pixel data (such as that output by onoffred) and adds errors calculated using the equations of Koribalski et al. (2004), as well as allowing the ‘profile window’ to be set interactively.
For standard usage, the format is:
cormeasure, ball, board=1, profile=[2500,2800], xrange=[1500,3800], boxwidth=9
which will look at board 1 of the structure ball within the velocity range 1500 – 3800 km/s and analyze the HI source found in the profile window 2500 – 2800 km/s. In order to correctly estimate the errors on the returned quantities if the data have been smoothed, boxwidth=9 tells the program that the velocity resolution is 9 times the channel separation - if this is ommitted then the error estimates returned for smoothed data will be too low. If the data have not been smoothed,boxwidth should be left unset. If profile is not given, then the user will be prompted for it interactively. A mask can also be set, containing pairs of velocities that are to be ommitted from the noise measurement (which feeds into the error estimates) - this can be useful to prevent the noise measurement being affected by RFI or other HI sources.
The standard options for masmeasure are very similar:
masmeasure, ball, profile=[2500,2800, xrange=[1500,3800], boxwdith=9
which only differs from cormeasure in using ball to specify the first board of a multi-board mas structure rather than ball, board=1. Cormeasure also includes a velcor=N option to correct the velocity in the header by subtracting N from it, which is useful if the board rest frequency has been set to something other than the HI frequency (or the frequency of whichever line is being observed), while masmeasure uses the restfreq=N and velcrdsys=[T/G/B/L] from masfreq to accomplish this.
Most other options relate to output. The spectrum is normally output to the screen, but can also be output to a postscript file specified by psfile = 〈filename〉, or to the file ‘〈srcname〉.eps’ by using the /eps switch. The robust and user-defined profile windows can be hidden from the postscript output using the /hidelines switch. The x- and y-axis labels can be changed from the defaults using xlabel=〈string〉 and ylabel=〈string〉. A logfile to record the data output to the terminal screen and a text version of the spectrum (velocity and flux density) can be specified using file = 〈filename〉.
Converged after 2 iterations Peaks: User defined profile: Max: 0.00443467 at 4143.3583 Min: -0.000304061 at 4005.7238 Robust profile: Max: 0.0044346717 at 4143.3583 Min: 0.00030531862 at 4169.8408 Moment analysis: 0: 0.44900944 +/- 0.047475997 Robust: 0.44939099 1: 4101.4145 Robust: 4102.1698 2: 37.019302 Robust: 32.189941 Profile windows: User defined: 4005.23 to 4183.71 ( 34 points) Robust: 4021.6949 to 4182.6446 ( 30 points) Full range: 2003.0523 to 5997.6212 ( 756 points) Noise (measured around the median, masking the robust window) = 0.000411645 using 726 points Noise (measured around the median, masking the profile window) = 0.000412636 using 722 points SN(peak) = 9.46693 Vel. res. = 6.3405859 Width maximiser: Line centre: 50%: 4100.90 +/- 2.2947394 Robust profile: 4100.90 20%: 4101.58 Robust profile: 4101.58 Line width: 50%: 114.226 +/- 4.5894789 Robust profile: 114.226 20%: 130.766 +/- 6.8842183 Robust profile: 130.766 Width minimiser: Line centre: 50%: 4100.90 Robust profile: 4100.90 20%: 4101.58 Robust profile: 4101.58 Line width: 50%: 114.226 Robust profile: 114.226 20%: 130.766 Robust profile: 130.766
This is an example of the output in the IDL window (and to the logfile if one is specified). At the top it says how many iterations the robust profile fitting took to converge. Below this it says where the max and min were in the user-defined and robust profiles. This is followed by the moment analysis. Moment 0 is the integrated flux, moment 1 is the flux-weighted average velocity, and moment 2 is the velocity dispersion. The error is given for moment 0, which is the most widely used of these measurements, but applies equally to the robust moment. You should inspect where the robust window has been placed (see below) to determine whether you prefer this window to the user-defined window.
The moments are followed by information on the two profile windows and on the full range used and by estimates of the noise (masking out the profile window and any user-defined ‘mask’) made using the median absolute deviation about the median of the data. Below this is the signal-to-noise of the peak flux and the velocity resolution that has been used in estimating the noise. These are followed by measurements of the velocity widths and line centres - the width minimizer starts at the peak and works out to the 50% and 20% levels, while the width maximiser starts at the outside of the profile and works in to 20% and 50% of the peak flux. If the profile window has been well defined, the width maximiser should give a good answer. Errors are given for the width maximiser; these also apply to measurements from the width minimiser.
The window above shows the graphical output in an IDL window (this can also be sent to a postscript file using psfile=〈filename〉). The spectrum is shown with a triangle indicating the maximum (or the minimum if an absorption line is being measure), ‘+’ signs indicating the width maximiser and ‘×’ signs indicating the width minimiser 50% and 20% points (on the example these are in the same place, so they appear as 8-pointed stars), dashed vertical lines indicating the robust profile window and dotted vertical lines indicating the user-defined profile window. The title at the top of the spectrum is the source name, taken from the file header.