**Parameters:**-
*-mask**none*Input extraction mask*-in**none*Input frame to be extracted (preprocessed, in e-)*-out**none*Output datacube*-width**5*Extraction window full-width [px]*-cal**none*Calibration frame*-weighted*Weighted summation *-lens**-1*Single lens extraction*-overlap*De-polluted summation *-offset**NULL*Calibration offset (manual)*-cal2**NULL*2nd calibration frame*-local*Local adjustment to mask positions *-linfit*Linear fit (not fully tested) *-verbose*Verbose output *-variance*Use [signal] and [variance] extensions of input frame (default: compute var on-the-fly)

**Returns:**- Error status

**Note:**- In single-lens debug extraction, a residual map of the extraction process can be computed from the
`dbg_ext_extract_spec`

debug cube, by converting the signal (input frame) and the variance (model) extensions of the cube to 2D-frames, and subtracting them, e.g.,export_spec -in dbg_ext_xdisp.tig -out lens113_2D -longslit -lcol NO,LBDA export_spec -in dbg_ext_xdisp.tig -out lens113F_2D -longslit -lcol NO,LBDA -noise

**Todo:**- Expand the domain of validity of the Chebyshev expansion for sigma (and dx?) from the useful wavelength range [lbda_inf,lbda_sup] to the total wavelength range [lbda_inf_tot,lbda_sup_tot] (requires changes in create_mask and snifs_instrument.h) (see comment "get lbda = f(yd)")
CAREFULLY CHECK THE OPTIMAL EXTRACTION (signal and variance). In particular, use the variance extension during the optimal extraction. One could also have a look at Khmil & Surdej 2002 (optimal extraction with maximum entropy).

Implement option

`-linfit`

The spatial coordinates still have to be computed.

For the two-pass multi-order optimal extraction, add an option

`-restore`

to extract pre-restore_frame (i.e. without the final wavelength-rebin and extracted on the full wavelength domain).

**Bug:**- There might be a bug (potential SEGFAULT) in the computation of fitting window limits i1,i2,... in Sauron.

Generated on Thu Oct 27 00:00:24 2005 for Snifs by 1.3.5