Changeset 23609 for trunk/ppMerge/src/ppMergeLoop.c
- Timestamp:
- Mar 30, 2009, 2:34:27 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/ppMerge/src/ppMergeLoop.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppMerge/src/ppMergeLoop.c
r23463 r23609 164 164 pmHDU *hdu = pmHDUGetHighest(outFPA, outChip, outCell); // HDU for file 165 165 if (hdu && hdu != lastHDU) { 166 if (!hdu->header) { 167 hdu->header = psMetadataAlloc(); 168 } 166 169 ppMergeVersionHeader(hdu->header); 167 170 lastHDU = hdu; … … 411 414 } 412 415 413 // calculate CTEMASK after stats so stats reflect median image416 // calculate CTEMASK after stats so stats reflect median image 414 417 if (type == PPMERGE_TYPE_CTEMASK && outRO) { 415 // need to apply range cuts on the output image416 psAssert (outRO->mask, "mask is not defined");417 psAssert (outRO->mask->numCols == outRO->image->numCols, "mismatch between image and mask");418 psAssert (outRO->mask->numRows == outRO->image->numRows, "mismatch between image and mask");419 420 // CTEMASK parameters421 float cteMin = psMetadataLookupF32(NULL, arguments, "CTE.MIN"); // Number of fringe points422 423 char *cteMaskName = psMetadataLookupStr (&mdok, config->arguments, "MASK.SET.VALUE");424 psImageMaskType cteMaskValue = pmConfigMaskGet(cteMaskName, config);425 426 psF32 **outputImage = outRO->image->data.F32; 427 psImageMaskType **outputMask = outRO->mask->data.PS_TYPE_IMAGE_MASK_DATA; 428 for (int iy = 0; iy < outRO->image->numRows; iy++) {429 for (int ix = 0; ix < outRO->image->numCols; ix++) {430 if (outputImage[iy][ix] < cteMin) {431 outputMask[iy][ix] |= cteMaskValue;432 }433 }434 }418 // need to apply range cuts on the output image 419 psAssert (outRO->mask, "mask is not defined"); 420 psAssert (outRO->mask->numCols == outRO->image->numCols, "mismatch between image and mask"); 421 psAssert (outRO->mask->numRows == outRO->image->numRows, "mismatch between image and mask"); 422 423 // CTEMASK parameters 424 float cteMin = psMetadataLookupF32(NULL, arguments, "CTE.MIN"); // Number of fringe points 425 426 char *cteMaskName = psMetadataLookupStr (&mdok, config->arguments, "MASK.SET.VALUE"); 427 psImageMaskType cteMaskValue = pmConfigMaskGet(cteMaskName, config); 428 429 psF32 **outputImage = outRO->image->data.F32; 430 psImageMaskType **outputMask = outRO->mask->data.PS_TYPE_IMAGE_MASK_DATA; 431 for (int iy = 0; iy < outRO->image->numRows; iy++) { 432 for (int ix = 0; ix < outRO->image->numCols; ix++) { 433 if (outputImage[iy][ix] < cteMin) { 434 outputMask[iy][ix] |= cteMaskValue; 435 } 436 } 437 } 435 438 } 436 439
Note:
See TracChangeset
for help on using the changeset viewer.
