Changeset 17267
- Timestamp:
- Apr 1, 2008, 12:32:00 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackMatch.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackMatch.c
r17263 r17267 13 13 14 14 //#define TESTING 15 //#define NO_CONVOLUTION15 #define NO_CONVOLUTION 16 16 17 17 bool ppStackMatch(pmReadout *readout, psArray **regions, psArray **kernels, … … 36 36 psStatsOptions renormStdev = psMetadataLookupS32(&mdok, config->arguments, "RENORM.STDEV"); // Statistic for stdev 37 37 int renormWidth = psMetadataLookupS32(&mdok, config->arguments, "RENORM.WIDTH"); // Width for renormalisation box 38 39 // Renormalise the variances if desired40 if (renorm) {41 psLogMsg("ppMerge", PS_LOG_INFO, "Renormalising variance map.");42 if (!pmReadoutWeightRenorm(readout, maskBad, renormMean, renormStdev, renormWidth, rng)) {43 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances.");44 psFree(output);45 return false;46 }47 }48 38 49 39 #ifndef NO_CONVOLUTION … … 190 180 assert((*regions)->n == (*kernels)->n); 191 181 182 // Renormalise the variances if desired 183 if (renorm) { 184 psLogMsg("ppMerge", PS_LOG_INFO, "Renormalising variance map."); 185 if (!pmReadoutWeightRenorm(readout, maskBad, renormMean, renormStdev, renormWidth, rng)) { 186 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 187 psFree(output); 188 return false; 189 } 190 } 191 192 192 // Ensure the background value is zero 193 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN ); // Statistics for background193 psStats *bg = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV); // Statistics for background 194 194 if (!psImageBackground(bg, NULL, readout->image, readout->mask, maskBad, rng)) { 195 195 psWarning("Can't measure background for image."); 196 196 psErrorClear(); 197 197 } else { 198 psLogMsg("ppStack", PS_LOG_INFO, "Correcting convolved image background by %lf (+/- %lf)", 199 psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), psStatsGetValue(bg, PS_STAT_ROBUST_STDEV)); 198 200 (void)psBinaryOp(readout->image, readout->image, "+", 199 201 psScalarAlloc(- psStatsGetValue(bg, PS_STAT_ROBUST_MEDIAN), PS_TYPE_F32)); 200 202 } 203 psFree(bg); 201 204 202 205 psFree(output);
Note:
See TracChangeset
for help on using the changeset viewer.
