Wednesday, July 25, 2012

Trinary Dwarfs-Nirspec Data Reduction



Nirspec Data Reduction
Directory structure:
Usually directories with raw data for spectra are categorized 
by date, create a reduction folder to store your reductions.
Then, within reduction, create a folder for source name, a 
folder within that for order number, and if more than one pair
of exposures was taken a folder within that for nod set e.g.
/data/nirspec/110715/reduction/2026-2943/order33/nod1/
/data/nirspec/110715/reduction/2026-2943/order33/nod2/
etc...

Create or copy in a spec1.in file which is a text file that
contains linelist information to use for the further steps
in reduction. This can be created using the efs simulator

cd into the reduction directory and start idl by entering
idl as a command into the terminal.

nirspecfd:
from the reduction directory, after starting idl type in 
nirspecfd. This is a shell script that creates flat and 
dark files. Other scripts can be used or created on your 
own, but the idea is to combine the images and average
them. If you want to use this on a file, for example
jul06s0019.fits you would do:

IDL> nirspecfd 
raw='../spec' 
out='./'
prefix='aug19s'
darks='20-34'
flats='5-19'

The prefix is the date signifier in the name of the data 
fits files, the darks variable is set to the range of file 
numbers for your darks, and the flats variable is set to the 
range of file numbers for your flat fields.  Run this for 
each set of flats and darks you've generated for each filter
/slit combination used during the night.

parfile:
from the source/order/nod directory, start idl and type:

IDL> parfile

on left side:
keep spatial map and spectral map as they are, they
are usually set to spat.map, spec.map in order to 
facilitate the later steps. set flat and dark to the 
files created in nirspecfd (in your reduction folder) 
set arc1 to the closest arc file taken to your source 
or if using oh lines set the arc to the A frame of the
target. Leave arc 2, reference arc and ref spec map 
blank set nod 1 and nod 2 to the AB frames of your 
source

on right side:
make the entries blank, spat.map.cal, spec.map.cal
are useful in a different context and not in the
first reduction for a given set of data.
set nod 1 and nod 2 to the AB frames of your A0 V star
set T_eff to 9480

spatmap:
First ascertain which orders you are looking at by using the
efs to simulate the same slit, filter and x-dispersion. Select 
the echelle order by clicking above and below the tracing 
standard, and keep the default options. It is less important in
this step to ensure accuracy in selection, and more important
to select all of the order's information.

specmap:
Options, these are less set in stone and more of guidelines. 
The line fit order can vary between 1-3. First off click on display
arc lamp fit. Then after clicking on an line to fit, judge from the
plot that shows up which line fit order is best to use. Usually,
there is some curvature so line fit order 2-3 is often used. 
Set fit height to 6 and fit width = 13. In general for this type
of reduction in N3/N7 the fit height is not chanced very often.
Fit width is often changed, based on two criteria, one is how well
the arc lamp fit graph aligns, and the other is just to select
the proper portion of the line. If a line is too thin and close to
a secondary line, it can be difficult to select the correct one. In
this case lower the fit width, and click on the line at different 
heights. Lambda fit order is set to the lowest error that can be
achieved without going so low as to 0 out all the error by choosing
for example a 2nd order fit, when there are only 3 points as the low
error comes from needing 3 points just to define a 2nd order fit
rather than an accurate fit. The goal here is to get as many oh or
arc lamp lines matched as possible without compromising the error.
Usually including the maximum number of lines is optimal, but 
in some cases, it is better to have less lines for a better
increase in accuracy, however the more lines fit, means that you
are using more of the data available. 

redspec:
standard extraction - increase the contrast with sliders usually
when the contrast is maximum allows you to select more accurately. 
center the lines on standard trace, then reduce clip height until dashed 
lines just cover trace. Its okay when on maximum contrast to make the
clip height slightly within colored areas. The centering and keeping
the clip height low are the two most important parts. source extraction 
- same, but you can make the clip height smaller (but no smaller than 
~5) the resulting data file is tar.dat

tricks:
- Take screenshots when using the efs. This lets you more accurately 
place the arc lines in specmap.
- when reducing a second nod pair, simply copy the files from one 
folder to the next and change just the relevant data files in parfile.  
and as long as you are using the same arc and standard, you can skip 
spatmap and specmap

No comments:

Post a Comment