Äîêóìåíò âçÿò èç êýøà ïîèñêîâîé ìàøèíû. Àäðåñ îðèãèíàëüíîãî äîêóìåíòà : http://www.eso.org/sci/libraries/SPIE2010/7737-85.pdf
Äàòà èçìåíåíèÿ: Tue Aug 10 17:44:08 2010
Äàòà èíäåêñèðîâàíèÿ: Sun Sep 12 13:52:28 2010
Êîäèðîâêà:

Ïîèñêîâûå ñëîâà: eit
The X-sho oter pipeline
Andrea Mo digliania , Paolo Goldonib ,c Frederic Royerd , Regis Haigrond , Laurent Guglielmib , Patrick Fran¸oisd , Matthew Horrobine , Paul Bristowa , Jo el Verneta , Sabine Mo ehlera , Florian c Kerbera , Pascal Ballestera , Elena Masonf , Lise Christenseng . European Southern Observatory, ESO, Karl Schwarzschild-Str. 2a, D-85748, Garching, Germany; Laboratoire AstroParticule et Cosmologie, 10 rue A. Domon et L. Duquet,75205 Paris Cedex 13, France; c DSM/IRFU/Service D'Astrophysique, CEA-Saclay, 91191 Gif-sur-Yvette, France; d GEPI/UMR 8111, Observatoire de Paris, 11 avenue M. Berthelot, 92195 Meudon Cedex, France; e Univ. zu K¨ln, Address, K¨ln, Germany; o o f Europ ean Southern Observatory, Alonso de Cordova 3107 Vitacura, Santiago, Chile; g Excellence Cluster Universe, Universit¨t Munchen, Boltzmann-str.2, 85748 Garching, a ¨ Germany.
ABSTRACT
The X-shooter data reduction pipeline, as part of the ESO-VLT Data Flow System, provides recipes for Paranal Science Operations, and for Data Pro duct and Quality Control Operations at Garching headquarters. At Paranal, it is used for the quick-lo ok data evaluation. The pipeline recipes can be executed either with EsoRex at the command line level or through the Gasgano graphical user interface. The recipes are implemented with the ESO Common Pipeline Library (CPL). X-shooter is the first of the second generation of VLT instruments. It makes possible to collect in one shot the full spectrum of the target from 300 to 2500 nm, subdivided in three arms optimised for UVB, VIS and NIR ranges, with an efficiency between 15% and 35% including the telescope and the atmosphere, and a spectral resolution varying between 3000 and 17,000. It allows observations in stare, offset mo des, using the slit or an IFU, and observing sequences no dding the target along the slit. Data reduction can be performed either with a classical approach, by determining the spectral format via 2D-polynomial transformations, or with the help of a dedicated instrument physical mo del to gain insight on the instrument and allowing a constrained solution that depends on a few parameters with a physical meaning. In the present paper we describe the steps of data reduction necessary to fully reduce science observations in the different modes with examples on typical data calibrations and observations sequences. Keywords: Astronomical Data Reduction, Echelle and IFU data reduction, Instrument Physical Mo delling.
a

b

1. INTRODUCTION
The Pipeline Systems Department of the Software Development Division at ESO is responsible for the development of instrument data reduction pipelines1 .2 Pipelines are used by Paranal and La Silla operations as quick-lo ok tools to do a real-time coarse assessment of the quality of calibrations and science observations. When the data arrive at ESO Garching (generally within one hour), a more thorough data processing and evaluation is performed by the Quality Control (QC) group. Here, the pipeline is used to automatically process raw calibration frames into master calibrations, generate quality control parameters in order to monitor the telescope, instrument, and detector performance, and to assess the quality of the calibrations and science observations.3
Further author information: (Send corresp ondence to A.M.) A.M.: E-mail: amodigli@eso.org, Telephone: +49 (0)89 320 06 789
!"#$%&'()%* !,$%'(-).#/ 0(%'($1-$#2 3%)4$##$#2 '.5 0*#($6# 7772 $5-($5 "* 8'&-5 9: 0-;&'2 <;-#). =: 3$4>2 =: ?@)6'# 0)-A$%2 3%)4: )A 037B C);: DDED2 DDEDFG H FIJI 037B K LLL 4)5$/ IFDDMDGNOPJIPQJG K 5)-/ JI:JJJDPJF:GRDFJJ 3%)4: )A 037B C);: DDED DDEDFGMJ
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


