IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 7, 2009, 6:43:53 PM (17 years ago)
Author:
eugene
Message:

mask modifications for Image and Vector mask types (ppSim, ppStack, ppSub, pswarp, psphot)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branch_20081230/ppStack/src/ppStackLoop.c

    r20997 r21090  
    401401    int numGood = 0;                    // Number of good frames
    402402    int numCols = 0, numRows = 0;       // Size of image
    403     psVector *inputMask = psVectorAlloc(num, PS_TYPE_U8); // Mask for inputs
     403    psVector *inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs
    404404    psVectorInit(inputMask, 0);
    405405    psVector *matchChi2 = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching
     
    445445                          sourceLists->data[i], targetPSF, rng, config)) {
    446446            psErrorStackPrint(stderr, "Unable to match image %d --- ignoring.", i);
    447             inputMask->data.U8[i] = PPSTACK_MASK_MATCH;
     447            inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_MATCH;
    448448            psErrorClear();
    449449            continue;
     
    501501        psVector *values = psVectorAllocEmpty(num, PS_TYPE_F32); // Values to sort
    502502        for (int i = 0; i < num; i++) {
    503             if (inputMask->data.PS_TYPE_MASK_DATA[i] & PPSTACK_MASK_ALL) {
     503            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) {
    504504                continue;
    505505            }
     
    534534            numGood = 0;                    // Number of good images
    535535            for (int i = 0; i < num; i++) {
    536                 if (inputMask->data.PS_TYPE_MASK_DATA[i] & PPSTACK_MASK_ALL) {
     536              if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) {
    537537                    continue;
    538538                }
    539539                if (matchChi2->data.F32[i] > thresh) {
    540540                    numRej++;
    541                     inputMask->data.PS_TYPE_MASK_DATA[i] |= PPSTACK_MASK_CHI2;
     541                    inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_CHI2;
    542542                    psLogMsg("ppStack", PS_LOG_INFO, "Rejecting image %d because of large matching chi^2: %f",
    543543                             i, matchChi2->data.F32[i]);
     
    612612
    613613        psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad
    614         psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
     614        psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
    615615        if (!pmReadoutStackDefineOutput(outRO, col0, row0, numCols, numRows, true, true, maskBad)) {
    616616            psError(PS_ERR_UNKNOWN, false, "Unable to prepare output.");
     
    714714        inspect = psArrayAlloc(num);
    715715        for (int i = 0; i < num; i++) {
    716             if (inputMask->data.U8[i]) {
     716            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    717717                continue;
    718718            }
     
    725725            psArray *results = job->results; // Results of job
    726726            for (int i = 0; i < num; i++) {
    727                 if (inputMask->data.U8[i]) {
     727                if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    728728                    continue;
    729729                }
     
    751751        // Count images rejected out of hand
    752752        for (int i = 0; i < num; i++) {
    753             if (inputMask->data.U8[i]) {
     753            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    754754                numRejected++;
    755755            }
     
    757757
    758758        for (int i = 0; i < num; i++) {
    759             if (inputMask->data.U8[i]) {
     759            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    760760                continue;
    761761            }
     
    802802        // Reject bad pixels
    803803        for (int i = 0; i < num; i++) {
    804             if (inputMask->data.U8[i]) {
     804            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    805805                continue;
    806806            }
     
    845845                psWarning("Rejection on image %d didn't work --- reject entire image.", i);
    846846                numRejected++;
    847                 inputMask->data.U8[i] = PPSTACK_MASK_REJECT;
     847                inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_REJECT;
    848848            } else {
    849849                float frac = reject->n / (float)(numCols * numRows); // Pixel fraction
     
    856856                    // reject == NULL means reject image completely
    857857                    reject = NULL;
    858                     inputMask->data.U8[i] = PPSTACK_MASK_BAD;
     858                    inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_BAD;
    859859                    numRejected++;
    860860                }
     
    968968    {
    969969        psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad
    970         psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
     970        psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
    971971        if (!pmReadoutMaskApply(outRO, maskBad)) {
    972972            psWarning("Unable to apply mask");
     
    979979    float totExposure = 0.0;            // Total exposure time
    980980    for (int i = 0; i < num; i++) {
    981         if (inputMask->data.U8[i]) {
     981        if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    982982            continue;
    983983        }
     
    10441044        pmCell *cell1 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG1");
    10451045        pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG2");
    1046         psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
     1046        psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
    10471047
    10481048        pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts
     
    10661066        int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples
    10671067        float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot
    1068         psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
     1068        psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
    10691069        if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth,
    10701070                                       renormMean, renormStdev, NULL)) {
     
    11121112        psTrace("ppStack", 1, "Gathering statistics on stacked image....\n");
    11131113        psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad
    1114         psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
     1114        psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
    11151115
    11161116        ppStatsFPA(stats, outRO->parent->parent->parent, view, maskBad, config);
Note: See TracChangeset for help on using the changeset viewer.