Changeset 24589 for trunk/psphot/src
- Timestamp:
- Jun 25, 2009, 3:53:04 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSourceStats.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSourceStats.c
r23219 r24589 89 89 90 90 if (!psThreadJobAddPending(job)) { 91 psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");91 psError(PS_ERR_UNKNOWN, false, "Unable to launch thread job PSPHOT_SOURCE_STATS"); 92 92 psFree (job); 93 93 return NULL; 94 94 } 95 95 psFree(job); 96 97 # if (0)98 int nfail = 0;99 int nmoments = 0;100 if (!psphotSourceStats_Unthreaded (&nfail, &nmoments, cells->data[j], recipe)) {101 psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");102 return NULL;103 }104 Nfail += nfail;105 Nmoments += nmoments;106 # endif107 96 } 108 97 109 98 // wait for the threads to finish and manage results 110 99 if (!psThreadPoolWait (false)) { 111 psError(PS_ERR_UNKNOWN, false, " Unable to guess model.");100 psError(PS_ERR_UNKNOWN, false, "Failure in thread job PSPHOT_SOURCE_STATS"); 112 101 return NULL; 113 102 } … … 149 138 psMetadata *recipe = job->args->data[1]; 150 139 151 float INNER = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS"); 152 if (!status) return false; 153 float MIN_SN = psMetadataLookupF32 (&status, recipe, "MOMENTS_SN_MIN"); 154 if (!status) return false; 155 float RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS"); 140 float INNER = psMetadataLookupF32 (&status, recipe, "SKY_INNER_RADIUS"); 141 if (!status) return false; 142 float MIN_SN = psMetadataLookupF32 (&status, recipe, "MOMENTS_SN_MIN"); 143 if (!status) return false; 144 float RADIUS = psMetadataLookupF32 (&status, recipe, "PSF_MOMENTS_RADIUS"); 145 if (!status) return false; 146 float MIN_PIXEL_SN = psMetadataLookupF32 (&status, recipe, "MOMENTS_MIN_PIXEL_SN"); 147 if (!status) return false; 148 float SIGMA = psMetadataLookupF32 (&status, recipe, "MOMENTS_GAUSS_SIGMA"); 156 149 if (!status) return false; 157 150 … … 202 195 203 196 // measure basic source moments 204 status = pmSourceMoments (source, RADIUS );197 status = pmSourceMoments (source, RADIUS, SIGMA, MIN_PIXEL_SN); 205 198 if (status) { 206 199 Nmoments ++; … … 212 205 BIG_RADIUS = PS_MIN (INNER, 3*RADIUS); 213 206 psTrace ("psphot", 4, "retrying moments for %d, %d\n", source->peak->x, source->peak->y); 214 status = pmSourceMoments (source, BIG_RADIUS );207 status = pmSourceMoments (source, BIG_RADIUS, 3.0*SIGMA, MIN_PIXEL_SN); 215 208 if (status) { 216 209 source->mode |= PM_SOURCE_MODE_BIG_RADIUS; … … 292 285 293 286 // measure basic source moments 294 status = pmSourceMoments (source, RADIUS );287 status = pmSourceMoments (source, RADIUS, SIGMA, MIN_PIXEL_SN); 295 288 if (status) { 296 289 Nmoments ++; … … 302 295 BIG_RADIUS = PS_MIN (INNER, 3*RADIUS); 303 296 psTrace ("psphot", 4, "retrying moments for %d, %d\n", source->peak->x, source->peak->y); 304 status = pmSourceMoments (source, BIG_RADIUS );297 status = pmSourceMoments (source, BIG_RADIUS, 3.0*SIGMA, MIN_PIXEL_SN); 305 298 if (status) { 306 299 Nmoments ++;
Note:
See TracChangeset
for help on using the changeset viewer.
