To define your object's and sky regions use
Midas ...> DEFINE/MOS
By default it automatically averages (20) columns around the position (0=center of frame) of the frame and searches for objects in this averaged frame that have an intensity above (-0.04) when compared to a median over (5) pixels. can be absolute (> 0) or relative to the median intensity (< 0). It searches the slitlets that are defined by .tbl (mos) and stores the results in .tbl (window). The plot option (0) defines whether you get a two-dimensional display of the result, a graphical plot, both, or nothing (default).
If an object is detected a gaussian is fitted to its spatial profile and the limits of the object's region are defined at those pixels where the gaussian fit has reached (0.001) of the central intensity. On both sides of each object a safety margin of 3 pixels is established (can be overridden manually later); the remaining slitlet is defined as sky region. It may be advisable to perform a very crude sky subtraction first to get rid of the sky continuum intensity. This can be done with SKYFIT/MOS with skymet=nowindows. This command determines the median value along the columns over the slitlets. If you choose this way you should use an absolute threshold for object detection. If you want to search for all objects at the same wavelength region you have to rebin your frame first to constant wavelength steps with REBIN/MOS.
After the automatic definition of objects' and sky regions you are asked if you are satisfied with the results. If you are not (or are not yet sure), you answer 'no' and can now inspect the results more closely in the graphical plot and also change the results manually. You may also start with the interactive definition using DEFWIN/MOS.
The results are stored in table (windows):
|:Obj_Slit||number of slitlet for object|
|:Obj_Strt||first row of object|
|:Obj_End||last row of object|
|:Sky_Slit||number of slitlet for sky|
|:Sky_Strt||first row of sky|
|:Sky_End||last row of sky|
The command SKYFIT/MOS is used to fit the sky. Normally, the sky regions are taken from the table .tbl. Several sky windows may be defined in each slitlets. To fit the sky background you may use the median along the sky regions (skymet=median) or a polynomial fit (skymet=polynomial). Method polynomial requires rejection of cosmic rays and bad pixels. These pixels are rejected by SKYFIT/MOS before fitting the data. Read out noise (in electrons), gain (electrons/adu) and the rejection criterion in units of must be specified in keywords and (3).
Midas ...> SKYFIT/MOS ? ? ? ? 3 poly 8,2.3,3
does a polynomial fit of 3 order in the frame .bdf, in the regions defined by .tbl (within the slitlet limits listed in ) and stores the result in (sky).bdf.