IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jan 26, 2009, 8:40:07 PM (17 years ago)
Author:
eugene
Message:

incorporating changes from 16bit mask upgrades (eam_branch_20081230)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackLoop.c

    r21092 r21183  
    403403    int numGood = 0;                    // Number of good frames
    404404    int numCols = 0, numRows = 0;       // Size of image
    405     psVector *inputMask = psVectorAlloc(num, PS_TYPE_U8); // Mask for inputs
     405    psVector *inputMask = psVectorAlloc(num, PS_TYPE_VECTOR_MASK); // Mask for inputs
    406406    psVectorInit(inputMask, 0);
    407407    psVector *matchChi2 = psVectorAlloc(num, PS_TYPE_F32); // chi^2 for stamps when matching
     
    449449                          sourceLists->data[i], targetPSF, rng, config)) {
    450450            psErrorStackPrint(stderr, "Unable to match image %d --- ignoring.", i);
    451             inputMask->data.U8[i] = PPSTACK_MASK_MATCH;
     451            inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_MATCH;
    452452            psErrorClear();
    453453            continue;
     
    536536        psVector *values = psVectorAllocEmpty(num, PS_TYPE_F32); // Values to sort
    537537        for (int i = 0; i < num; i++) {
    538             if (inputMask->data.PS_TYPE_MASK_DATA[i] & PPSTACK_MASK_ALL) {
     538            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) {
    539539                continue;
    540540            }
     
    569569            numGood = 0;                    // Number of good images
    570570            for (int i = 0; i < num; i++) {
    571                 if (inputMask->data.PS_TYPE_MASK_DATA[i] & PPSTACK_MASK_ALL) {
     571              if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] & PPSTACK_MASK_ALL) {
    572572                    continue;
    573573                }
    574574                if (matchChi2->data.F32[i] > thresh) {
    575575                    numRej++;
    576                     inputMask->data.PS_TYPE_MASK_DATA[i] |= PPSTACK_MASK_CHI2;
     576                    inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_CHI2;
    577577                    psLogMsg("ppStack", PS_LOG_INFO, "Rejecting image %d because of large matching chi^2: %f",
    578578                             i, matchChi2->data.F32[i]);
     
    647647
    648648        psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits to mask for bad
    649         psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
     649        psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
    650650        if (!pmReadoutStackDefineOutput(outRO, col0, row0, numCols, numRows, true, true, maskBad)) {
    651651            psError(PS_ERR_UNKNOWN, false, "Unable to prepare output.");
     
    728728        inspect = psArrayAlloc(num);
    729729        for (int i = 0; i < num; i++) {
    730             if (inputMask->data.U8[i]) {
     730            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    731731                continue;
    732732            }
     
    739739            psArray *results = job->results; // Results of job
    740740            for (int i = 0; i < num; i++) {
    741                 if (inputMask->data.U8[i]) {
     741                if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    742742                    continue;
    743743                }
     
    765765        // Count images rejected out of hand
    766766        for (int i = 0; i < num; i++) {
    767             if (inputMask->data.U8[i]) {
     767            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    768768                numRejected++;
    769769            }
     
    771771
    772772        for (int i = 0; i < num; i++) {
    773             if (inputMask->data.U8[i]) {
     773            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    774774                continue;
    775775            }
     
    816816        // Reject bad pixels
    817817        for (int i = 0; i < num; i++) {
    818             if (inputMask->data.U8[i]) {
     818            if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    819819                continue;
    820820            }
     
    859859                psWarning("Rejection on image %d didn't work --- reject entire image.", i);
    860860                numRejected++;
    861                 inputMask->data.U8[i] = PPSTACK_MASK_REJECT;
     861                inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_REJECT;
    862862            } else {
    863863                float frac = reject->n / (float)(numCols * numRows); // Pixel fraction
     
    870870                    // reject == NULL means reject image completely
    871871                    reject = NULL;
    872                     inputMask->data.U8[i] = PPSTACK_MASK_BAD;
     872                    inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] = PPSTACK_MASK_BAD;
    873873                    numRejected++;
    874874                }
     
    982982    {
    983983        psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad
    984         psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
     984        psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
    985985        if (!pmReadoutMaskApply(outRO, maskBad)) {
    986986            psWarning("Unable to apply mask");
     
    992992    bool wcsDone = false;           // Have we done the WCS?
    993993    for (int i = 0; i < num; i++) {
    994         if (inputMask->data.U8[i]) {
     994        if (inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i]) {
    995995            continue;
    996996        }
     
    10561056        pmCell *cell1 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG1");
    10571057        pmCell *cell2 = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT.JPEG2");
    1058         psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
     1058        psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
    10591059
    10601060        pmReadout *ro1 = pmReadoutAlloc(cell1), *ro2 = pmReadoutAlloc(cell2); // Binned readouts
     
    10781078        int renormNum = psMetadataLookupS32(&mdok, recipe, "RENORM.NUM"); // Number of samples
    10791079        float renormWidth = psMetadataLookupS32(&mdok, recipe, "RENORM.WIDTH"); // Width of Gaussian phot
    1080         psMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
     1080        psImageMaskType maskValue = pmConfigMaskGet("BLANK", config); // Bits to mask
    10811081        if (!pmReadoutWeightRenormPhot(outRO, maskValue, renormNum, renormWidth,
    10821082                                       renormMean, renormStdev, NULL)) {
     
    11241124        psTrace("ppStack", 1, "Gathering statistics on stacked image....\n");
    11251125        psString maskBadStr = psMetadataLookupStr(NULL, recipe, "MASK.BAD"); // Name of bits for bad
    1126         psMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
     1126        psImageMaskType maskBad = pmConfigMaskGet(maskBadStr, config); // Bits to mask for bad pixels
    11271127
    11281128        ppStatsFPA(stats, outRO->parent->parent->parent, view, maskBad, config);
Note: See TracChangeset for help on using the changeset viewer.