• atSetFSigma
  • atFindFocMom
  • atSigmaFind
  • atGaussianWidth

     Code to find the optimum sigma for smoothing.
    
    
    
    

    atSetFSigma

    DESCRIPTION:
    
    This routine calculates gaussian smoothing and moment arrays for a given gaussian psf width parameter sigma. The normalization is to a value of about 512 in the center. The routine bombs and RETURNs (-1) if a ridiculously large sigma (>12) is asked for.

    RETURNS:

    <0> OK <-1> Requested sigma must be in the range 0
    SIGNATURE:
       
      int atSetFSigma(double sigma)
    

    atFindFocMom

    DESCRIPTION:
    	Given the array of pixel values, the x and y sizes of the array, the
    integer x and y  positions of the object, and the sky value, returns the 
    interpolated center, filter value, and Gaussian weighted moments in the 
    struct GAUSSMOM *ps.
    

    RETURNS:

    <0> OK <-1> star is too close to the edge <-2> Error in lgausmom - check sky value <-3> Flat peak
    SIGNATURE:
      
      int atFindFocMom(const U16 **p, 
                 int xsz, 
                 int ysz, 
                 int x,
                 int y,
                 int sky, 
                 GAUSSMOM *ps
                 )
    

    atSigmaFind

    DESCRIPTION:
    
    this routine iterates to find the optimum sigma for smoothing for object finding (and, though not QUITE optimum for astrometry, is trivially different from the correct value and I suggest we use it) by finding the sigma value for which the focus moment 2*r^2 - 2 weighted by that gaussian vanishes. It returns the found value or -1.0 if any invocation of atFindFocMom fails. It will populate a struct GAUSSMOM if one is offered, or will use an internal one for its calculations if one is not the argument is NULL).

    RETURNS:

    <0> OK <-1> Error in atSetFSigma (sigma too large) <-2> sigma out of range (inf sharp or inf flat) <-3> Too many iterations <-4> Too close to edge <-5> Error in lgausmom - check sky value <-6> Too flat, from atFindFocMom
    SIGNATURE:
      
      int
      atSigmaFind(const U16 **p, 
              int xsz, 
              int ysz, 
              int x,
              int y,
              int sky, 
              GAUSSMOM *ps,
      	double *sig)