The X-shooter pipeline is based on the data reduction library developed by the X-sho oter consortium with contributions from France, The Netherlands and ESO.4 Finally, the pipelines are also released to the public to allow any instrument or archive user to do a data reduction optimised to their science case. The X-shooter pipeline as well as other VLT instrument pipeline releases are publicly available at www.eso.org/pipelines. X-sho oter is a single target spectrograph for the Cassegrain fo cus of Kueyen. It is the first of the second generation instruments at the ESO Very Large Telescope. The instrument covers in a single exposure the spectral range from the UV to the K band (300-2500 nm). It is designed to maximize the sensitivity in this spectral range through the splitting in three arms (UVB, VIS, NIR) with optimised optics, coatings, dispersive elements and detectors. It operates at intermediate resolutions (R=3000-17,000, depending on wavelength and slit width) with fixed echelle spectral format (with prism cross-dispersers) in the three arms. The possibility to observe in a single shot at the sky limit faint sources with an unknown flux distribution has inspired the name of the instrument. At the entrance of each spectrograph there is a slit unit equipped with 11" long slits of different widths. The light coming from the telescope after the fo cus is directed to the UVB and VIS arms and transmitted to the NIR spectrograph cryostat by two dichroic in series. It is also possible to use an image slicer in the fo cal plane that reformats a 1.8"â4" field of view on the sky into a 0.6"â12" long slit. In slit mo de it is possible to correct atmospheric dispersion effects by inserting an ADC unit in the UVB and VIS arm optical paths. Flexures are actively compensated by piezo-controlled mirrors. X-sho oter started commissioning in November 2008, had Science Verifications in the summer 2009 and is operational since 1st October 2009.5

2. DATA REDUCTION MODES
The X-sho oter data reduction can be performed in two mo des: polynomial, where order centre and slit or ifu edges trace and the 2D transformation that allows removal of the order curvature and the spectral line tilt are expressed as small degree polynomials; physical model, where the position on the detector of any wavelength/slit position can be obtained using a physical mo del of the instrument characterized by several parameters that describe the orientations, locations and other physical properties of the optical components of the spectrograph.6 Both approaches are calibrated via the matching of lines observed in an arc lamp multi-pinhole exposure to catalogue wavelengths. In the case of the polynomial metho d, a low order polynomial is fit to obtain an empirical dispersion solution. A sufficient density of calibration lines is required in each order, the polynomial co efficients have no physical meaning and the fit cannot be reliably extrapolated far outside of the region where the lines were identified. Nevertheless, this is the classical, tried and tested approach, the formulation adopted describes well X-shooter's complex spectral format and the pipeline executes somewhat quicker in this mode. The physical mo del metho d, on the other hand, utilizes an optimisation algorithm to adjust parameters until the physical mo del, repro duces all the observed positions of the arc lamp lines simultaneously. This approach is less constrained by the local density of calibration lines and has some predictive power. Moreover, the parameters have physical meaning which make them useful for instrument monitoring and for understanding phenomena such as flexure7 and changing environmental conditions.3 Consequently this approach is used by QC.

3. X-SHOOTER DATA REDUCTION CHALLENGES
X-sho oter can observe simultaneously with three channels and generate three sets of frames for its UVB, VIS and NIR arms (see Fig. 1). In order to fully reduce a set of X-sho oter data, including calibration and science frames, the following data reduction problems need to be solved: If needed (after macro-Earthquake events) determine a proper instrument mo del configuration that describes the current X-sho oter spectral format.8 Determine the following detector quantities: bias, dark current, linearity and gain both globally and lo cally. Compute a global wavelength and slit calibration. Correct for instrument flexures. Perform the sky subtraction in all observation modes. 2D rectification. Optimal extraction. Efficiency and response determination. 3D cube reconstruction for observations in IFU mode. Error propagation and bad pixel flagging through all the relevant steps. The pipeline has to address all those challenges in a robust, automatic and accurate manner and provide not only products required to perform the full data reduction chain and analyse science data but also additional

3%)4: )A 037B C);: DDED DDEDFGMF
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


i%%IIE\ Iit

t%fl.Ij

Wi%*i$

%%%fl

Figure 1. This image displays left to right the XSH UVB, VIS and NIR sp ectral formats with different image scales.

products for quality control. This pipeline provides also a set of useful scripts to effectively check the accuracy of the main data reduction steps.

'

I

1

II \II*I*\IItll%I

\\

itI

