Xtellcor_general ---------------- Xtellcor_general is an IDL-based telluric correction program written by Bill Vacca and Mike Cushing. This program works only if the standard star is an A0 V star since it uses a high-resolution model of Vega (A0 V) to remove the intrinsic stellar features. Users can find a description of the code, as well as pictures of the various widgets and plots used in the procedure, in the paper by Vacca, Cushing, & Rayner (2002, PASP, submitted) and we would ask all users to reference this paper. The screen dumps of the widgets are particularly useful for understanding the steps and procedures involved. The paper can be downloaded at the IRTF SpeX website. We recommend keeping this help window up throughout the telluric correction process if the user is unfamiliar with the process since it will be unaccessable during many of the pop-up widget processes. All of the plot windows in XTELLCOR are fully resizeable. The following cursor commands are general and are used in all of the pop-up widgets. General Cursor commands: c - To clear a normalization, zoom, or line selection mode. i - To zoom IN in whatever zoom mode the cursor is currently in o - To zoom OUT in whatever zoom mode the cursor is currently in w - To plot the entire (WHOLE) spectrum Can be used to clear a previous zoom-in. x - Enters x zoom mode. Press (and release) left mouse button at lower x value and then press (and release) the left mouse button at the upper x value. y - Enters y zoom mode. Press (and release) left mouse button at lower y value and then press (and release) left mouse button at the upper y value. z - Cursor enters zoom mode. Press (and release) the left mouse button in one corner of the zoom box and then move the cursor to the other corner and press (and release) the left mouse button. The following cursor commands are used in only some specific windows, described below. Special Cursor Commands: e - Estimate the scale factors in the Xscalelines procedure. m - modify the boundaries of a selected continuum region in the Xconkern procedure. n - Cursor enters normalization mode in Xconkern. Select continuum regions to normalize the spectrum by clicking the left mouse button on the left and right sides of the region. s - Select a wavelength region in Xconkern and Xfindshift. -------------------------------------------------------------------- 0. Installation 1. Xtellcor_general *REQUIRES* at least IDL v5.3 as well as the IDL Astronomy User's Library. The latter can be downloaded from the following URL: http://idlastro.gsfc.nasa.gov/homepage.html 2. Download the Telluric tar file and unpack it with tar xvf Telluric.tar. This will create a directory called Telluric, which is the package directory, and a number of sub-directories. 3. The package and its directories must be included in the IDL_PATH variable. There are a number of ways of doing this but as an example, edit the .cshrc file to include the line setenv IDL_PATH +/packagedirectory:$IDL_PATH where /packagedirectory is the path to the package directory (e.g., /scr0/irtf/Spextool). If there is no IDL_PATH defined in the .cshrc file, then include the line setenv IDL_PATH +/packagedirectory II. Starting Up 4. Type "xtellcor_general" at the IDL prompt. This will bring up the Xtellcor control panel, which is divided into 5 sections corresponding to the steps to be carried out in performing the telluric correction on an input object spectrum. III. Loading the Data 5. If the user is not working in the directory where the data is stored, enter the path either by clicking on the Path button or by typing the path into the field. If the user is in the directory where the data is located, then this field can be left blank. 6. Load the standard star spectra by giving the filename in the "Std Spectrum:" field. This file should be a text file with wavelength in microns in the first column and "flux" in the second column. A third column with error values is optional. The suffix of the file must be .dat. 7. Give the B and V magnitude of the standard star. If the magnitudes are unknown, entered the SAME magnitude (any number) for B and V. In this case, the pseudo flux calibration will not be correct. 8. Enter the FWHM of the instrument profile IN MICRONS. The code currently assumes that the instrument profile is a Gaussian of the specified width. 9. Load the object spectra by giving the apropriate filename in the "Obj. Spectrum:" field. This file should also be text file with wavelength in microns in the first column and "flux" in the second column. A third column with error values is optional. The suffix of the file must be .dat. 10. Click the Load Spectra button. IV. Constructing the Convolution Kernel 11. Click on the Construct Kernel button. The Gaussian instrument profile is then convolved with a stored model spectrum of an A0V star (Vega). V. Constructing the Telluric Spectrum 12. The user can now make adjustments to account for the fact that the observed A0 V star may not have the same strengths of the Hydrogen lines as in the Vega model spectrum. Click on the "Scale Lines" button in section 3. of the Xtellcor control panel. The Xscalelines panel will appear. In the bottom window of the panel is the estimate of the telluric spectrum (in white) and a typical atmospheric absorption spectrum (in yellow). The Hydrogen lines present in A0 V stars are labeled and marked in green. Ideally, the telluric spectrum should look like the typical atmospheric absorption spectrum times the instrument throughput (a smoothly varying function). However, because the Equivalent Widths of the H lines in the observed star do not necessarily match those in the model spectrum of Vega, broad emission or absorption features may appear in the telluric spectrum at the wavelengths of the H lines. Xscalelines provides a method of scaling the model equivalent widths in order to remove these features from the telluric spectrum. In the upper panel is a plot of the initial scale factors used by the program to scale the H line Equivalent Widths in the model spectrum. All the scales should be set to unity initially. 13. Zoom in on a region around a H line feature with the "z" command. Type "e" and click the left-most mouse button twice, once on each side of the feature. Xscalelines will automatically compute the best scale factor for that particular line based on a fit of a background+gaussian to the feature in the telluric spectrum. The program will then fit a spline through all the scale factors and use the new scale array to recompute the telluric spectrum. The scale factors can also be adjusted by hand by clicking on the the green points in the upper window with the left-most mouse button, holding the button down, and dragging the point up or down. When the user releases the button, Xscalelines will recompute the new telluric spectrum with the new scale factor array. The typical telluric spectrum shown in yellow should give the user an idea of where the true atmospheric features are and what their approximate relative strengths should be after removal of the stellar H lines. The telluric-corrected object spectrum can be examined at any stage by selecting the "Object" button at the top of the lower window. If you are not happy with your adjusted scale factors, click on the "Reset Control Points" button, and all scale factors will be reset to unity. 14. Examine the telluric spectrum and correct as many features as necessary using the method described above. Note that for some features it may not be possible to remove the residuals completely. Also, it may be necessary to shift the Vega model spectrum relative to the observed spectrum in order to decrease the size of the residuals. The user can enter a relative velocity in the "Vshift" field at the top of the Xscalelines window. When the user is satisfied with the telluric spectrum in each order, s/he should click on the "Accept" button at the bottom of the Xscalelines panel. 15. Select the units desired for the output telluric-corrected object spectrum from the "Units" pull-down menu. Then click on the "Construct Telluric Spectrum" button. The program will then construct the telluric spectrum for each order. IV. Determining Residual Wavelength Shifts 16. It is possible that there are slight wavelength shifts between the A0 V star used to construct the telluric spectrum and the the object to be corrected. These shifts need to be removed in order to avoid introducing spurious noise and artifacts when dividing the object spectrum by the telluric spectrum. To estimate the wavelength shifts and correct them, click on the "Get Shift" button in section 4. "Determine Shift" of the Xtellcor control panel. The Xfindshift panel will apear. The object spectrum and the telluric spectrum are both plotted in the upper window. The result of dividing one by the other is shown in the bottom window. 17. Select a region containing a reasonably strong atmospheric features in both spectra. This is done by typing "s" (for "select") and click with the left-most mouse button on either side of the feature. Then click on the "Auto Find" button. Xfindshift will shift the telluric spectrum by fractions of a pixel and search for the best value, corresponding to a minimum in the chi^2 computed from the residuals in the selected region. The wavelength shifts can be reset to zero by typing zero in the Shift field and hitting return. If you wish to check the shift obtained from a different region, type "s" and select a new wavelength region. The "Cancel" button will close the Xfindshift window, and allow the user to re-start the procedure. When the user is satisfied with the shift found by Xfindshift, s/he should click on the "Accept" button at the bottom of the panel. V. Generate the Output Files 18. Choose the format of the output files by selecting from the FITS or Text option in section 5. of the Xtellcor panel. Give the name of the output file in the "Object File" field. The user can also choose to output the telluric correction spectrum as well as the modified Vega model spectrum (shifted to the radial velocity, scaled to the optical mag of the input standard star, convolved with the kernel, and multiplied by the equivalent width scale factor array). Click on the "Write File" button to generate the output files. The output files consist of 3 columns of data, wavelength in microns, flux in the units chosen by the user, and error. A widget called xzoomplot plot appears with the final telluric corrected spectrum. To modify the plot parameters, type 'm' in the plot window.