- Timestamp:
- May 3, 2010, 8:41:49 AM (16 years ago)
- Location:
- branches/tap_branches
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/tap_branches
- Property svn:mergeinfo changed
-
branches/tap_branches/psModules
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk/psModules merged eligible /branches/eam_branches/stackphot.20100406/psModules 27623-27653 /branches/pap_delete/psModules 27530-27595
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/tap_branches/psModules/src/objects/pmSourceMoments.c
r25754 r27838 54 54 # define VALID_RADIUS(X,Y,RAD2) (((RAD2) >= (PS_SQR(X) + PS_SQR(Y))) ? 1 : 0) 55 55 56 bool pmSourceMoments(pmSource *source, psF32 radius, psF32 sigma, psF32 minSN )56 bool pmSourceMoments(pmSource *source, psF32 radius, psF32 sigma, psF32 minSN, psImageMaskType maskVal) 57 57 { 58 58 PS_ASSERT_PTR_NON_NULL(source, false); … … 114 114 for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) { 115 115 if (vMsk) { 116 if (*vMsk ) {116 if (*vMsk & maskVal) { 117 117 vMsk++; 118 118 continue; … … 135 135 // stars. 136 136 if (PS_SQR(pDiff) < minSN2*wDiff) continue; 137 if (pDiff < 0) continue;137 // if (pDiff < 0) continue; // XXX : MWV says I should include < 0.0 valued points... 138 138 139 139 // Apply a Gaussian window function. Be careful with the window function. S/N … … 163 163 } 164 164 165 // if we have less than (1/2) of the possible pixels, force a retry 165 // if we have less than (1/4) of the possible pixels (in circle or box), force a retry 166 int minPixels = PS_MIN(0.75*R2, source->pixels->numCols*source->pixels->numRows/4.0); 167 166 168 // XXX EAM - the limit is a bit arbitrary. make it user defined? 167 if ((numPixels < 0.75*R2) || (Sum <= 0)) {168 psTrace ("psModules.objects", 3, "insufficient valid pixels (%d vs %d; %f) for source\n", numPixels, (int)(0.75*R2), Sum);169 if ((numPixels < minPixels) || (Sum <= 0)) { 170 psTrace ("psModules.objects", 3, "insufficient valid pixels (%d vs %d; %f) for source\n", numPixels, minPixels, Sum); 169 171 return (false); 170 172 } … … 226 228 for (psS32 col = 0; col < source->pixels->numCols ; col++, vPix++, vWgt++) { 227 229 if (vMsk) { 228 if (*vMsk ) {230 if (*vMsk & maskVal) { 229 231 vMsk++; 230 232 continue; … … 249 251 // stars. 250 252 if (PS_SQR(pDiff) < minSN2*wDiff) continue; 251 if (pDiff < 0) continue;253 // if (pDiff < 0) continue; 252 254 253 255 // Apply a Gaussian window function. Be careful with the window function. S/N … … 315 317 source->moments->Myyyy = YYYY/Sum; 316 318 317 if (source->moments->Mxx < 0) {318 fprintf (stderr, "error: neg second moment??\n");319 }320 if (source->moments->Myy < 0) {321 fprintf (stderr, "error: neg second moment??\n");322 }319 // if (source->moments->Mxx < 0) { 320 // fprintf (stderr, "error: neg second moment??\n"); 321 // } 322 // if (source->moments->Myy < 0) { 323 // fprintf (stderr, "error: neg second moment??\n"); 324 // } 323 325 324 326 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",
Note:
See TracChangeset
for help on using the changeset viewer.