4. DATA REDUCTION CASCADE
Initially the raw frames are prepared by trimming pre-scan and over-scan regions. In order to have a common spectral format layout and facilitate the following data reduction the data are re-oriented to the VIS raw data orientation. Two extensions are asso ciated with each frame, one containing the corresponding error image and the other a qualifier image flagging bad pixels of different nature. For each input raw frame, the error frame is calculated from the raw counts (transformed in electrons using read noise and gain) contained in each pixel. The error and bad pixel frames are propagated throughout the data reduction cascade.

4.1 Detector linearity characterization
For UVB and VIS arm, this recipe pro cesses a set of flat frames acquired with increasing exposure time and a set of bias frames and, for NIR arm, a set of lamp-on and lamp-off frames acquired with increasing detector integration time. In UVB and VIS arms, the intrinsic detector contribution can be removed by subtracting from each flat frame the master bias obtained by median stack-combine the bias frames while, in NIR arm, by subtracting from each flat lamp-on exposure the corresponding lamp-off one. Then, using the so-called Photon Transfer Curve (PTC) metho d, this data reduction step determines the range of exposure times and detector count levels within which the detector response can be considered linear. The locations of detector pixels that have a non-linear responsitivity are stored in a image, the non-linear bad pixel map. This recipe allows also to measure the detector gain that is proportional to the slope of the PTC. The non-linear pixels map is one of the most important maps to be included in the master bad pixel map used to reduce science NIR data.

4.2 Bias frames processing
UVB and VIS bias frames are median stack-combined and a master frame is butions from outlier counts via a standard kappa sigma clipping technique. lo cations are indicated in the corresponding bad pixel maps. For quality c the master bias fixed pattern noise and its X and Y structures (see Fig. 2, spectrum standard deviations after collapsation of the frame along Y and X determined with removal of contriLow counts and high counts pixels ontrol the detector read out noise, left), that are the collapsed frame direction, are determined.

4.3 Dark frames processing
UVB and VIS dark frames are not used in the data reduction, as the correction is very small, unless the user has very long exposure science observations. Dark frames are median stack-combined and a master frame is generated and normalized to one second exposure, with cosmic ray hits (CRHs) and noisy pixels flagging and removal via standard kappa sigma clipping technique. The noisy pixels and CRHs lo cations are stored in corresponding maps. Pro cessing the NIR master dark frame it is possible to determine the corresponding detector read out noise, the fixed pattern noise and the detector contamination. The noisy pixel map, in NIR arm, provides an important contribution to the master bad pixel map to be used for science data reduction.

3%)4: )A 037B C);: DDED DDEDFGME
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


Figure 2. On the left hand panel is shown a trend plot of the VIS arm master bias Y structure. On the right hand panel a trend plot of the average resolution of the 0.9x11 slit in NIR arm is shown.

4.4 Sp ectral format guess
This data reduction step uses a reference catalogue of selected arc lines and either a static guess table with the locations of the corresponding lines on the detector or the physical mo del configuration updated to the ambient conditions at the time the spectral format frame has been acquired. Then it lo cates the positions of emission lines on a one-pinhole arc lamp frame, previously bias corrected (UVB,VIS) or off-lamp frame corrected (NIR) via a 2D Gaussian fit. This operation determines a first guess of the instrument spectral format: the central order traces and a first guess dispersion solution that are stored in corresponding pro duct tables. In polynomial mo de tables containing polynomial co efficients that give a guess solution for the central order traces and the wavelength dispersion solution are generated; in physical model mode an order guess table and a table containing the physical model coefficients optimised on the spectral format frame are generated. Additional pro ducts, for quality control, are a table with the residuals measuring the accuracy of the solutions (see Fig. 4, upper panel), a sub list of the input line list with the identified lines and the bias/off-frame subtracted format-check frame that can be used to over-plot the found solutions for quality control. Using the script test data resid tab it is possible to generate regions files containing the lo cations of the predicted line positions that can be over-plot with ds9 to the format-check frame to verify the accuracy of the solutions (see Fig. 3.

Figure shown stored of the

3. On the left hand side panel line predictions sup erimp osed on a bias subtracted one-pinhole arc lamp frame are for quality control. On the right hand side panel the traces of the detected orders from the p olynomial solution in the order table sup erimp osed to a bias subtracted one-pinhole flat (continuum) lamp frame to check the accuracy order tracing step are shown. Both panels shows VIS arm data results.

3%)4: )A 037B C);: DDED DDEDFGMS
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


