• centroidFind
  • 2ndMoments
  • gaussianWidthFind
  • daCentroidFind
  • tclObject

    ABSTRACT:
    
    Routines to calculate quantities about astronomical objects
    
    

    centroidFind

      C ROUTINE CALLED:
    		atCentroidFind in atObject.c
    
    

    The underlying routine uses U16 only. If the region is not U16, a scaled U16 copy will be made. If no min and max values are supplied in the call, the max value will be set to the highest pixel value and the min will be set to the lowest pixel value.

    Calculate the center of an astronomical object. If sigma<=0, it will not smooth with a Gaussian before fitting for the centroid. If gain<=0, the errors will not be calculated.

    The amplitude and sigmas in the row and column directions are also calculated, but they are only approximations.

    Subregions are allowed, but if they are used, both the coordinates given and the coordinates returned will be in the coordinates of the original image. To obtain these, add reg->row0 and reg->col0 to the row and column coordinates in the subregion.

    If it does not have to do Gaussian convolution, then centroids will be calculated up to one pixel from the edge of the region. If convolution is necessary, the distance from the edge depends on the convolution sigma: sigma=(<=1,<=1.2,<=1.5,<=1.8,<=2.1,>2.1) requires distance=(5,6,7,8,9,10)pixels from the edge.

    The algorithm will not calculate accurate widths for sigmas much under 1.0, when the pixel size becomes important.

    TCL SYNTAX:
      centroidFind  "<reg>" "<row>" "<col>" "<sky>" "<widthsigma>" "<skyvariance>" "<gain>" "-max" "-min" 
    
    TCL HELP STRING:
      Find the center, error in the center, peak values, and width estimates
    Experimental and currently only works for U16
    
    TCL ARGUMENTS:
                     : 
      "<reg>"      : region containing object
      "<row>"      : row position will be truncated to int
      "<col>"      : col position will be truncated to int
      "<sky>"      : sky value
      "<widthsigma>" : sigma of Gaussian to smooth image with (ignore if <=0)
      "<skyvariance>" : variance of the background
      "<gain>"     : gain of amplifier
      "-max"         : max value for scaling
      "-min"         : min value for scaling
    
    

    2ndMoments

      C ROUTINE CALLED:
    		at2ndMoments in atObject.c
    
    

    This algorithm uses second moments to calculate the position angle and widths in the directions of the major and minor axes.

    TCL SYNTAX:
      2ndMoments  "<reg>" "<row>" "<col>" "<sky>" "<nrows>" "<ncols>" 
    
    TCL HELP STRING:
      Find the position angle and widths in the major and minor directions
    
    TCL ARGUMENTS:
                     : 
      "<reg>"      : region containing object
      "<row>"      : centroided row
      "<col>"      : centroided col
      "<sky>"      : sky value
      "<nrows>"    : number of rows to include in moments
      "<ncols>"    : number of cols to include in moments
    
    

    gaussianWidthFind

      C ROUTINE CALLED:
    		atGaussianWidthFind in atObject.c
    
    

    The underlying routine uses U16 only. If the region is not U16, a scaled U16 copy will be made. If no min and max values are supplied in the call, the max value will be set to the highest pixel value and the min will be set to the lowest pixel value.

    Subregions are allowed, but if they are used, both the coordinates given and the coordinates returned will be in the coordinates of the original image. To obtain these, add reg->row0 and reg->col0 to the row and column coordinates in the subregion.

    Returned are: errorFlag (listed in atObject.c), row,col, peak value, counts, sigma along semi-major axis, sigma along semi-minor axis, and position angle 0 points toward low row numbers, increasing through increasing col numbers). FWHM = 2.354*sigma.

    TCL SYNTAX:
      gaussianWidthFind  "<reg>" "<row>" "<col>" "<sky>" "-max" "-min" 
    
    TCL HELP STRING:
      Find the best fit Gaussian sigma
    
    TCL ARGUMENTS:
                     : 
      "<reg>"      : region containing object
      "<row>"      : row position will be truncated to int
      "<col>"      : col position will be truncated to int
      "<sky>"      : sky value
      "-max"         : max value for scaling
      "-min"         : min value for scaling
    
    

    daCentroidFind

      C ROUTINE CALLED:
    		atDACentroidFind in atObject.c
    
    

    The underlying routine uses U16 only. If the region is not U16, a scaled U16 copy will be made. If no min and max values are supplied in the call, the max value will be set to the highest pixel value and the min will be set to the lowest pixel value. To get the same values as the gang files, use the U16 regions.

    Calculate the center of an astronomical object. If sigma<=0, it will not smooth with a Gaussian before fitting for the centroid. If gain<=0, the errors will not be calculated.

    The amplitude and sigmas in the row and column directions are also calculated.

    Subregions are allowed, but if they are used, both the coordinates given and the coordinates returned will be in the coordinates of the original image. To obtain these, add reg->row0 and reg->col0 to the row and column coordinates in the subregion.

    If it does not have to do Gaussian convolution, then centroids will be calculated up to one pixel from the edge of the region. If convolution is necessary, the distance from the edge depends on the convolution sigma: sigma=(<=1,<=1.2,<=1.5,<=1.8,<=2.1,>2.1) requires distance=(5,6,7,8,9,10)pixels from the edge.

    TCL SYNTAX:
      daCentroidFind  "<reg>" "<row>" "<col>" "<sky>" "<widthsigma>" "<skyvariance>" "<gain>" "-max" "-min" 
    
    TCL HELP STRING:
      Find the center, error in the center, peak values, and width estimates
    Experimental and currently only works for U16
    
    TCL ARGUMENTS:
                     : 
      "<reg>"      : region containing object
      "<row>"      : row position will be truncated to int
      "<col>"      : col position will be truncated to int
      "<sky>"      : sky value
      "<widthsigma>" : sigma of Gaussian to smooth image with (ignore if <=0)
      "<skyvariance>" : variance of the background
      "<gain>"     : gain of amplifier
      "-max"         : max value for scaling
      "-min"         : min value for scaling