9. Appendix

9.1. Appendix A: the stellar templates

9.1.1. The Pickles templates

The Stellar templates for stars of different spectral type/class SIPGI provides for LUCI flux calibration are listed in the following Table (credits to ESO - Pickles, 1998).

a0i.dat

b3v.dat

f6v.dat

k0iv.dat

m1v.dat

rg0v.dat

a0iii.dat

b57v.dat

8i.dat

k0v.dat

m2.5v.dat

rg5iii.dat

a0iv.dat

b5i.dat

f8iv.dat

k1iii.dat

m2i.dat

rg5v.dat

a0v.dat

b5ii.dat

f8v.dat

k1iv.dat

m2iii.dat

rk0iii.dat

a2i.dat

b5iii.dat

g0i.dat

k2i.dat

m2v.dat

rk0v.dat

a2v.dat

b6iv.dat

g0iii.dat

k2iii.dat

m3ii.dat

rk1iii.dat

a3iiisp.dat

b8i.dat

g0iv.dat

k2v.dat

m3iii.dat

rk2iii.dat

a3v.dat

b8v.dat

g0v.dat

k34ii.dat

m3v.dat

rk3iii.dat

a47iv.dat

b9iii.dat

g2i.dat

k3i.dat

m4iii.dat

rk4iii.dat

a5iii.dat

b9v.dat

g2iv.dat

k3iii.dat

m4v.dat

rk5iii.dat

a5v.dat

f02iv.dat

g2v.dat

k3iv.dat

m5iii.dat

wf5v.dat

a7iii.dat

f0i.dat

g5i.dat

k3v.dat

m5v.dat

wf8v.dat

a7v.dat

f0ii.dat

g5ii.dat

k4i.dat

m6iii.dat

wg0v.dat

b0i.dat

f0iii.dat

g5iii.dat

k4iii.dat

m6v.dat

wg5iii.dat

b0v.dat

f0v.dat

g5iv.dat

k4v.dat

m7iii.dat

wg5v.dat

b12iii.dat

f2ii.dat

g5v.dat

k5iii.dat

m8iii.dat

wg8iii.dat

b1v.dat

f2v.dat

g8iii.dat

k7v.dat

o5v.dat

wk1iii.dat

b1i.dat

f2iii.dat

g8i.dat

k5v.dat

m9iii.dat

wk0iii.dat

b2ii.dat

f5i.dat

g8iv.dat

m0iii.dat

o8iii.dat

wk2iii.dat

b2iv.dat

f5iii.dat

g8v.dat

m0v.dat

o9v.dat

wk3iii.dat

b3i.dat

f5iv.dat

k01ii.dat

m10iii.dat

rf6v.dat

wk4iii.dat

b3iii.dat

f5v.dat

k0iii.dat

m1iii.dat

rf8v.dat

The sampling is at 5 Angstrom. The templates are in vacuum. The conversion from air to vacuum wavelength has been performed by the PyAstronomy library using the Edlen (1953) and Ciddor (1996) prescriptions. The syntax for the filenames is as follows: xxy.dat where xx is the spectral type in lower case letter (e.g. a0, g5), and y the luminosity class in roman lower case letters (i,ii, iii, iv, v) (credits to ESO - Pickles, 1998).

The typical Stellar template must contain two columns and have a constant sampling: wavelength (Angstrom), fluxes per wavelenght unit (arbitrary units), plus an arbitrary header on top of the file.

9.1.2. The spectro-photometric standards

The Spectro-photometric standards SIPGI provides for MODS flux calibration (credits LBTO).

G191-B2B

GD 71

Feige 34

Feige 66

Feige 67

GD 153

Hz 43

Hz 44

BD+332642

BD+284211

Feige 110

The sampling is at 10 Angstrom. The spectra are in vacuum.

Note

G191-B2B is an HST primary white dwarf star; GD71 is an HST primary white dwarf standard stars. The NIR extension is based on HST model spectrum; Feige 66 has only relatively low-quality near-IR extension data, and should only be used in the blue or out to about 9200Å GD153 is an HST primary white dwarf star. The NIR extension is based on the HST fluxes shifted by -0.02mag. Hz 43 is an HST primary white dwarf star. The NIR extension is based on the HST model spectrum. A faint binary M-dwarf companion, Hz43B (V=14.3), is located 3-arcsec away, so this star is not recommended during poor seeing. BD+28 4211 has a faint red companion 2.8-arcsec away, and is only recommended for use in the blue channel in good seeing (credits LBTO).

