Changeset 19879 for trunk/psModules/src/objects/pmSource.c
- Timestamp:
- Oct 3, 2008, 10:59:16 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSource.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSource.c
r19848 r19879 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.5 6$ $Name: not supported by cvs2svn $9 * @date $Date: 2008-10-0 2 20:51:29$8 * @version $Revision: 1.57 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2008-10-03 20:59:16 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 330 330 331 331 // 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) 339 339 continue; 340 340 if (tmpSrc->mode & PM_SOURCE_MODE_BLEND) … … 342 342 343 343 // for the moment, force splane dimensions to be 10x10 image pix 344 binX = tmpSrc->moments-> Sx/SCALE;344 binX = tmpSrc->moments->Mxx/SCALE; 345 345 if (binX < 0) 346 346 continue; … … 348 348 continue; 349 349 350 binY = tmpSrc->moments-> Sy/SCALE;350 binY = tmpSrc->moments->Myy/SCALE; 351 351 if (binY < 0) 352 352 continue; … … 427 427 continue; 428 428 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; 439 439 tmpSx->n++; 440 440 tmpSy->n++; … … 519 519 } 520 520 521 psF32 sigX = source->moments-> Sx;522 psF32 sigY = source->moments-> Sy;521 psF32 sigX = source->moments->Mxx; 522 psF32 sigY = source->moments->Myy; 523 523 524 524 // XXX EAM : can we use the value of SATURATE if mask is NULL? … … 635 635 # define VALID_RADIUS(X,Y,RAD2) (((RAD2) >= (PS_SQR(X) + PS_SQR(Y))) ? 1 : 0) 636 636 637 /*** this been moved to pmSourceMoments.c ***/ 638 # if (0) 637 639 bool pmSourceMoments(pmSource *source, 638 640 psF32 radius) … … 774 776 } 775 777 776 source->moments-> x = x + xPeak;777 source->moments-> y = y + yPeak;778 source->moments->Mx = x + xPeak; 779 source->moments->My = y + yPeak; 778 780 779 781 // 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; 781 783 source->moments->Sum = Sum; 782 784 source->moments->SN = Sum / sqrt(Var); … … 786 788 // XXX EAM : these values can be negative, so we need to limit the range 787 789 // 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); 792 794 793 795 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); 797 799 798 800 psTrace("psModules.objects", 5, "---- end ----\n"); 799 801 return(true); 800 802 } 801 803 # endif 802 804 // construct a realization of the source model 803 805 bool pmSourceCacheModel (pmSource *source, psMaskType maskVal) {
Note:
See TracChangeset
for help on using the changeset viewer.
