Changeset 5717 for trunk/pois/src/poisCalculateDeviations.c
- Timestamp:
- Dec 6, 2005, 6:43:52 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/pois/src/poisCalculateDeviations.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pois/src/poisCalculateDeviations.c
r3798 r5717 46 46 int y = stamp->y; // Stamp y coord 47 47 if (stamp->status == POIS_STAMP_USED) { 48 psImage *refStamp = psImageSubset(refImage, x - xSize, y - ySize, x + xSize, y + ySize); 49 psImage *inStamp = psImageSubset(inImage, x - xSize, y - ySize, x + xSize, y + ySize); 50 psImage *maskStamp = psImageSubset(mask, x - xSize, y - ySize, x + xSize, y + ySize); 48 psRegion stampRegion = {x - xSize, x + xSize, y - ySize, y + ySize}; 49 psImage *refStamp = psImageSubset(refImage, stampRegion); 50 psImage *inStamp = psImageSubset(inImage, stampRegion); 51 psImage *maskStamp = psImageSubset(mask, stampRegion); 51 52 psImage *convRefStamp = poisConvolveImage(refStamp, maskStamp, solution, kernelParams, config); 52 53 // Calculate chi^2 53 54 (void)psBinaryOp(subStamp, inStamp, "-", convRefStamp); 55 (void)psBinaryOp(subStamp, subStamp, "*", subStamp); 54 56 (void)psBinaryOp(subStamp, subStamp, "/", inStamp); 55 (void)psBinaryOp(subStamp, subStamp, "*", subStamp); 56 psImage *subStampTrim = psImageSubset(subStamp, config->xKernel, config->yKernel, 57 config->xKernel + 2 * footprint, 58 config->yKernel + 2 * footprint); 59 psImage *maskStampTrim = psImageSubset(maskStamp, config->xKernel, config->yKernel, 60 config->xKernel + 2 * footprint, 61 config->yKernel + 2 * footprint); 57 psRegion stampTrim = { config->xKernel, config->xKernel + 2 * footprint, config->yKernel, 58 config->yKernel + 2 * footprint }; 59 psImage *subStampTrim = psImageSubset(subStamp, stampTrim); 60 psImage *maskStampTrim = psImageSubset(maskStamp, stampTrim); 62 61 // Copy image to workaround bug 305 63 62 psImage *tempImage = psImageCopy(NULL, subStampTrim, PS_TYPE_F32); … … 69 68 psFree(tempMask); 70 69 71 deviations->data.F32[s] = s tats->sampleMean * (float)footprint * (float)footprint * 4.0;70 deviations->data.F32[s] = sqrtf(stats->sampleMean / 2.0); 72 71 psTrace("pois.calculateDeviations", 5, "Deviation of stamp %d (%d,%d) is %f\n", s, x, y, 73 72 deviations->data.F32[s]); … … 77 76 snprintf(stampName, MAXCHAR, "stamp%d.fits", s); 78 77 psFits *stampFile = psFitsAlloc(stampName); 79 if (!psFitsWriteImage(stampFile, NULL, subStampTrim, 0 , NULL)) {78 if (!psFitsWriteImage(stampFile, NULL, subStampTrim, 0)) { 80 79 psErrorStackPrint(stderr, "Unable to write stamp: %s\n", stampName); 81 80 } … … 83 82 #endif 84 83 84 #if 0 85 85 psFree(convRefStamp); 86 86 psFree(maskStampTrim); … … 89 89 psFree(refStamp); 90 90 psFree(inStamp); 91 #endif 91 92 } 92 93 }
Note:
See TracChangeset
for help on using the changeset viewer.