4.5 Order flat tracing
Using the information contained in the guess order table the centroids of each spectral pixel bin on a single pinhole flat lamp exposure are determined. This allows a more accurate determination of the order central trace. The residuals measuring the accuracy of the corresponding solution are generated for quality control (see Fig. 4, bottom panel) and for each order the statistics of count levels along the order trace are computed to eventually reveal frame saturation and monitor detector responsitivity. Using the script test data order it is possible to generate regions files containing the lo cations of the order traces that can be over-plot with ds9 on to the order position frame (see Fig. 3, right panel) to verify the accuracy of the order tracing.

Figure 4. On the upp er panel are shown the residuals corresp onding to the guess solution found analysing a UVB arm single pinhole arc lamp frame. On the b ottom panel are shown the residuals corresp onding to the central order trace solution for a UVB arm order definition flat frame .

4.6 Slit and IFU Flat analysis
From a series of spectroscopic flat field exposures a master frame is determined via median stack with CRHs removal. For quality control the flux of the raw flats is monitored to reveal frame saturation. The flat edges are traced using a threshold of the flux at the order center (see left panel of Fig. 5 for a slit mo de example). In IFU mo de also the IFU slice edges are traced using the Sobel edge detection metho d. These edge locations are fitted by polynomial expressions and stored in the order-edges table product. These positions are used to lo cate inter-order regions to estimate the background level and subtract a 2D linear spline (or a 2D polynomial) fitted on the counts measured at each sampling point (see Fig. 5, right panel). For the UVB arm two different flat field lamp frames (2 D and QTH) are used to have a well exposed combined master frame over all orders, which combines the first four bluest orders from the 2 D lamp frames and the others using the other lamp frames. Finally on the master flat frame the lo cations of dead and saturated pixels are determined and stored in corresponding maps.

4.7 Multi-pinhole frame data reduction
The guess arc lamp emission line positions coming from the format-check frame analysis (either polynomial solution or optimitized mo del configuration) are then used to lo cate via a 2D Gaussian fit the positions of each of the nine pinholes present in the input frame. The multi-pinhole line positions are used either to fit a global polynomial solution or to refine the instrument physical mo del configuration. This solution allows the determination of the pixel position (X, Y ) for a any traced order number m, wavelength and position along the slit s. Then the inverse polynomial solution is calculated, that allows the determination of the wavelength

i.i
3%)4: )A 037B C);: DDED DDEDFGMR
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms

Inc


Figure 5. A master slit flat frame with edges and central traces plots to check tracing accuracy (left). The count levels measured on sampling regions distributed along inter-order regions used to estimate the inter-order background are shown (right). The images refer to UVB arm data for which the master and the background frames are obtained combining corresp onding frames determined on two set of data, one using a 2 D lamp and the other using a QTH lamp exp osures.

and slit position as a function of the detector position (X, Y ). This information is used during science reduction to conserve flux when orders are rectified. Finally a wavelength and a slit map are generated either using the information from the latter polynomial expression or the physical mo del. The accuracy of this critical data reduction step can be checked for example using the script test xsh resid tab that generates a region file that can be over-plotted to the multi-pinhole arc lamp frame, or by plotting the residual of the found solution. In Figure 6 the detected lines pro jected on the multi-pinhole frame (upper panel) and the corresponding Y residuals (lower panel) are shown.

ru:

eee.i.ee

"iv",'

00

27.5

0.1

-0.0 -0.1
-0.2 -0.0
I

i1j

25
1-

I
I

-

22.5

I
20

-0.4

17.5

-05

5605806006206406606807007207407607080 820840860880900920940960980100010201040 W&085 560550

Figure 6. This image displays the detected lines pro jected on the multi-pinhole frame (upp er panel), and the corresp onding Y residuals (lower panel) .

3%)4: )A 037B C);: DDED DDEDFGMN
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


4.8 Slit and IFU Arc frames reduction
The input data are prepared, and master bias subtracted (UVB, VIS) or off-frame corrected (NIR). The resulting frames are divided by the master flat field. Then for each order, using the solution determined after pro cessing of the multi-pinhole frame, and a reference line catalogue, the center, FWHM and tilt of each detected line are computed. This data reduction step allows measurement of the line tilt and the instrument spectral resolution (see Fig. 2, right panel).

