Changeset 11261
- Timestamp:
- Jan 24, 2007, 11:32:19 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSource.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSource.c
r11160 r11261 6 6 * @author EAM, IfA: significant modifications. 7 7 * 8 * @version $Revision: 1.2 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2007-01- 19 04:38:26$8 * @version $Revision: 1.24 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-01-24 21:32:19 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 214 214 215 215 psArray *peaks = NULL; 216 pmPSFClump emptyClump = {0.0, 0.0, 0.0, 0.0}; 217 pmPSFClump psfClump = emptyClump; 218 219 PS_ASSERT_PTR_NON_NULL(sources, emptyClump); 220 PS_ASSERT_PTR_NON_NULL(recipe, emptyClump); 216 pmPSFClump errorClump = {-1.0, -1.0, 0.0, 0.0}; 217 pmPSFClump emptyClump = {+0.0, +0.0, 0.0, 0.0}; 218 pmPSFClump psfClump; 219 220 PS_ASSERT_PTR_NON_NULL(sources, errorClump); 221 PS_ASSERT_PTR_NON_NULL(recipe, errorClump); 221 222 222 223 bool status = true; … … 249 250 250 251 // place the sources in the sigma-plane image (ignore 0,0 values?) 252 int nValid = 0; 251 253 for (psS32 i = 0 ; i < sources->n ; i++) 252 254 { 253 255 pmSource *tmpSrc = (pmSource *) sources->data[i]; 254 if (tmpSrc == NULL) { 255 continue; 256 } 257 if (tmpSrc->moments == NULL) { 258 continue; 259 } 260 261 if (tmpSrc->moments->SN < PSF_CLUMP_SN_LIM) { 262 continue; 263 } 256 if (tmpSrc == NULL) 257 continue; 258 if (tmpSrc->moments == NULL) 259 continue; 260 if (tmpSrc->moments->SN < PSF_CLUMP_SN_LIM) 261 continue; 264 262 265 263 // Sx,Sy are limited at 0. a peak at 0,0 is artificial 266 if (fabs(tmpSrc->moments->Sx) < 0.05) { 267 continue; 268 } 269 if (fabs(tmpSrc->moments->Sy) < 0.05) { 270 continue; 271 } 272 if ((tmpSrc->moments->Sx / tmpSrc->moments->Sy) > AR_MAX) { 273 continue; 274 } 275 if ((tmpSrc->moments->Sx / tmpSrc->moments->Sy) < AR_MIN) { 276 continue; 277 } 278 if (tmpSrc->mode & PM_SOURCE_MODE_BLEND) { 279 continue; 280 } 264 if (fabs(tmpSrc->moments->Sx) < 0.05) 265 continue; 266 if (fabs(tmpSrc->moments->Sy) < 0.05) 267 continue; 268 if ((tmpSrc->moments->Sx / tmpSrc->moments->Sy) > AR_MAX) 269 continue; 270 if ((tmpSrc->moments->Sx / tmpSrc->moments->Sy) < AR_MIN) 271 continue; 272 if (tmpSrc->mode & PM_SOURCE_MODE_BLEND) 273 continue; 281 274 282 275 // for the moment, force splane dimensions to be 10x10 image pix … … 294 287 295 288 splane->data.F32[binY][binX] += 1.0; 289 nValid ++; 296 290 } 297 291 … … 311 305 psFree (stats); 312 306 307 // if we failed to find a valid peak, return the empty clump (failure signal) 313 308 if (peaks == NULL) 314 309 { 315 return (psfClump); 316 } 317 } 318 // XXX EAM : possible errors: 319 // 1) no peak in splane 320 // 2) no significant peak in splane 310 psLogMsg ("psphot", 3, "failed to find a peak in the PSF clump image\n"); 311 if (nValid == 0) { 312 psLogMsg ("psphot", 3, "no valid sources kept for PSF search\n"); 313 } else { 314 psLogMsg ("psphot", 3, "no significant peak\n"); 315 } 316 return (emptyClump); 317 } 318 } 321 319 322 320 // measure statistics on Sx, Sy if Sx, Sy within range of clump … … 408 406 psTrace("psModules.objects", 5, "---- begin ----"); 409 407 410 psBool rc = true; 408 PS_ASSERT_PTR_NON_NULL(sources, false); 409 PS_ASSERT_PTR_NON_NULL(recipe, false); 411 410 412 411 int Nsat = 0; … … 538 537 539 538 psTrace("psModules.objects", 5, "---- end ----\n"); 540 return (rc);539 return true; 541 540 } 542 541
Note:
See TracChangeset
for help on using the changeset viewer.
