Observations of A0V stars are used both for telluric absorption and relative flux calibration. The procedure is outlined in Vacca, Cushing, & Rayner (2003), and implemented in the xtellcor routine of their SpeX pipeline, Spextool. We have ported xtellcor for use with FIRE, and refer users to the relevant xtellcor documentation to see how this procedure is performed in practice.
To call xtellcor from firehose, select the Telluric tab, and then go in the file tree to the exposure you wish to correct. Double click and the xtellcor window should appear with all fields for the input files and B and V magnitudes of the standard correctly populated. If these fields are in error, you can browse to find the right files, and enter in the magnitudes by hand. The input files should be in the redux/Object directory and named Obj_0123.fits with '0123' replaced by the appropriate frame number.
Most Draper catalog telluric stars (i.e. the HD stars) will have both their B and V magnitudes tabulated in the structure. Some hipparcos stars do not have a B magnitude listed, but these can generally be found at the Gemini standards website.
Once the initial telluric calibration frame has been generated for a source visit, only the final correction is required (skipping the kernel calculation and line scaling steps). For subsequent corrections, firehose calls xtellcor_finish to speed up the processing.
12 Comments
danmasters1_1@touchstonenetwork.net
This site has helpful instructions on doing the correction with xtellcor: http://www.astro.virginia.edu/~mfs4n/tspec/user/tspectool/TSpecTool_usersguide_091716.pdf
Unknown User (banados.eduardo_1@touchstonenetwork.net)
Unfortunately that .pdf does not exist anymore. Does someone have that .pdf or hints for this part? I found this part of the reduction pipeline being the hardest to follow (being unfamiliar with xtellcor).
For other people like me, these are the important commands (as far as I can tell):
In the Step 2. Construct Kernel you need to define the fitting windows. To do that press "n", then click on the left edge of the window and once more in the right edge. Repeat this for other windows. Then Click in "Fit Continuum" Play with the "Fit Degree" until you find a good fit.
Next, click in "Normalized Spectrum". Press "s" and click left and right of the absorption feature. Then click in "Construct Kernel". Make sure the residual flux is around zero. Retry if necessary. Click "Accept"
This link has some useful information:
http://ganymede.nmsu.edu/tharriso/ast536/ast536week05.html
danmasters1_1@touchstonenetwork.net
The routine "fire_xtellcor_finish.pro" does not save the corrected spectrum to the name specified by the user in the GUI. The way to fix this is to change line 410, from:
mwrfits, obj_strct, path+objname, hdr, /create ; write it back out.
To:
mwrfits, obj_strct, path+oname, hdr, /create ; write it back out.
Unknown User (enewton_1@touchstonenetwork.net)
On the second set of data I reduced, I encountered a small problem in fire_xtellcor_writefile. I'm not sure why they weren't a problem on the previous data (in a different folder) which leads me to believe that it is particular to my computer. In my case, I fixed this by changing:
at line 761: name = './raw/fire_'+splitarr[n_elements(splitarr)-1] needed to begin with two ..
and on the following line after ELSE: headfits('../Raw/fire_'+splitarr[n_elements(splitarr)-1]), Raw needed to be all lowercase.
Unknown User (enewton_1@touchstonenetwork.net)
Since I have Spextool installed separately (for reducing IRTF data), I needed to make sure that the FIRE versions of the telluric correction software was read rather than the IRTF versions.
Unknown User (jane.rigby_1@touchstonenetwork.net)
What are the flux units of each output spectrum? I suspect they're f_lambda, in erg/s/cm^2/A, b/c that's xtellcor_general's default. But I don't see it mentioned in the cookbook. I want to be sure that the units are what I think they are, and that successive steps (order-combine and frame-combine) didn't change those units.
Unknown User (enewton_1@touchstonenetwork.net)
IDL update means you have to fix the legend command.
Unknown User (k.allers_1@touchstonenetwork.net)
I'm running into 2 bugs with fire_xtellcor:
1) I'm doing the deconvolution and getting a nice fit with low rms on the Pa-delta (<1%) on order 26. When I go to "scale lines", the residuals in order 26 are huge, with a very visible deep Pa-delta feature (which should have been well-removed by the convolution.
2) Also within "scale lines", if I attempt to use "f" to remove bad pixels or bad line subtractions a couple of error occur: a) "f" is supposed to create a line defined by the edge pixels, but it is replacing the spectrum with a curve rather than a line. and b) if I use "f" while scaling lines, firehose crashes when I hit "Construct Telluric Spectra" the error is : "GAUSSJ: Singular matrix".
As a note: no other SpeXtool versions are in my IDL path.
Unknown User (k.allers_1@touchstonenetwork.net)
So, I spent the day looking into issue #1. It turns out that the kernels created in step #2 of fire_xtellcor have their indices reversed compared to the standard star. So, when you go to scale lines, the telluric spectrum being created is convolved by the wrong kernel (i.e. the telluric for order 11 is being created using the kernel for order 31 etc.). If the Hyd line subtractions in your tellurics are looking bad, this is probably why. I have a hacky fix for it, but it requires a good bit of IDL literacy. Contact me if you'd like it, and I'll pass along the info to Rob to fix for future firehose versions.
Unknown User (enewton_1@touchstonenetwork.net)
Is still an issue? I've been getting some slightly weird results with scaling lines using the most recent code (in the bluest orders, a places where there is a saw tooth introduced: a positive spike then a negative spike, and sometimes there are significant residuals to correct), and notably "f" is resulting in curved lines. But, nothing crashes.
Edit: I think I found the place where this would an issue, and it appears to be correct.
Unknown User (k.allers_1@touchstonenetwork.net)
It turns out that the problem with #1 was also resulting in problem 2b) because the cut regions were also having their orders flipped. Problem 2a) is a result of the line being fit to the telluric and not 1/telluric (which is what's plotted).
Unknown User (ninopsu_1@touchstonenetwork.net)
I have an error message when I try to save the telluric files when I hit the button "write file":
HEADFITS: ERROR - OPENR: Null filename not allowed.
% SXPAR: FITS Header (first parameter) must be a string array
% Execution halted at: FIRE_XTELLCOR_WRITEFILE 812 /Users/acucchia/work/Magellan/FIRE/Spextool/pro/fire_xtellcor.pro
% FIRE_XTELLCOR_EVENT 209 /Users/acucchia/work/Magellan/FIRE/Spextool/pro/fire_xtellcor.pro
% WIDGET_PROCESS_EVENTS
I think the problem is that my "raw" directory is called not "raw" and so headfits fails creating the files. Has anybody encountered such error?
Any easy fix?
Thanks.
FIXED: I forgot to re-set the raw directory path in the firehose setup window after a previous crash of the xtell_corr.