Spectra Reduction

For spectra reduction you should have there basic image types:

1. science frame, 2. calibration lamp, 3. continuum lamp, flat fiels

\

LEFT: science frame, MIDDLE: calibration lamp, RIGHT: continuum lamp, flat fiels

1. RESPONSE

A response calibration, is created foreach input image, normally a quartz spectrum. The response calibration is formed by dividing the calibration image by anormalization spectrum which is the same at all points along the spatial axis. The normalization spectrum is obtained by averagingthe normalization image across the dispersion to form a one dimensional spectrum and smoothing the spectrum by fitting a function. The threshold value does not apply to creating orfitting of the normalization spectrum but only the final creation of the response values. When normalizing (that is dividing thedata values by the fit to the normalization spectrum) only pixelsin which both the fitted normalization value and the data value areabove the threshold are computed. If either the normalizationvalue or the data value is below the threshold the output response value is one.

Is done using the continuum lamp. The illumination of the lamp is not even. This has to corrected before using it for data reduction.

Go to noao/imred/kpnoslit

Added to header DISPAXIS=1 using

hedit [file_name] DISPAXIS 1 add+

Run response :

calibrat= Longslit calibration images put here name of the file of the flat field

normaliz= Normalization spectrum images put here AGAIN name of the file of the continuum lamp

response= Response function images name of the output RESPONSE image

(interac= yes ) Fit normalization spectrum interactively?

(thresho= INDEF) Response threshold

(sample = *) Sample of points to use in fit

(naverag= 1) Number of points in sample averaging

(functio= legendre ) Fitting function

(order = 1) Order of fitting function

(low_rej= 3 ) Low rejection in sigma of fit

(high_re= 3 ) High rejection in sigma of fit

(niterat= 1) Number of rejection iterations

(grow = 0.) Rejection growing radius

(graphic= stdgraph) Graphics output device

(cursor = ) Graphics cursor input

(mode = ql)

response calibrat= Flat.fits

normaliz= Flat1_cut.fits

Type :go and the program will ask if you want to fit interactively. Answer yes. Now you need to fit the dash line to the curve. Change orders by typing :order 15 and press f to fit. You should see dahed line to move towards the curve. If it is not perfect change order. When ready press q to quit.

The results should look like that:

3. Illumination

An illumination calibration, is created for each longslit calibration image. The illumination calibration is determined by fitting functions across the slit (the slit profiles) at a number of points along the dispersion, normalizing each fitted function to unity at the center of the slit, and interpolating the illumination between the dispersion points. The fitted data is formed by dividing the dispersion points into a set of bins and averaging the slitprofiles within each bin. The interpolation type is a user parameter.

images = response.fits Longslit calibration images put here name of the file of the response

illumina= illum.fits Illumination function images put here name of the file of the output illumination file

(interac= yes ) Interactive illumination fitting?

(bins = ) Dispersion bins

(nbins = 5) Number of dispersion bins when bins = ""

(sample = *) Sample of points to use in fit

(naverag= 1) Number of points in sample averaging

(functio= legendre ) Fitting function

(order = 1) Order of fitting function

(low_rej= 0.) Low rejection in sigma of fit

(high_re= 0.) High rejection in sigma of fit

(niterat= 1) Number of rejection iterations

(grow = 0.) Rejection growing radius

(interpo= poly3) Interpolation type

(graphic= stdgraph) Graphics output device

(cursor = ) Graphics cursor input

(mode = ql)

For First plot just press q. Next it will ask if you want ot determine illumination interactively for image at bin 1. Answer yes. Then change the order by typing :order 25 and then fit by pressing f. If read press q. Then it will do it for bin 2,3,4, and 5. All should be very similar.

The results should look like that:

2. Fixing response

Use ccdproc again, fix your response image with the illumination, the output of it will be reduced flat field image

ccdproc response.fits illumcor=yes illum=illum.fits

This is how it should look the final flat field

2. Master flat

If you have more then 1 flat the calculate average

combine [input images] [output images] combine=average lsigma=3.0 hsigma=3.0 reject=avsigclip plfile=badpix

q science

3. Fixing calibration and science frames

For calibration spectrum you have to use illumination image apart from the normal flat field

ccdproc calibration.fits flatcor=yes flat=flat_reduced.fits illumcor=yes illum=illum.fits

For science spectrum you have to use only flat field

ccdproc science.fits flatcor=yes flat=flat_reduced.fits

4. Background

For each line or column in the input images a function is fit to the columns or lines specified by the sample parameter. This function is then subtracted from the entire line or column to create an output line or column.

Go to kpnoslit

input = science_corrected.fits Input images to be background subtracted

output = science_background.fits Output background subtracted images

(axis = 1) Axis along which background is fit and subtracted 1 background substracted along lines, 2 along columns

