Combining the Files (Step=6)

Relevant code

XDpiped.csh CombineSpectraXD.py

Relevant options

None

What it does

Once the individual files have been rectified, the nscombine task combines the data into a single, average file. If the telescope was nodded along the slit (rather than off to sky), the “B” beam spectra are shifted before being combined with the “A” beam data. The standard star is assumed to be nodded along the slit, so the “B” beam spectra are, by default, shifted and combined with the “A” beam spectra. The files generated in this step and those written to the INTERMEDIATE directory are target_comb.fits and standard_comb.fits.

What to look for

Displaying the combined files should reveal whether the data were rectified and transformed correctly. For example, if the observations nodded along the slit, the combined data should have a central, positive trace flanked by the two negative beams. Other patterns probably indicate the “nscombine bug” (see below).

Things to most likely go wrong

nscombine can obtain the shifts between the nod beams from either the offsets in the headers or from cross-correlation, depending on the fl_cross. As of early 2016, a bug in the nscombine task occasionally causes it to misidentify the offsets when the header method is used. Unfortunately, not all science targets are bright enough for cross-correlation to be feasible, and nscombine doesn’t accept offsets as input. XDGNIRS, therefore, runs nscombine with fl_cross+ and compares the calculated offsets with what it believes they should be (based on the header info added in Step 0). If the offsets don’t look right, XDGNIRS reruns nscombine with fl_cross-. If the offsets still don’t look right, it exits with an error. Until a fixed version of nscombine is released, users in this situation will need to either contact Gemini staff for assistance or reduce the data themselves using, e.g., imshift, imcombine, etc.

Example: NGC 3031

The final combined data sets are shown in Fig. 9. Because the telescope was nodded off the slit for the extended galaxy observations, the B beam files were not shifted and combined with the A beam files and only a single positive trace is visible in the combined file. A much smaller nod was used for the standard star, and the pair of negative spectra flank a positive spectrum. As the B beam spectra were shifted before the files were combined, the positive spectrum contains all the useful science data and only a single spectrum will be extracted – see Extracting the Spectra (Step=7).

../_images/combined.jpeg

Fig. 9 Extension 1/order 3 of the combined galaxy and standard star data sets (target_comb, standard_comb).