IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2009, 2:34:27 PM (17 years ago)
Author:
Paul Price
Message:

Generate the header, if it doesn't exist.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeLoop.c

    r23463 r23609  
    164164                pmHDU *hdu = pmHDUGetHighest(outFPA, outChip, outCell); // HDU for file
    165165                if (hdu && hdu != lastHDU) {
     166                    if (!hdu->header) {
     167                        hdu->header = psMetadataAlloc();
     168                    }
    166169                    ppMergeVersionHeader(hdu->header);
    167170                    lastHDU = hdu;
     
    411414            }
    412415
    413             // calculate CTEMASK after stats so stats reflect median image
     416            // calculate CTEMASK after stats so stats reflect median image
    414417            if (type == PPMERGE_TYPE_CTEMASK && outRO) {
    415                 // need to apply range cuts on the output image
    416                 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 parameters
    421                 float cteMin = psMetadataLookupF32(NULL, arguments, "CTE.MIN"); // Number of fringe points
    422 
    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                }
    435438            }
    436439
Note: See TracChangeset for help on using the changeset viewer.