To define your object's and sky regions use DEFINE/MOS
By default it automatically averages ( 20) columns around the position ( 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 ( windows). The plot option ( 0 defines whether you get a two-dimensional display of the result, a graphical plot, both, or nothing.
If an object is detected a gaussian is fitted to its 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. 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.
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 without any automatic search if you set DEF_MODE ( A) to I.