(interac= no ) Set fitting parameters interactively?

(sample = 600:700,750:800 ) Sample of points to use in fit look at your sepctra and find ~30 columns on each side of the object spectrum, it defines the area where the background is measured

(naverag= -5 ) Number of points in sample averaging

(functio= legendre ) Fitting function

(order = 3 ) Order of fitting function

(low_rej= 3 ) Low rejection in sigma of fit

(high_re= 3 ) High rejection in sigma of fit

(niterat= 1) Number of rejection iterations

(grow = 0.) Rejection growing radius

(graphic= stdgraph) Graphics output device

(cursor = ) Graphics cursor input

(mode = ql)

This is how it should look after background substraction

5. Extract 1 dimension spectra

To have 1 dimention sperctra call command apall

input = science_background.fits List of input images

(output = science_1d.fits ) List of output spectra

(apertur= ) Apertures

(format = multispec) Extracted spectra format

(referen= ) List of aperture reference images

(profile= ) List of aperture profile images

(interac= yes) Run task interactively?

(find = yes) Find apertures?

(recente= yes) Recenter apertures?

(resize = no) Resize apertures?

(edit = yes) Edit apertures?

(trace = yes) Trace apertures?

(fittrac= yes) Fit the traced points interactively?

(extract= yes) Extract spectra?

(extras = yes) Extract sky, sigma, etc.?

(review = yes) Review extractions?

(line = 100) Dispersion line this is line at which specturm should be search for, pick the lien where speactrum is the brightes

(nsum = 30) Number of dispersion lines to sum or median this is the number of lines around the center that will be used to look for spertrum

# DEFAULT APERTURE PARAMETERS

(lower = -5.) Lower aperture limit relative to center

(upper = 5.) Upper aperture limit relative to center

(apidtab= ) Aperture ID table (optional)

# DEFAULT BACKGROUND PARAMETERS

(b_funct= chebyshev) Background function

(b_order= 1) Background function order

(b_sampl= -10:-6,6:10) Background sample regions

(b_naver= -3) Background average or median

(b_niter= 0) Background rejection iterations

(b_low_r= 3.) Background lower rejection sigma

(b_high_= 3.) Background upper rejection sigma

(b_grow = 0.) Background rejection growing radius

# APERTURE CENTERING PARAMETERS

(width = 5.) Profile centering width this is the width of spectrum

(radius = 10.) Profile centering radius this is error raduis

....

# TRACING PARAMETERS

(t_nsum = 10) Number of dispersion lines to sum

(t_step = 10) Tracing step

(t_nlost= 3) Number of consecutive times profile is lost before quitting

(t_funct= legendre) Trace fitting function

(t_order= 2) Trace fitting function order

(t_sampl= *) Trace sample regions

(t_naver= 1) Trace average or median

(t_niter= 1) Trace rejection iterations

(t_low_r= 3.) Trace lower rejection sigma

(t_high_= 3.) Trace upper rejection sigma

(t_grow = 0.) Trace rejection growing radius

# EXTRACTION PARAMETERS

(backgro= none) Background to subtract

(skybox = 1) Box car smoothing length for sky

(weights= variance) Extraction weights (none|variance)

(readnoi= ) Read out noise sigma (photons) fil those two in adequatly

(gain = ) Photon gain (photons/data number)

FINDING SPECTRUM

Run the apall, answer yes to the question of finding apertures, then answer 1 for how many spectra it should find (unless you have more), and type yes for editing apertures, you will see a image (see LEFT). If the spectrum has been found it will be marked 1, if not you have to do it manually, by pointing with the mouse and pressing m. When the spctrum is marked press q.

TRACING SPECTRUM

Answer 3 times yes to aperture tracing, to aperture tracing interactively and to interactive fitting. Change order bu typing :order 4 and then f for fit. If there are point that don't fit delet them by pointing on it and pressing d. Iterate util dash line fits to points, when ready press q. Answer 3 times yes for writing the apertures, for extracting and reviewing spectrum. To exit press q.

6.Calibration

I have added to header DISPAXIS=1 using

hedit file_name DISPAXIS 1 add+

identify name_of_calib_file

m -mark f- fit q-quite l- find rest of the lines

7. Final science calibration

hedit science_frame fields=calib_frame add+

Dispcor - calibrate the science frames

8. See the results:

splot science frame 1

9. Reduce standard star using cal.sol and sci.sof

10 Calculate standard star

standard

11. Calculate sensitivity

sensfunc

12 Flux Calibrate you sci spectra

calibrate

/Applications/scisoft/all/Packages/iraf/iraf/noao/lib/onedstds/ctioextinct.dat

13 Combining spectra

scombine

14 To estimate the redshift extract spectra into text file

wspectext

header=no