Changeset 21236 for branches/pap_branch_20090128/ppStack/src/ppStackLoop.c
- Timestamp:
- Jan 29, 2009, 5:31:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/pap_branch_20090128/ppStack/src/ppStackLoop.c
r21204 r21236 24 24 25 25 // Files required for the convolution 26 static char *convolveFiles[] = { "PPSTACK.INPUT", "PPSTACK.INPUT.MASK", "PPSTACK.INPUT. WEIGHT", NULL };26 static char *convolveFiles[] = { "PPSTACK.INPUT", "PPSTACK.INPUT.MASK", "PPSTACK.INPUT.VARIANCE", NULL }; 27 27 28 28 // Output files for the combination 29 static char *combineFiles[] = { "PPSTACK.OUTPUT", "PPSTACK.OUTPUT.MASK", "PPSTACK.OUTPUT. WEIGHT",29 static char *combineFiles[] = { "PPSTACK.OUTPUT", "PPSTACK.OUTPUT.MASK", "PPSTACK.OUTPUT.VARIANCE", 30 30 "PPSTACK.OUTPUT.JPEG1", "PPSTACK.OUTPUT.JPEG2", NULL }; 31 31 … … 204 204 const char *tempImage = psMetadataLookupStr(NULL, recipe, "TEMP.IMAGE"); // Suffix for temporary images 205 205 const char *tempMask = psMetadataLookupStr(NULL, recipe, "TEMP.MASK"); // Suffix for temporary masks 206 const char *temp Weight = psMetadataLookupStr(NULL, recipe, "TEMP.WEIGHT"); // Suffix for temp weightmaps207 if (!tempImage || !tempMask || !temp Weight) {206 const char *tempVariance = psMetadataLookupStr(NULL, recipe, "TEMP.VARIANCE"); // Suffix for temp variance maps 207 if (!tempImage || !tempMask || !tempVariance) { 208 208 psError(PS_ERR_BAD_PARAMETER_VALUE, false, 209 "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP. WEIGHTin recipe");209 "Unable to find TEMP.IMAGE, TEMP.MASK and TEMP.VARIANCE in recipe"); 210 210 return false; 211 211 } … … 381 381 psArray *imageNames = psArrayAlloc(num); 382 382 psArray *maskNames = psArrayAlloc(num); 383 psArray * weightNames = psArrayAlloc(num);383 psArray *varianceNames = psArrayAlloc(num); 384 384 for (int i = 0; i < num; i++) { 385 psString imageName = NULL, maskName = NULL, weightName = NULL; // Names for convolved images385 psString imageName = NULL, maskName = NULL, varianceName = NULL; // Names for convolved images 386 386 psStringAppend(&imageName, "%s/%s.%d.%s", tempDir, tempName, i, tempImage); 387 387 psStringAppend(&maskName, "%s/%s.%d.%s", tempDir, tempName, i, tempMask); 388 psStringAppend(& weightName, "%s/%s.%d.%s", tempDir, tempName, i, tempWeight);389 psTrace("ppStack", 5, "Temporary files: %s %s %s\n", imageName, maskName, weightName);388 psStringAppend(&varianceName, "%s/%s.%d.%s", tempDir, tempName, i, tempVariance); 389 psTrace("ppStack", 5, "Temporary files: %s %s %s\n", imageName, maskName, varianceName); 390 390 imageNames->data[i] = imageName; 391 391 maskNames->data[i] = maskName; 392 weightNames->data[i] = weightName;392 varianceNames->data[i] = varianceName; 393 393 } 394 394 // Free the outputName that we grabbed above to set up tempName. … … 481 481 writeImage(imageNames->data[i], hdu->header, readout->image, config); 482 482 writeImage(maskNames->data[i], hdu->header, readout->mask, config); 483 writeImage( weightNames->data[i], hdu->header, readout->weight, config);483 writeImage(varianceNames->data[i], hdu->header, readout->variance, config); 484 484 485 485 pmCell *inCell = readout->parent; // Input cell … … 609 609 // Start threading 610 610 ppStackThreadInit(); 611 ppStackThreadData *stack = ppStackThreadDataSetup(cells, imageNames, maskNames, weightNames, config);611 ppStackThreadData *stack = ppStackThreadDataSetup(cells, imageNames, maskNames, varianceNames, config); 612 612 613 613 psTimerStart("PPSTACK_INITIAL"); … … 1023 1023 psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false, false); 1024 1024 psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false, false); 1025 psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false, false);1025 psString varianceResolved = pmConfigConvertFilename(varianceNames->data[i], config, false, false); 1026 1026 if (unlink(imageResolved) == -1 || unlink(maskResolved) == -1 || 1027 unlink( weightResolved) == -1) {1027 unlink(varianceResolved) == -1) { 1028 1028 psWarning("Unable to delete temporary files for image %d", i); 1029 1029 } 1030 1030 psFree(imageResolved); 1031 1031 psFree(maskResolved); 1032 psFree( weightResolved);1032 psFree(varianceResolved); 1033 1033 } 1034 1034 } 1035 1035 psFree(imageNames); 1036 1036 psFree(maskNames); 1037 psFree( weightNames);1037 psFree(varianceNames); 1038 1038 1039 1039 psFree(inputMask); … … 1073 1073 float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot 1074 1074 psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask 1075 if (!pmReadout WeightRenormPhot(outRO, maskValue, renormNum, renormWidth,1076 renormMean, renormStdev, NULL)) {1075 if (!pmReadoutVarianceRenormPhot(outRO, maskValue, renormNum, renormWidth, 1076 renormMean, renormStdev, NULL)) { 1077 1077 psError(PS_ERR_UNKNOWN, false, "Unable to renormalise variances."); 1078 1078 psFree(outRO);
Note:
See TracChangeset
for help on using the changeset viewer.