4.9 Instrument flexure measurement and correction
X-shooter is a massive instrument mounted at the Cassegrain focus of Kueyen. The orientation of the spectrographs varies with the zenith angle and, away from zenith, with the position angle. Flexure causes a change of the position of the ob ject source along the entrance slit of the X-sho oter spectrograph. This effect is corrected by an active flexure compensation system based on the use of piezo controlled mirrors. Moreover the flexures induce small movements of the spectrographs optical elements. This last contributes to spectral format shifts that can be corrected at least to first order by the data reduction. This is possible by the acquisition of special flexure compensation frames (a kind of attached calibration frames) before each science template. In order to reduce the detector read-out time, only 1000x1000 pixels are read-out with a very short exposure. Using the physical mo del (or the polynomial) solution obtained after the analysis of the multi-pinhole frame, it is possible to measure the shift of a small set of known emission lines and consequently correct the model (or the polynomial) solution. This correction is critical to obtain go od accuracy in case of IFU science data reduction.

4.10 Reduction of ob ject frames in stare mode
If there are more than two input frames, those are stacked and CRHs are removed using median stacking. After master bias (UVB, and VIS) and master dark (if available) subtraction, the inter-order background is estimated using the information given by the table tracing order edges via a spline or polynomial metho d, and then subtracted from the data. Next the frame may be divided by the master flat. Then the sky background may be estimated and subtracted using the metho d developed by Kelson.9 If the user would like to remove CRHs in a single frame a preliminary ob ject lo calization is performed in order to mask the ob ject while the sky is estimated. This may be done manually, in which case the user specifies the information where the ob ject is lo cated, or automatically by employing a Gaussian fit of the ob ject's cross order profile. CRHs are determined using the L.A. cosmic by van-Dokkum10 after a preliminary sky estimation and subtraction. After CRHs have been removed, the sky is added back and a new ob ject lo calization is performed on the cosmic ray cleaned frame. Then a final sky subtraction is performed masking the ob ject. In Figure 7 we show results of single frame sky subtraction (right panel) compared with the frame before sky subtraction for an ob ject having a very weak (and very few) emission line(s) spectrum. Next the frame is rectified from the pixel (X, Y ) space on to a regular grid (, s) space. A 1D spectrum is generated by collapsing the 2D pro duct on a range of slit positions specified by user input parameters. A merged 2D spectrum is obtained with simple or weighted mean of the overlapping order regions, and a 1D merged spectrum is obtained by collapsing the 2D product on a range of slit positions specified by user input parameters. Alternatively the 1D spectrum can be extracted with optimal extraction. In Figure 9 we show the merged 1D spectrum of a quasar over the full X-shooter wavelength range observed in stare mo de in the UVB and VIS arm and no dding mode in the NIR arm.

4.11 Optimal extraction
Optimal extraction is performed on the bias, dark, inter-order background, flat-field corrected science frame. To ensure flux conservation the corrected frame is multiplied by the blaze function that is obtained with a polynomial fit of the master flat counts measured along the central order traces. The ob ject frame, and corresponding wavelength and slit maps are over-sampled by a user defined factor. Then the extraction is performed for each order. The order is analysed at X, Y positions taken along traces (given by the polynomial solution or the physical model) parallel to the central order trace each separated from the next neighbor by the Y step size in the over-sampled space (see Fig. 8, left panel). To each X,Y point in the super-sampled space the corresponding wavelength is associated using the wavemap. To this (X,Y,) point the lower and upper limits in the slit space are associated using the slit

3%)4: )A 037B C);: DDED DDEDFGMD
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


Figure 7. Results from single frame sky subtraction: MRC0943-242 is a radio-galaxy at redhift 2.92 hosting a hidden p owerful AGN. In this sp ectrum one may see mostly narrow lines from the gas excited by the strong UV radiation from the AGN (the usual broad AGN lines are hidden). On the left hand side is shown the 2D frame after inter-order background subtraction, CRHs rejection and flat-field correction. On the right hand side the same frame after sky subtraction.

Figure 8. Left: optimal extraction geometry in the sup er-sampled space. Right: sketch of the IFU imaging on the slit.

map information. Using those limits it is possible to estimate the line (or slit) tilt at the order center. In order to improve speed, as the (usually point like) ob ject do es not extend over the full slit, the extraction is performed over a shorter extraction slit. Then for each X,Y the profile is determined by linear interpolation of the signal along the slit direction in the over-sampled space. This operation defines pseudo rectified orders. Those can be collapsed over a user defined slit centred on the ob ject to define a 1D extracted spectrum. The division of the 2D pseudo-rectified orders by the 1D extracted spectrum removes spectra features. Then the cross order profile is estimated, using either a Gaussian or a general profile. In the first case the Gaussian parameters (position, FWHM, residual background, integrated area) are obtained in different portions of the order after collapsing the order in chunks and performing a Gaussian fit to the cross profile in each chunk. Then two polynomial fits are performed to the set of positions and FWHMs values. The cross profile integrated Gaussian area is used to asso ciate to each pixel a proper weight. Pixels contaminated by CRHs can be discarded by comparing the count levels given by the Gaussian profile approximation with the corresponding count levels of the 2D pseudo-rectified order divided by the 1D standard extracted spectrum using appropriate threshold values. In the case of the general profile, as in the virtual re-sampling metho d proposed by Mukai,11 no assumption is made on the shape of the cross order profile. The profile is approximated by polynomials along the dispersion

