- Timestamp:
- Jan 28, 2009, 2:33:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/psModules/src/objects/pmSourceMoments.c
r21183 r21211 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $9 * @date $Date: 2009-01-2 7 06:39:38$8 * @version $Revision: 1.7.2.1 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2009-01-29 00:33:51 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 47 47 pmSource->peak 48 48 pmSource->pixels 49 pmSource-> weight(optional)49 pmSource->variance (optional) 50 50 pmSource->mask (optional) 51 51 … … 99 99 100 100 psF32 *vPix = source->pixels->data.F32[row]; 101 psF32 *vWgt = source-> weight->data.F32[row];101 psF32 *vWgt = source->variance->data.F32[row]; 102 102 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 103 103 … … 110 110 vMsk++; 111 111 } 112 if (isnan(*vPix)) continue;112 if (isnan(*vPix)) continue; 113 113 114 114 psF32 xDiff = col - xPeak; … … 189 189 190 190 psF32 *vPix = source->pixels->data.F32[row]; 191 psF32 *vWgt = source-> weight->data.F32[row];191 psF32 *vWgt = source->variance->data.F32[row]; 192 192 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 193 193 … … 200 200 vMsk++; 201 201 } 202 if (isnan(*vPix)) continue;202 if (isnan(*vPix)) continue; 203 203 204 204 psF32 xDiff = col - xCM; … … 206 206 207 207 // radius is just a function of (xDiff, yDiff) 208 psF32 r2 = PS_SQR(xDiff) + PS_SQR(yDiff);209 psF32 r = sqrt(r2);208 psF32 r2 = PS_SQR(xDiff) + PS_SQR(yDiff); 209 psF32 r = sqrt(r2); 210 210 if (r > radius) continue; 211 211 … … 278 278 279 279 psTrace ("psModules.objects", 4, "Mxx: %f Mxy: %f Myy: %f Mxxx: %f Mxxy: %f Mxyy: %f Myyy: %f Mxxxx: %f Mxxxy: %f Mxxyy: %f Mxyyy: %f Mxyyy: %f\n", 280 source->moments->Mxx, source->moments->Mxy, source->moments->Myy, 280 source->moments->Mxx, source->moments->Mxy, source->moments->Myy, 281 281 source->moments->Mxxx, source->moments->Mxxy, source->moments->Mxyy, source->moments->Myyy, 282 282 source->moments->Mxxxx, source->moments->Mxxxy, source->moments->Mxxyy, source->moments->Mxyyy, source->moments->Myyyy); … … 286 286 287 287 if (source->moments->Mxx < 0) { 288 fprintf (stderr, "error: neg second moment??\n");288 fprintf (stderr, "error: neg second moment??\n"); 289 289 } 290 290 if (source->moments->Myy < 0) { 291 fprintf (stderr, "error: neg second moment??\n");291 fprintf (stderr, "error: neg second moment??\n"); 292 292 } 293 293 … … 341 341 342 342 psF32 *vPix = source->pixels->data.F32[row]; 343 psF32 *vWgt = source-> weight->data.F32[row];343 psF32 *vWgt = source->variance->data.F32[row]; 344 344 psImageMaskType *vMsk = (source->maskObj == NULL) ? NULL : source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[row]; 345 345 … … 352 352 vMsk++; 353 353 } 354 if (isnan(*vPix)) continue;354 if (isnan(*vPix)) continue; 355 355 356 356 psF32 xDiff = col - xPeak; … … 407 407 } 408 408 409 # if (PS_TRACE_ON) 409 # if (PS_TRACE_ON) 410 410 float Sxx = PS_MAX(X2/Sum - PS_SQR(x), 0); 411 411 float Sxy = XY / Sum;
Note:
See TracChangeset
for help on using the changeset viewer.
