IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 3, 2008, 10:59:16 AM (18 years ago)
Author:
eugene
Message:

converted pmMoments elements to Mxx, Myy, Mxxx, etc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSource.c

    r19848 r19879  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-10-02 20:51:29 $
     8 *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-10-03 20:59:16 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    330330
    331331            // Sx,Sy are limited at 0.  a peak at 0,0 is artificial
    332             if (fabs(tmpSrc->moments->Sx) < 0.05)
    333                 continue;
    334             if (fabs(tmpSrc->moments->Sy) < 0.05)
    335                 continue;
    336             if ((tmpSrc->moments->Sx / tmpSrc->moments->Sy) > AR_MAX)
    337                 continue;
    338             if ((tmpSrc->moments->Sx / tmpSrc->moments->Sy) < AR_MIN)
     332            if (fabs(tmpSrc->moments->Mxx) < 0.05)
     333                continue;
     334            if (fabs(tmpSrc->moments->Myy) < 0.05)
     335                continue;
     336            if ((tmpSrc->moments->Mxx / tmpSrc->moments->Myy) > AR_MAX)
     337                continue;
     338            if ((tmpSrc->moments->Mxx / tmpSrc->moments->Myy) < AR_MIN)
    339339                continue;
    340340            if (tmpSrc->mode & PM_SOURCE_MODE_BLEND)
     
    342342
    343343            // for the moment, force splane dimensions to be 10x10 image pix
    344             binX = tmpSrc->moments->Sx/SCALE;
     344            binX = tmpSrc->moments->Mxx/SCALE;
    345345            if (binX < 0)
    346346                continue;
     
    348348                continue;
    349349
    350             binY = tmpSrc->moments->Sy/SCALE;
     350            binY = tmpSrc->moments->Myy/SCALE;
    351351            if (binY < 0)
    352352                continue;
     
    427427                continue;
    428428
    429             if (tmpSrc->moments->Sx < minSx)
    430                 continue;
    431             if (tmpSrc->moments->Sx > maxSx)
    432                 continue;
    433             if (tmpSrc->moments->Sy < minSy)
    434                 continue;
    435             if (tmpSrc->moments->Sy > maxSy)
    436                 continue;
    437             tmpSx->data.F32[tmpSx->n] = tmpSrc->moments->Sx;
    438             tmpSy->data.F32[tmpSy->n] = tmpSrc->moments->Sy;
     429            if (tmpSrc->moments->Mxx < minSx)
     430                continue;
     431            if (tmpSrc->moments->Mxx > maxSx)
     432                continue;
     433            if (tmpSrc->moments->Myy < minSy)
     434                continue;
     435            if (tmpSrc->moments->Myy > maxSy)
     436                continue;
     437            tmpSx->data.F32[tmpSx->n] = tmpSrc->moments->Mxx;
     438            tmpSy->data.F32[tmpSy->n] = tmpSrc->moments->Myy;
    439439            tmpSx->n++;
    440440            tmpSy->n++;
     
    519519        }
    520520
    521         psF32 sigX = source->moments->Sx;
    522         psF32 sigY = source->moments->Sy;
     521        psF32 sigX = source->moments->Mxx;
     522        psF32 sigY = source->moments->Myy;
    523523
    524524        // XXX EAM : can we use the value of SATURATE if mask is NULL?
     
    635635# define VALID_RADIUS(X,Y,RAD2) (((RAD2) >= (PS_SQR(X) + PS_SQR(Y))) ? 1 : 0)
    636636
     637/*** this been moved to pmSourceMoments.c ***/
     638# if (0)
    637639bool pmSourceMoments(pmSource *source,
    638640                     psF32 radius)
     
    774776    }
    775777
    776     source->moments->x = x + xPeak;
    777     source->moments->y = y + yPeak;
     778    source->moments->Mx = x + xPeak;
     779    source->moments->My = y + yPeak;
    778780
    779781    // XXX EAM : Sxy needs to have x*y subtracted
    780     source->moments->Sxy = XY/Sum - x*y;
     782    source->moments->Mxy = XY/Sum - x*y;
    781783    source->moments->Sum = Sum;
    782784    source->moments->SN  = Sum / sqrt(Var);
     
    786788    // XXX EAM : these values can be negative, so we need to limit the range
    787789    // XXX EAM : make the use of this consistent: should this be the second moment or sqrt?
    788     // source->moments->Sx = sqrt(PS_MAX(X2/Sum - PS_SQR(x), 0));
    789     // source->moments->Sy = sqrt(PS_MAX(Y2/Sum - PS_SQR(y), 0));
    790     source->moments->Sx = PS_MAX(X2/Sum - PS_SQR(x), 0);
    791     source->moments->Sy = PS_MAX(Y2/Sum - PS_SQR(y), 0);
     790    // source->moments->Mxx = sqrt(PS_MAX(X2/Sum - PS_SQR(x), 0));
     791    // source->moments->Myy = sqrt(PS_MAX(Y2/Sum - PS_SQR(y), 0));
     792    source->moments->Mxx = PS_MAX(X2/Sum - PS_SQR(x), 0);
     793    source->moments->Myy = PS_MAX(Y2/Sum - PS_SQR(y), 0);
    792794
    793795    psTrace ("psModules.objects", 4,
    794              "sky: %f  Sum: %f  x: %f  y: %f  Sx: %f  Sy: %f  Sxy: %f\n",
    795              sky, Sum, source->moments->x, source->moments->y,
    796              source->moments->Sx, source->moments->Sy, source->moments->Sxy);
     796             "sky: %f  Sum: %f  Mx: %f  My: %f  Mxx: %f  Myy: %f  Mxy: %f\n",
     797             sky, Sum, source->moments->Mx, source->moments->My,
     798             source->moments->Mxx, source->moments->Myy, source->moments->Mxy);
    797799
    798800    psTrace("psModules.objects", 5, "---- end ----\n");
    799801    return(true);
    800802}
    801 
     803# endif
    802804// construct a realization of the source model
    803805bool pmSourceCacheModel (pmSource *source, psMaskType maskVal) {
Note: See TracChangeset for help on using the changeset viewer.