3%)4: )A 037B C);: DDED DDEDFGMG
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


axis. The fluxes are estimated at sub-pixels for which the position in the original frame is closer than a given amount. These fluxes are then interpolated by polynomials in order to get an estimate of the weight at every position of the order. At this step, the interpolated values are compared with 2D pseudo rectified orders divided by the 1D standard extracted spectra in order to discard the contribution from pixels that are contaminated by CRHs. Once extracted the orders are evenly re-sampled using the user defined wavelength sampling step.

4.12 Instrument resp onse and efficiency determination
To compute the instrument response the 1D spectrum is integrated to obtain the same binning as the one of the reference standard star spectrum, and the atmospheric extinction is interpolated to the same binning. The table is divided by the extracted 1D spectrum and the resulting ratio is multiplied by the atmospheric extinction. The efficiency at a given wavelength is computed as: () =
X SH IS T D () · 10 0.4·Atm ext()·(air p-air m) r ISefD T

T

exp

· Atel ·

()

· g ain · Ephot ()

· f actor

X SH where IS T D () is the extracted standard star spectrum as observed by X-sho oter, corrected for the contribution from the sky background, at a given wavelength , Atm ext() is the atmospheric extinction value, airm is the airmass at which the ob ject (star) was actually observed, airp is a parameter to indicate if the efficiency is computed at airmass=0 (no-atmosphere) or at a given value (the one at which the reference standard star spectrum is tabulated). g ain is the detector's gain, and Ephot () is the energy of one photon (Ephot () = 107 /( · 1.986 · 1019 ) · J · µm-1 ), Texp is the total exposure time in seconds, AT el is the UT telescope collecting r area ( 51.2 · 104 · cm2 ), ISefD () is the flux calibrated spectrum of the reference source. f actor is a number that T corrects for the fact that in the previous formula some quantity has been expressed in different units.

4.13 Reduction of observations in slit nod mode
The raw frames are composed of a series of couples with ob ject position A and B on the slit (these positions may vary in the series if jitter is used). The input frames are initially prepared. To shorten data reduction time the recipe first co-adds all frames at the same no d position. If there are more than two A and B frames, the CRHs are removed using median sigma-clipping cleaning. Then for each no dded pair A, B, the following data reduction steps are performed. · The frame A-B is computed to subtract the sky contribution to first order. · In order to detect both the positive CRHs (from A) and negative ones (from B) in A-B, the frames |A-B| and sign(A-B) are computed so that A - B = sig n(A - B) â |A - B|. · Then the CRHs are corrected using the L.A. cosmic algorithm on |A-B|, and the resulting frame is multiplied by the sign(A-B) frame. Next the frame A-B is divided -- or not -- by the master flat field. Later the frame is rectified from the pixel space (X, Y ) onto a regular grid in the (, s) space. · The lo calization is done on the rectified frame to derive the ob ject position along the slit. This operation is done for the positive frame to derive the lo calization of A, and for its opposite to derive the position of B. · The B-A frame is rectified and shifted to the position of A. In the quick lo ok mo de, the rectified B-A is taken as the opposite of A-B and shifted by an integer amount of pixels in s (it saves one rectification).

In the normal mo de, B-A is taken as the opposite of A-B after the CRH correction, and the flat field division is repeated on this frame. Then the rectification and the shift along the slit are done in a single operation to re-sample the frame only once, and the s position where the rectified flux is estimated is corrected from the shift between A and B. The shift between A and B used to shift B-A may come from the difference in the lo calizations or from the FITS keywords SEQ CUMOFF RA and SEQ CUMOFF DEC.

3%)4: )A 037B C);: DDED DDEDFGMT
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


08

0

i1
374

00

n
II

II1i1II
lIi

60

350

400

450

500

3D0
IY

500
20

550

600

650

700

10 -A'C
irnryrr 'I'0

700
10

750

800

850

900

:

n-I-T-r--j
950
1000

1050 1100

900
10

1100 5.0

:

1

1200

1300

