% @(#)sky_roma.hlq	19.1 (ESO-IPG) 02/25/03 13:29:28 
\se                                                                             
SECTION./ROMAFOT
\es\co                                                                          
SKY/ROMAFOT                                                      07-AUG-1989 RHW
\oc\su                                 
SKY/ROMAFOT frame [sky_tab] [area] [nrx,nry] [min,max]
	determines intensity histogram and sky background in selected areas
\us\pu
Purpose:     Determines intensity histogram and sky background in selected 
             areas
\up\sy 
Syntax:      SKY/ROMAFOT frame [sky_tab] [area] [nrx,nry] [min,max]
\ys\pa                                                                          
             frame =   input image frame
\ap\pa                                                                          
             sky_tab = name of the output table which will contain the values 
                       for the sky background; default is the frame name
                       extended with the three characters `SKY'.
\ap\pa                                                 
             area =    area over which the background should be calculated. 
                       Input can given using the standard MIDAS notation.
                       Default is the whole frame.
\ap\pa                                                 
             nrx,nry = number of subdivisions in X and Y to create the
                       grid of rectangular cells where the trial value of 
                       the sky background is determined. Default is 5,8
\ap\pa        
             min,max = minimum and maximum between which a histogram of 
                       the frame pixel values is calculated (see Note)
                       Default values are the cut values in the descriptor
                       (LHCUTS(1) and LHCUTS(2)). If these values are 
                       identical the minimum and maximum in the frame are
                       taken.	
\ap\no
Note:        First, a histogram of the pixel values between min and max
             is created, and the maximum in the histogram distribution is 
             determined. A second window is then taken with a width of 10% 
             of the min,max range and centered around the pixel value
             that corresponds with the peak in the histogram distribution. 
             The background is determined taking all values into account 
             that lie within this window.\\
             The maximum number of cells is limited to 256.
\on\exs                                                                         
Examples:                                                                       
\ex
             SKY/ROMAFOT GCLUSTER ? [100,300:400,500] ? 500,2000
             Determine the sky background in 5 by 8 cells in the area enclosed
             by the pixels corners (100,300) and (400,500). The output table
             will be named GCLUSTERSKY. Only values between 500 and 2000 should
             be taken into account in determining the background level. 
\xe \sxe                                                                        