The typical Spectro-photometric standard must be composed by three columns: wavelength (Angstrom), magnitude or fluxes, sampling, plus an arbitrary header on top of the file.

9.2. Appendix B: keywords necessary to SIPGI to import and categorize raw data

9.2.1. LUCI

The list of keywords that must be correctly filled in LUCI data for a successful import of raw frames. Old version indicates the name of the keyword in old files.

Keyword

Old version

CAMERA

CAMNAME

CD1_1

CROTA1

CD1_2

CDELT1

CD2_1

CD2_2

CRPIX1

CRPIX2

CRVAL1

CRVAL2

CTYPE1

CTYPE2

DATE-OBS

DATATYPE

IMAGETYP

EXPTIME

FILENAME

FILTER1

FILTER2

FRAMENUM

GAIN

ELECGAIN

LBTO LUCI DET EGAIN

GRATNAME

GRATWLEN

INSTRUME

LAMP1

STATLMP1

LAMP2

STATLMP2

LAMP3

STATLMP3

LAMP4

STATLMP4

LAMP5

STATLMP5

LAMP6

STATLMP6

MASKID

MASKNAME

MASKSLOT

MOSPOS

NAXIS1

NAXIS2

OBJECT

OBJRA

OBJDEC

PI_NAME

PIXSCALE

POSANGLE

TELRA

TELDEC

LUCI MOS MASK

MOS??DEC

Only MOS case

MOS??RA

Only MOS case

MOS??SHA

Only MOS case

MOS??XPO

Only MOS case

MOS??YPO

Only MOS case

MOS??LMM

Only MOS case

MOS??WMM

Only MOS case

TGT??dNAM

Only MOS case

9.2.2. MODS

The list of keywords that must be correctly filled in MODS data for a successful import of raw frames.

CALIB

CALLAMPS

CHANNEL

DATE-OBS

DICHNAME

IMAGETYP

EXPTIME

FILENAME

FILTNAME

FRAMENUM

GRATNAME

INSTRUME

MASKNAME

OBJECT

PI_NAME

PIXSCALE

POSANGLE

NAXIS1

NAXIS2

TELRA

TELDEC

CCDXBIN

CCDYBIN

9.3. Appendix C: error propagation on 1D and 2D spectra

9.3.1. Error on preliminary reduced frames

For each raw frame, the Preliminary Reduction recipe estimates the error on the pixel (i,j) of the final pre-reduced frame as:

\[E_{i,j} = \frac{\sqrt{(d_{i,j} \cdot gain + ron^2)}}{gain},\]

where:

  • \(d_{i,j}\) is the pixel value in LUCI reduction or the pixel value bias subtracted in MODS reduction;

  • gain is the detector GAIN in [e-/ADU];

  • ron is the Read Out Noise in [e-].

If in the pre-reduction of LUCI frames a Master Dark is provided, the recipe estimates the error on the input Master Dark as:

\[E_D = rms(D) \cdot \sqrt{gain},\]

where \(rms(D)\) is:

\[rms(D) = \sqrt{\frac{\sum_i^N\sum_j^M(D_{i,j}-\bar{D})^2}{MN-1}},\]

and \(D_{i,j}\) is the values of the (i,j)th pixel of the Master Dark, (N,M) the Master Dark dimension in [px] and \(\bar{D} = \frac{1}{NM}\sum_i^N\sum_j^M D_{i,j}\). In this case, the final error of the pre-reduced frame dark subtracted is:

\[E_{i,j}^{'} = \sqrt{E_{i,j}^2 + E_D^2}.\]

9.3.2. Error on reduced frames

The error on the reduced frames largely depends on the type of slit, i.e. distorted or un-distorted, and on the sky subtraction methods.

9.3.2.1. Error for un-distorted slits in reduced frames.

For un-distorted slits, the first operation performed by the Reduce Observation recipe is the sky subtraction. Starting from the prereduced frames, the error on each pixel (i,j) of the sky-subtracted image is:

\[E_{SKYSUB,i,j} = \sqrt{E_{i,j}^2 + E_{SKY}^2}\]

where, here and after, \(E_{i,j}\) is replaced by \(E_{i,j}^{'}\) if the pre-reduced frames are dark subtracted, and \(E_{SKY}\) depends on the sky methods. In particular:

  • sky method median

\[E_{SKY} = \frac{\sqrt{\sum_j E_{i,j}^2}}{N}\]
  • sky method fit/wfit: in case of weighted fit (wfit), the recipe estimates the weights as:

\[w_{j}=\frac{1}{E_{i,j}^2},\]

then estimates the weighted fit and computes the chi^2:

\[\chi^2=\sum_jw_j\left(\bar{d}_{i,j}-\hat{d}_{j}\right)^2,\]

where \(\bar{d}_{i,j}\) is the pixel value of the pre-reduced image, and \(\hat{d}_j\) is the value of the weighted fit at the jth pixel.

The final error is:

\[E_{SKY} = \sqrt{\frac{\chi^2}{N-M-1}},\]

In case of a simple fit \(w_{j}\) = 1.

  • sky method ABBA:

\[E_{SKY} = E_{i,j}\]

where \(E_{i,j}\) is the pixel error of the frame that is subtracted.

  • sky method ABBA + median/fit/wfit: if different sky mehods are combined, the relative errors are added in quadrature.

After the sky subtraction, the recipe rectifies the spectra with the wavelength calibration and extract the 2D spectra. The error on the rectified EXR2D is:

\[E_{EXR2D,i,j} = E_{RESAMPLE,i,j},\]

where \(E_{RESAMPLE,i,j}\) is obtained resampling the error of the input pixels (for more details see \(r_e(\lambda)\) in Appendix D).

The final step is the extraction of 1D spectra. SIPGI offers two possibilities for the spectra extraction: the sum and the Horne extraction. The error associated to the 1D spectra is:

\[E_{EXR1D,i} = \sqrt {\sum_j E_{EXR2D,i,j}^{2}}\]

where the sum is extended to all the jth pixels of the detected object. In case of a Horne extraction, \(E_{EXR1D,i}\) is the error on a weighted sum.

9.3.2.2. Error for distorted slits in reduced frames.

In the reduction of the distorted slit, the first operation is the extraction of the EXR2D. The error associated is:

\[E_{EXR2D,i,j} = E_{RESAMPLE,i,j}.\]

After the extraction of 2D spectra the recipe performs the sky subtraction, and the relative error is:

\[E_{SKYSUB,i,j} = \sqrt{E_{EXR2D,i,j}^2 + E_{SKY}^2},\]

where \(E_{SKY}\) depends on the sky subtraction method as above:

  • sky method median

\[E_{SKY} = \frac{\sqrt{\sum_j E_{EXR2D,i,j}^2}}{N}\]
  • sky method fit/wfit: in case of weighted fit (wfit), the recipe estimates the weights as:

\[w_{j}=\frac{1}{E_{EXR2D,i,j}^2},\]

then estimates the weighted fit and computes the chi^2:

\[\chi^2=\sum_jw_j\left(d_{i,j}^{*}-\hat{d}_{j}\right)^2,\]

where \(d_{i,j}^{*}\) are the pixel values of the EXR2D image, and \(\hat{d}_j\) is the value of the weighted fit at the jth pixel.

The final error is:

\[E_{SKY} = \sqrt{\frac{\chi^2}{N-M-1}},\]

In case of a simple fit \(w_{j}\) = 1.

  • sky method ABBA:

\[E_{SKY} = E_{EXR2D,i,j}\]

where \(E_{EXR2D,i,j}\) is the pixel error of the EXR2D subtracted image.

  • sky method ABBA + median/fit/wfit: if different sky methods are combined, the relative errors are added in quadrature.

For the distorted slits the DAVIES method is also provided for the sky subtraction but in this version of SIPGI no error propagation is implemented in this case.

The final step is the extraction of the 1D spectra that follow the same scheme of un-distorted slits, i.e.:

\[E_{EXR1D,i} = \sum_j E_{SKYSUB,i,j},\]

where the sum is extended to all the jth pixels of the detected object. In case of a Horne extraction, the error is a weighted sum.

9.3.3. Error on combined frames

The error on the (i,j)th pixel of the image obtained combining N frames together is:

\[E_{COMB,i,j} = \frac{\sqrt{\sum_k^N e_{i,j,k}^2}}{N}\]

where \(e_{i,j,k}\) is the error of the (i,j)th pixel in the (k)th frame.

9.4. Appendix D: 2D spectra extraction and resampling

The 2D extraction procedure is basically an image warping process and it involves a re-sampling function: the process of transforming the raw spectra from one coordinate system described by the models (OPT, CRV and IDS), to another where the spectra are perfectly rectified and wavelength calibrated.

SIPGI goes along the slices used during the Master Lamp creation (see Fig. 7.5), moving in the coordinates system defined by the 3 models. For each slice and for each wavelength value of the extraction range, it computes the re-sampled flux value \(r_f(\lambda)\) and error \(r_e(\lambda)\) of the 2D spectrum.

The recipe computes the re-sampling using a filter derived from exponential functions; the library defines a low-pass filter in the Fourier space, using the \(C^{\infty}\) function defined by:

\[H_s(f)=\tanh\frac{s\cdot(f + 0.5) + 1}{2}\tanh\frac{s \cdot(-f + 0.5) + 1}{2}.\]

The parameter \(s\) defines the sharpness of the filter and SIPGI uses \(s=5\). The value 0.5 is the cut-off frequency to conform to the Nyquist rate. The actual 1D re-sampling kernel in the image domain, is obtained computing the inverse Fourier transform of \(H_s(f)\). This gives us the \(h_k(x)\), as shown in Fig. 9.1.

_images/kernel_1d.png

Fig. 9.1 On the left side the \(H_5(f)\) spectrum in the Fourier space. On the right side the \(h_5(x)\) kernel profile in the image domain, obtained by the inverse fast Fourier transform of \(H_5(f)\).

Since the extraction procedure works with 2D images, the 2D re-sampling kernel \(w\) is obtained by combining 2 separate 1D kernels along the 2 orthogonal axes \(x\) and \(y\)

\[w_s(x,y) = h_s(x)\cdot h_s(y).\]

The shape of the 2D re-sampling kernel \(w_5\) is shown in the figure Fig. 9.2.

_images/kernel_2d.png

Fig. 9.2 In this figure is shown the shape of the \(w_5\) 2D kernel with a radius 2 pixels large.

The 2D extraction process, for each slice and each \(\lambda\), follows these steps:

  • the 3 models are used to find the point where the re-sampling kernel must be applied, i.e. the models get the center of the \(w_5\) kernel (red dot in the Fig. 9.3);

  • SIPGI collects 16 pixels covered by the the 4x4 pixels box (green pixels in the Fig. 9.3);

    _images/kernel_box.png

    Fig. 9.3 The yellow pixels represent the image pixels; the red dot is the kernel center computed by the models; the blue pixels are the 4x4 kernel box.

  • the re-sampled flux value \(r_f(\lambda)\) is computed by the formula

    \[r_f(\lambda)=\frac{\sum_{x,y}p(x,y)w_5(x,y)}{\sum_{x,y}w_5(x,y)}\]
  • The error propagation is compute resampling the errors on pixels in the 4x4 box in the same away

\[r_e(\lambda)=\frac{\sum_{x,y}p_{err}(x,y)w_5(x,y)}{\sum_{x,y}w_5(x,y)}.\]

These steps will be repeated for each re-sampled values and packed into a final spectrum to obtain a wavelength calibrated spectrum corrected by distortions.

9.5. Appendix E: bad pixels correction and cosmic rays cleaning

The bad pixels correction is performed interpolating the good pixels values around the bad pixel. The same algorithm is used to clean the cosmic rays.

Here the recipe step by step, using as example a cluster of 4 bad pixels (A, B, C and D) illustrated in the Fig. 9.4:

  • The recipe starts from the bad pixel to correct (B in the example) and it moves along the 4 cardinal directions (North-South, East-West, NorthEast-SouthWest and NorthWest-SouthEast) to find the first good pixels available. The good pixels found in the example are the orange pixels.

  • For each direction the recipe should found 2 good pixels: one before (\(d_b\)) and one after (\(d_a\)) the bad one.

  • If both pixels are found the algorithm computes the weighted mean of the two values, using as weights (\(w_b\) and \(w_a\)) the distances of the \(d_b\) and \(d_a\) pixels from the bad pixel.

\[m_k = \left({\frac{d_b}{w_b}+\frac{d_a}{w_a}}\right)/ \left({\frac{1}{w_b}+\frac{1}{w_a}}\right), k=0,1,2,3\]
  • On the edges of the frame, the weighted mean along some direction could not be computed because some good pixel candidate could be out of frame. For this reason, we can have less then 4 weighted means. For the example of the pixels B the recipe will found only 3 good \(m_k\) values (along the E-W, NE-SW and NW-SE directions) since the pixel after the bad one in the N-S direction falls out of frame.

  • The final value of the bad pixel is median of all available \(m_k\) values

_images/bad_pixels.png

Fig. 9.4 An example of the bad pixel treatment. The yellow pixels represent the image pixels. The gray pixels are a cluster of 4 bad pixels (A, B, C, and D). The orange pixels are the good pixels used by the recipe to correct the central bad pixel B.