1400

1500

1600

Ir H
2200

1700

1600

1900

2000

2100 Wavelength (nm)

2300

2400

Figure 9. Sp ectrum of the lensed quasar B1422+231. The sp ectrum shows the UVB, the VIS, and the NIR data in units of 10-16 erg s-1 cm-1 , using different grey scales for the different p ortions of the sp ectrum. No correction for telluric lines has b een applied.

Next all the rectified and shifted frames are combined together into a single frame (with a larger range in s that encompasses the "positive" and both "negative" spectra). A kappa-sigma clipping can be done during this combination. This step removes the sky contribution to second order. A 1D spectrum is produced by collapsing the 2D pro duct on a range of slit positions specified by the input parameters.

4.14 Reduction of observations in slit offset mode
If there are more than two input frames, those are stacked and CRHs are removed using median stacking. As in the slit-no d data reduction each ob ject and sky pair is prepared and the sky frame is subtracted to the ob ject one. Then the inter-order background is estimated as described in slit stare data reduction and subtracted. Next CRHs detection is performed as described for slit no d data reduction where in offset mode data reduction the ob ject and the sky play respectively the roles of the A and B frames for slit nod data reduction. The CRHs clean frame on-off is divided -- or not -- by the master flat. The frame is rectified from the pixel space (X, Y ) onto a regular grid in the (, s) space. The lo calization is done on the rectified frame to derive the ob ject position along the slit. The on-off frame is rectified and shifted to the position of the first on frame. The rectification and the shift along the slit are done in a single operation to re-sample the frame only once, and the s position where

3%)4: )A 037B C);: DDED DDEDFGMJI
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


the rectified flux is estimated is corrected from the shift between the on frames. The shift may come from the difference in the lo calizations or from the FITS keywords SEQ CUMOFF RA and SEQ CUMOFF DEC. A 1D spectrum is pro duced by collapsing the 2D pro duct on a range of slit positions specified by the input parameters.

Figure 10. Upp er left: combined IFU upp er, central and lower traces for the three arms. The curvature is due to differential atmospheric disp ersion as there is no ADC for the IFU. Lower left: residuals of lower-central and upp er-central traces for a standard star used to verify accuracy. Right: a slice of the 3D cub e at H . The spatial size of one pixel is 0.15".

4.15 Reduction of observations in ifu stare and offset mo de
The input frames are prepared. If three or more science frames are present in the set-of-frames, they are combined into one median frame to reject the CRHs. The master bias frame (UVB and VIS arms), and the master dark frame (if available) are subtracted. The inter-order background is determined and subtracted. Then the frame is divided by the master flat field. The sky background is not removed from an IFU observation in staring mo de. Finally the 3D data cube is constructed. For each detected order m, wavelength , and slit value in the central IFU slice scen , the (xcen , y cen ) position corresponding to the current (m, , scen ) is determined, using either the flexure corrected global polynomial solution or the physical mo del. The (xupp , y upp ) and (xlow , y low ) corresponding positions in the two adjacent IFU slices are determined using fixed calibrated relations (1) and (2). The corresponding fluxes, errors, and qualifier are determined by interpolating the pre-processed IFU science frame (and corresponding error) images. Those values are stored in the cube position corresponding to the given IFU slice, spatial and wavelength co ordinate. Cube value points corresponding to wavelengths where different orders overlaps are averaged. For quality control, the recipe computes the ob ject traces in each IFU slice (see Fig.10). To find the relations (1) and (2) a Gaussian fit of ob ject trace X position in each IFU slice is performed for each order and Y position constrained to a X range set by the traced IFU slices edge positions. Then each (x, y ) pair found in each IFU slice is converted in corresponding (s, ) positions using the wave and slit map information (poly mode) or the mo del (physical mo del mo de). The distribution of supp (), scen (), slow () is different, but the sum supp () + scen (), and slow () + scen (), is a constant, equal to twice the distance between the slices from the optical center. The following equations are valid: s
upp

=·s

cent

+c

upp 0

+c

upp 1

·+c ·+c

upp 2

· 2 · 2

(1)

s

low

=·s

cent

+c

low 0

+c

low 1

low 2

(2)

3%)4: )A 037B C);: DDED DDEDFGMJJ
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms


Where = -1 has been determined in the lab, and the coefficients cupp , clow (i = 0, 1, 2) have been determined i i minimizing residuals in the final cube reconstruction over a set of standard stars (see Fig. 10). Data acquired in offset mo de are reduced in the same way, with the only difference that in this case input frames are (usually low signal to noise) ob ject and sky frames that are initially separated in ob ject and sky pairs and the sky frame is subtracted from the ob ject one.

