Create a table from a listing of your raw NIRES FITS files:
ls *.fits > file.ls
nsx file.ls list=nsx.tblThis creates a table of exposure start time, duration, RA, Dec, airmass, etc.
Executing nsx on a file with no parameters produces tables of spatial profiles for each echelle order and also a summed profile.
nsx s171214_0017.fits
| arcsec | median | average |obj |bck | row |These tables give the arcseconds from the lower edge of the slit, median and averaged values, and the row position relative to the lower edge. The 'obj' and 'bck' values are set when the object and background windows are set.
For 'A-B' extractions you can specify the B image also:
nsx s171214_0017.fits s171214_0018.fits
This produces individual profiles for each exposure and an 'A-B' profile:
s171214_0017-0018-pro.tblwhich you can use to select the appropriate background.
After plotting the profile (e.g. s180120_0056-pro.tbl), select the regions for the object and backgound regions in arcseconds.
nsx s180120_0056 sp=5.8,8.7 bk=0.5,3.8 bk=9.8,13.6
This will create extracted spectrum tables for each of the 5 echelle orders as well a corrected image, background fit image, and a table of nightsky line fit residuals. The sky line shift in pixels is given in the log file (s180120_0056.log).
You can have the program automatically select the object and background regions by using the '-autox' option:
nsx s180120_0056 -autox
See the .log file for the regions that were choosen. Note that all regions are given in terms of arcseconds (relative to the lower edge of the slit), since the row position of an object shifts between the NIRES echelle orders.
A pixel-to-pixel variation flat field has been created using data from March 2018. This will automatically be applied to your data unless the '-NoFlat' option is used. The flat field was created to only correct pixel-to-pixel variations-- the overall shape was removed as well as the absorption features. (see the file 'nsx/cal/flatnorm-180304.fits').
The program only extracts a spectra for only the 'A' image. In order to extract the 'B' spectrum, the program must be run again with the order of files reversed (A-B and then B-A). In order to get a sum of both spectra, run both extractions and sum the resulting spectra. Note that A-B tables show both observation numbers in the filenames. For example, an extraction of observation 45 (minus 46) would look like 's180304_0045-0046-sp4.tbl'.
In general A-B extractions will significantly improve the sky subtraction, but at the cost of S/N (especially for faint sources). You may want to try both an 'A only' and an 'A-B' extraction and compare the results.