Changeset 28484 for branches/pap/psphot/src/psphotSourceStats.c
- Timestamp:
- Jun 24, 2010, 2:59:09 PM (16 years ago)
- Location:
- branches/pap
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap
- Property svn:mergeinfo changed
-
branches/pap/psphot
- Property svn:mergeinfo changed
/branches/czw_branch/20100519/psphot (added) merged: 28164,28304
- Property svn:mergeinfo changed
-
branches/pap/psphot/src/psphotSourceStats.c
r28013 r28484 3 3 // convert detections to sources and measure their basic properties (moments, local sky, sky 4 4 // variance) Note: this function only generates sources for the new peaks (peak->assigned). 5 // The new sources are added to any existing sources on detections->newSources. The sources 5 // The new sources are added to any existing sources on detections->newSources. The sources 6 6 // on detections->allSources are ignored. 7 7 bool psphotSourceStats (pmConfig *config, const pmFPAview *view, const char *filerule, bool setWindow) … … 22 22 // loop over the available readouts 23 23 for (int i = 0; i < num; i++) { 24 // if (i == chisqNum) continue; // skip chisq image24 // if (i == chisqNum) continue; // skip chisq image 25 25 if (!psphotSourceStatsReadout (config, view, filerule, i, recipe, setWindow)) { 26 26 psError (PSPHOT_ERR_CONFIG, false, "failed to find initial detections for %s entry %d", filerule, i); … … 91 91 // generate the array of sources, define the associated pixel 92 92 if (!detections->newSources) { 93 detections->newSources = psArrayAllocEmpty (peaks->n);93 detections->newSources = psArrayAllocEmpty (peaks->n); 94 94 } 95 95 sources = detections->newSources; … … 107 107 // create a new source 108 108 pmSource *source = pmSourceAlloc(); 109 source->imageID = index;109 source->imageID = index; 110 110 111 111 // add the peak … … 184 184 if (!psThreadJobAddPending(job)) { 185 185 psError(PS_ERR_UNKNOWN, false, "Unable to launch thread job PSPHOT_SOURCE_STATS"); 186 psFree (job);187 186 psFree(detections->newSources); 188 187 return false; 189 188 } 190 psFree(job);191 189 } 192 190 … … 194 192 if (!psThreadPoolWait (false)) { 195 193 psError(PS_ERR_UNKNOWN, false, "Failure in thread job PSPHOT_SOURCE_STATS"); 196 psFree(detections->newSources);194 psFree(detections->newSources); 197 195 return false; 198 196 } … … 315 313 if (!psThreadJobAddPending(job)) { 316 314 psError(PS_ERR_UNKNOWN, false, "Unable to launch thread job PSPHOT_SOURCE_STATS"); 317 psFree (job);318 315 return NULL; 319 316 } 320 psFree(job);321 317 } 322 318 … … 380 376 pmSource *source = sources->data[i]; 381 377 382 if (source->tmpFlags & PM_SOURCE_TMPF_MOMENTS_MEASURED) continue;383 source->tmpFlags |= PM_SOURCE_TMPF_MOMENTS_MEASURED;378 if (source->tmpFlags & PM_SOURCE_TMPF_MOMENTS_MEASURED) continue; 379 source->tmpFlags |= PM_SOURCE_TMPF_MOMENTS_MEASURED; 384 380 385 381 // skip faint sources for moments measurement … … 493 489 psLogMsg ("psphot", 3, "radius %.1f, nStars: %d, nSigma: %5.2f, X, Y: %f, %f (%f, %f)\n", sigma[i], psfClump.nStars, psfClump.nSigma, psfClump.X, psfClump.Y, sqrt(psfClump.X) / sigma[i], sqrt(psfClump.Y) / sigma[i]); 494 490 491 #if 0 492 // Modifying clump parameters without restoring! 495 493 psMetadataAddS32 (analysis, PS_LIST_TAIL, "PSF.CLUMP.NREGIONS", PS_META_REPLACE, "psf clump regions", 1); 496 494 psMetadata *regionMD = psMetadataLookupPtr (&status, analysis, "PSF.CLUMP.REGION.000"); … … 504 502 psMetadataAddF32 (regionMD, PS_LIST_TAIL, "PSF.CLUMP.DX", PS_META_REPLACE, "psf clump center", psfClump.dX); 505 503 psMetadataAddF32 (regionMD, PS_LIST_TAIL, "PSF.CLUMP.DY", PS_META_REPLACE, "psf clump center", psfClump.dY); 506 507 504 psphotVisualPlotMoments (recipe, analysis, sources); 505 #endif 508 506 509 507 Sout[i] = sqrt(0.5*(psfClump.X + psfClump.Y)) / sigma[i];
Note:
See TracChangeset
for help on using the changeset viewer.
