Changeset 21366 for trunk/ppStack/src/ppStackMatch.c
- Timestamp:
- Feb 5, 2009, 5:03:33 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackMatch.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackMatch.c
r21199 r21366 16 16 PM_SOURCE_MODE_CR_LIMIT) // Mask to apply to input sources 17 17 #define FAINT_SOURCE_FRAC 1.0e-4 // Set minimum flux to this fraction of faintest source flux 18 #define COVAR_FRAC 0.01 // Truncation fraction for covariance matrix 18 19 19 20 //#define TESTING // Enable debugging output … … 233 234 } 234 235 235 // Read image, mask, weight236 // Read image, mask, variance 236 237 const char *tempImage = psMetadataLookupStr(NULL, recipe, "TEMP.IMAGE"); // Suffix for image 237 238 const char *tempMask = psMetadataLookupStr(NULL, recipe, "TEMP.MASK"); // Suffix for mask 238 const char *temp Weight = psMetadataLookupStr(NULL, recipe, "TEMP.WEIGHT"); // Suffix for weightmap239 psString imageName = NULL, maskName = NULL, weightName = NULL; // Names for convolved images239 const char *tempVariance = psMetadataLookupStr(NULL, recipe, "TEMP.VARIANCE"); // Suffix for variance map 240 psString imageName = NULL, maskName = NULL, varianceName = NULL; // Names for convolved images 240 241 psStringAppend(&imageName, "%s.%d.%s", outName, numInput, tempImage); 241 242 psStringAppend(&maskName, "%s.%d.%s", outName, numInput, tempMask); 242 psStringAppend(& weightName, "%s.%d.%s", outName, numInput, tempWeight);243 psStringAppend(&varianceName, "%s.%d.%s", outName, numInput, tempVariance); 243 244 244 245 if (!readImage(&readout->image, imageName, config) || !readImage(&readout->mask, maskName, config) || 245 !readImage(&readout-> weight, weightName, config)) {246 !readImage(&readout->variance, varianceName, config)) { 246 247 psError(PS_ERR_IO, false, "Unable to read previously produced image."); 247 248 psFree(imageName); 248 249 psFree(maskName); 249 psFree( weightName);250 psFree(varianceName); 250 251 return false; 251 252 } 252 253 psFree(imageName); 253 254 psFree(maskName); 254 psFree( weightName);255 psFree(varianceName); 255 256 256 257 psRegion *region = psMetadataLookupPtr(NULL, output->analysis, … … 374 375 "RENORM.STDEV")); 375 376 376 if (!pmReadout WeightRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) {377 if (!pmReadoutVarianceRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) { 377 378 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 378 379 psFree(output); … … 444 445 psFree(readout->image); 445 446 psFree(readout->mask); 446 psFree(readout->weight); 447 psFree(readout->variance); 448 psFree(readout->covariance); 447 449 readout->image = psMemIncrRefCounter(output->image); 448 450 readout->mask = psMemIncrRefCounter(output->mask); 449 readout->weight = psMemIncrRefCounter(output->weight); 451 readout->variance = psMemIncrRefCounter(output->variance); 452 readout->covariance = psImageCovarianceTruncate(output->covariance, COVAR_FRAC); 450 453 } else { 451 454 // Fake the convolution … … 559 562 "RENORM.STDEV")); 560 563 561 if (!pmReadout WeightRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) {564 if (!pmReadoutVarianceRenormPixels(readout, maskBad, renormMean, renormStdev, rng)) { 562 565 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 563 566 psFree(output); … … 583 586 psFree(bg); 584 587 585 586 588 #if 0 587 589 #define RADIUS 10 // Radius of photometry
Note:
See TracChangeset
for help on using the changeset viewer.