5. SUMMARY AND CONCLUSIONS
We have described the X-shooter data reduction accuracy of any data reduction step and the re proven to be a very useful tool for checking the science observations during X-shooter operations observing modes. chain, main results and quality checks that allow to check the duction of X-sho oter science data. The pipeline has already health of the instrument, the quality of the calibrations and and to reduce X-shooter science data in the different X-shooter

ACKNOWLEDGMENTS
We thank Sandro D'Odorico, the astronomer who observed the quasar whose spectra we have presented in this paper and his support and suggestions during the different phases of development and verifications of the pipeline. We dedicate the paper to Roberto Pallavicini, who strongly contributed to the succes of X-sho oter, but who prematurely passed away before its first light, and who was already one of the most brilliant astronomers at the Arcetri Observatory at the time the first author studied there two decades ago.

REFERENCES
[1 ] Ballester, P., Banse, K., Castro, S., Hanuschik, R., Hook, R. N., Izzo, C., Jung, Y., Kaufer, A., Larsen, J. M., Licha, T., Lorch, H., Lundin, L., Mo digliani, A., Palsa, R., Peron, M., Sabet, C., and Vinther, J., "Data reduction pipelines for the very large telescope," in [Observatory Operations: Strategies, Processes, and Systems. ], Silva, D. R.; Doxsey, R. E., ed., Proc. SPIE 6270, 6270T (2006). [2 ] Silva, D. and Peron, M., "VLT science pro ducts pro duced by pipelines: A status report," The Messenger 118, 2 (Dec. 2004). [3 ] Moehler, S., Bristow, P., Kerber, F., Mo digliani, A., and Vernet, J., "The physical mo del in action: Quality control for x-sho oter," in [Observatory Operation ], Proc. SPIE 7737 (2010). [4 ] Goldoni, P., Royer, F., Francois, P., Horrobin, M., Blanc, G., Joel, V., Andrea, M., and Jonas, L., "Data ¸ reduction software of the x-sho oter spectrograph," in [Ground-based and Airborne Instrumentation for Astronomy II ], Ian S. McLean, M. I., ed., Proc. SPIE 6969, 62692K (2006). [5 ] Vernet, J., Dekker, H., D'Odorico, S., Mason, E., Marcantonio, P. D., Downing, M. D., Elswijk, E., Finger, G., Fischer, G., Kerber, F., Kern, L., Lizon, J.-L., Lucuix, C., Mainieri, V., Modigliani, A., Patat, F., Ramsay, S. K., Santin, P., Vidali, M., Gro ot, P., Guinouard, I., Hammer, J.-F., Kaper, L., KjaergaardRasmussen, P., Navarro, R., Randich, S., and Zerbi, F. M., "Performance of x-sho oter: the new wide-band intermediate resolution spectrograph at the vlt," in [Observatory Operation ], Proc. SPIE 7735 (2010). [6 ] Bristow, P. and Kerber, F., "Mo del based calibration," in [ESO Calibration workshop ], (2007). [7 ] Bristow, P., Kerber, F., Vernet, J., Moehler, S., and Mo digliani, A., "Using the x-sho oter physical mo del to understand instrument flexure," in [Observatory Operation ], Proc. SPIE 7735 (2010). [8 ] Mo digliani, A., Bristow, P. D., and Izzo, C., "Reference ob ject identification: Pattern-matching or first-guess mo del? a pro cedure to determine the spectral format of x-sho oter takes advantage of both techniques," in [Ground-based and Airborne Instrumentation for Astronomy ], David A. Bohlender, Daniel Durand, P. D., ed., Proc. ADASS 411, 258 (2009). [9 ] Kelson, D. D., "Optimal techniques in two-dimensional spectroscopy: Background subtraction for the 21st century," Proceedings of Astronomycal and Science in Pacific 115, 688 (June 2003). [10 ] van Dokkum, P. G., "Cosmic-ray rejection by laplacian edge detection," Proceedings of Astronomycal and Science in Pacific 113, 1420 (Nov 2001). [11 ] Mukai, K., "Optimal extraction of cross-dispersed spectra," Astronomycal Society of the Pacific 102, 183 (Feb 1990).

3%)4: )A 037B C);: DDED DDEDFGMJF
Downloaded from SPIE Digital Library on 10 Aug 2010 to 134.171.10.128. Terms of Use: http://spiedl.org/terms