For sources that are extended and may cover a large fraction of the slit length, it is sometimes advisable to chop between the science pointing and a nearby region of blank sky.  The blank sky frame, which should have the same exposure time as the science frame, is used to estimate the sky background.  FIREHOSE is not nominally set up to do this, but at the request of several users we have added in such a functionality, in alpha testing/shared risk mode.  This page describes how it should be used.

1. Set up the fire structure for blank-sky frames

Unlike other calibration frames, FIREHOSE cannot automatically determine if a particular frame contains a science object or blank sky.  So, users must specify explicitly in the fire structure which frames are to be used in this way.  The association of specific sky frames with their corresponding object happens downstream, at extraction.

After you have generated the fire structure, you should click on the tab for "Edit/Save Structure" and the edit GUI will appear.  Typically, firehose will realize that your object and sky frames were taken with the telescope pointing nearly in the same place, and it may even give them the same object ID.  You will need to break this association.

First, highlight each frame that represents a blank-sky image.  Click "Change Type" and set the type to "SKY".  Then (IMPORTANT) click on "Change ObjectID" and set the object OD of the sky frame to -1 (since it is not an object spectrum).  

After you have done this for all sky frames, click "Done" to save the structure and return to the main window.

2. Set the Extraction Preferences

Now you are ready to extract the spectrum.  But first, you must tell the extraction code that you wish to use blank sky frames rather than the default of deriving a sky model from the science frame.  In the Extraction tab, click on "Preferences" to bring up the selection window.

Now, under the "Sky Model" section, use the drop menu to de-select the default "Derive from sci frame" and set instead to "Use separate file."

Although not strictly necessary, at this point it is highly advisable to visit the object finding and extraction preferences and set them accordingly.  If you are reading this page, it probably means you have a funky spatial object profile on the slit and you should consider setting the object profile by hand.

Likewise, it may be more straightforward to employ boxcar extraction, or set the weighting function for optimal extraction by hand.

3. Associate object-sky pairs

Once you have saved your extraction preferences, click an object and start the extraction.  A primitive GUI will appear with a list of your science targets.  For each object in the list, highlight its line and click "set sky."  This will bring up a list of the files you have identified with the SKY tag above. Click the one that goes with each science frame. When you click "Done" the software will begin extracting your spectrum.  If you have specified user-selected apertures you will be prompted to work with the aperture GUI.  

4. Finishing touches

Once extraction is complete, telluric correction and order combining is performed as for standard reductions.

5. What the code is doing

The blank sky code is considerably more sophisticated than just a straight subtraction of the science-sky frames.  We have found that the OH lines are so sharp and bright that the science and sky frames must be registered to ~0.01 pixel accuracy to avoid the appearance of overwhelming P-cygni-like residuals.  Since FIRE flexes at the several tenths of a pixel level, this must be corrected out.

We achieve this by constructing a fully parameterized b-spline model of the sky using the SKY frame.  We then perform a 2D FFT cross correlation of the science frame and sky model to determine flexure offsets at the 0.01 pixel level.  These subpixel offsets are applied to the sky frame to register it to the object.  We have found that this produces excellent registration of the model.  However, even then we see noticeable residuals in the cores of OH lines, because even a 1% variation can be stronger than object signals.  To mitigate this, we use a list of known OH lines, and calculate the variation in OH intensity between the SKY and SCIENCE frames, within 1 resolution element (50 km/s) of a catalog OH line.  This is done for each of ~300 lines and the corrections are added to the sky model.  We have debated whether this is best practice but ultimately settled on adjusting the OH lines to mitigate residuals.  Users who wish to turn of this feature should contact R. Simcoe for information on how to do this.

  • No labels