The spectrograph slits in CASPIR are machined slots in separate thin metal plates, and as such are expected to vary slightly in width along their lengths. The sensitivity variations introduced by these width variations are partially removed by the flatfield correction, but the flatfield frames also potentially suffer from non-uniform illumination by the flatfield lamp. Geometrically transformed spectral images of blank sky are needed to accurately define the illumination profile of the spectrograph slit. These frames can be formed from spectroscopic observations of the twilight sky for each grism and through each slit used, or by combining deep off-source sky measurements taken as program observations.
Slit illumination correction images for each long-slit grism are formed from geometrically transformed sky frames, or comparison frames in the case of twilight sky measurements, using the cspgillum task, which calls the noao.twodspec.illum task. The inputs required are a list of the base names of the SKY frames, and the base name of the output illumination files. For example,
cspgillum @skyfiles illum_k
The output illumination function file names are formed by appending .ill to the specified output base name.
The cspgillum task has the parameters listed below. The comb_opt parameter defines the way in which the individual sky frames in the list are combined. comb_opt should be average if the number of sky images is less than about 5 and median if greater than about 5. The statsec parameter defines the image section within the sky frame over which the illumination profile is computed. This should be set to the region of the image illuminated by the spectrum.
I R A F
Image Reduction and Analysis Facility
PACKAGE = caspir
TASK = cspgillum
skies = @skyfiles List of base sky frame names
illfile = illum_k Output illumination frame
(comb_op= average) Type of combine operation
(statsec= [1:230,*]) Image section for computing profile
(verbose= yes) Verbose output?
(imglist= )
(mode = ql)
You are asked Determine illumination interactively for illfile.ill (yes):. Answering yes to this question causes an average spectrum to be plotted in the graphics display. You are required to mark the range of the bin that will be used for determining the average profile along the spatial direction. The default is to use the entire spectrum, but this can be changed using cursor commands in the graphics display window. The available commands are listed below. Type q to proceed to fitting the spatial profile.
Set Illumination Bins ? Print options i Clear the sample ranges q Exit interactive curve fitting s Set bins with the cursor I Interrupt task immediately The parameters are listed or set with the following commands which may be abbreviated. To list the value of a parameter type the command alone. :bins value Illumination bins :show Show the values of all the parameters
You are then asked the question Determine illumination interactively for illfile.ill[1:230,*] at bin 1 (yes):. Answer yes to this question and the spatial profile is plotted in the graphics display window. A fit to the profile is made using the IRAF icfit task. The parameters of the fit can be changed interactively using the interactive curve fitting cursor commands listed below. Type d to delete a point. Type f to perform the fit. Type r to redraw the graph. The fitting function can be changed by typing, e.g., :function chebyshev. The order of the fit can be changed by typing, e.g., :order 2. The number of samples being averaged to form the fitted data can be changed by typing, e.g., :naverage 2. The values of all fit parameters can be seen by typing :show. Type q to exit the interactive curve fitting task when a suitable fit has been obtained.
1. INTERACTIVE CURVE FITTING CURSOR OPTIONS
? Print options
a Add point to constrain fit
c Print the coordinates and fit of point nearest the cursor
d Delete data point nearest the cursor
f Fit the data and redraw or overplot
g Redefine graph keys. Any of the following data types may be along
either axis.
x Independent variable y Dependent variable
f Fitted value r Residual (y - f)
d Ratio (y / f) n Nonlinear part of y
h-l Graph keys. Defaults are h=(x,y), i=(y,x), j=(x,r), k=(x,d), l=(x,n)
o Overplot the next graph
q Exit the interactive curve fitting. Carriage return will also exit.
r Redraw graph
s Set sample range with the cursor
t Initialize the sample range to all points
u Undelete the deleted point nearest the cursor
w Set the graph window. For help type 'w' followed by '?'.
x Change the x value of the point nearest the cursor
y Change the y value of the point nearest the cursor
z Delete sample region nearest cursor
I Interrupt task immediately
2. INTERACTIVE CURVE FITTING COLON COMMANDS
The parameters are listed or set with the following commands which may be
abbreviated. To list the value of a parameter type the command alone.
:show [file] Show the values of all the parameters
:vshow [file] Show the values of all the parameters verbosely
:xyshow [file] Show the x, y fit, and y data values
:errors [file] Print the errors of the fit (default STDOUT)
:function [value] Fitting function (chebyshev, legendre, spline3, spline1)
:grow [value] Rejection growing radius
:naverage [value] Sample averaging or medianing window
:order [value] Fitting function order
:low_reject [value] Low rejection threshold
:high_reject [value] High rejection threshold
:niterate [value] Number of rejection iterations
:sample [value] Sample ranges
:markrej [value] Mark rejected points?
Additional commands are available for setting graph formats and manipulating
the graphics. Use the following commands for help.
:/help Print help for graph formatting option
:.help Print help for general graphics options
3. INTERACTIVE CURVE FITTING GRAPH KEYS
The graph keys are h, i, j, k, and l. The graph keys may be redefined to
put any combination of axes types along either graph axis with the 'g' key.
To define a graph key select the desired key to redefine and then specify
the axes types for the horizontal and vertical axes by a pair of comma
separated types from the following:
d Ratio (y / f)
f Fitted values
r Residuals of fit (y - f)
n Nonlinear part of data (linear component of fit subtracted)
x Indepedent variable
y Dependent variable (data being fit)
The object, sky, and comparison images for a dataset can be corrected for non-uniform slit illumination by setting the illumination flag in redgspec, and setting the illfile parameter to the appropriate illumination correction base filename. A typical redgspec parameter list for applying the slit illumination correction in the file illum_k to the spectrum with the base name sp175 is shown below.
I R A F
Image Reduction and Analysis Facility
PACKAGE = caspir
TASK = redgspec
(images = @tfiles) List of CASPIR input images to reduce
(spectru= sp175) Base name of spectrum file
(linear = no) Linearize data?
(combine= no) Combine individual 2D spectra?
(flatten= no) Divide by flatfield?
(fixbad = no) Fix known bad pixels?
(clean = no) Interactively clean additional pixels?
(transfo= no) Geometrically transform and subset?
(illumin= yes) Correct non-uniform slit illumination?
(extract= no) Extract 1D spectra?
(fluxcal= no) Flux calibrate spectra?
(flatdiv= no) Divide by flat spectrum star?
(plot = no) Plot spectrum?
(bias = bias) Bias frame to use
(dark = dark180) Dark frame to use
(obstype= osso) Type of observation made
(zerosec= [190:195,10:90]) Zero level image section
(flatfil= flat_k) Flatfield frame to use
(badfile= caspirdir$grism) Bad pixel file
(badtype= interp) Type of bad pixel correction
(illfile= illum_k) Illumination frame to use
(reffile= ) Comparison extraction reference file
(fluxspe= ) Flux calibration spectrum to use
(flatspe= ) Flat spectrum star file to use
(verbose= yes) Verbose output?
(imglist= )
(mode = ql)