IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35525


Ignore:
Timestamp:
May 7, 2013, 8:44:53 AM (13 years ago)
Author:
eugene
Message:

fix md collisions / double free; get the right cells for multiple inputs

Location:
branches/eam_branches/ipp-20130419/pswarp/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpMaskStats.c

    r35521 r35525  
    3232    return false;
    3333  }
    34   psMetadataAddS32(stats, PS_LIST_TAIL,"MASKFRAC_NPIX", 0,
    35                    "Number of valid pixels", Npix_valid);
    36   psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_STATIC", 0,
    37                    "Fraction of pixels statically masked", (float) Npix_static / Npix_valid);
    38   psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_DYNAMIC", 0,
    39                    "Fraction of pixels dynamically masked", (float) Npix_dynamic / Npix_valid);
    40   psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_MAGIC", 0,
    41                    "Fraction of pixels magically masked", (float) Npix_magic / Npix_valid);
    42   psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_ADVISORY", 0,
    43                    "Fraction of pixels masked as an advisory", (float) Npix_advisory / Npix_valid);
     34
     35  // XXX with multiple inputs (eg, output stacks -> exposure), these only represent the last input
     36  psMetadataAddS32(stats, PS_LIST_TAIL,"MASKFRAC_NPIX",     PS_META_REPLACE, "Number of valid pixels", Npix_valid);
     37  psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_STATIC",   PS_META_REPLACE, "Fraction of pixels statically masked", (float) Npix_static / Npix_valid);
     38  psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_DYNAMIC",  PS_META_REPLACE, "Fraction of pixels dynamically masked", (float) Npix_dynamic / Npix_valid);
     39  psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_MAGIC",    PS_META_REPLACE, "Fraction of pixels magically masked", (float) Npix_magic / Npix_valid);
     40  psMetadataAddF32(stats,PS_LIST_TAIL, "MASKFRAC_ADVISORY", PS_META_REPLACE, "Fraction of pixels masked as an advisory", (float) Npix_advisory / Npix_valid);
    4441  return true;
    4542}
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpOverlaps.c

    r35512 r35525  
    166166bool pswarpFindOverlap (pmFPA *input, pmFPA *output, pswarpBounds *src, pswarpBounds *tgt) {
    167167
     168    bool status = false;
     169
    168170    // we have the source and target bounds.  loop over all output elements and check if any of the source
    169171    // elements overlap it.
     
    204206            psArrayAdd (inputChips, 1, input->chips->data[i]);
    205207        }
    206         chip->process = hasOverlap;
     208        chip->process |= hasOverlap;
    207209        if (hasOverlap) {
     210            pmChipSelectCells (chip);
    208211            // get the complete list of input cells for this set of input chips
    209212            // pmConceptsAverageCells needs a psList (not a psArray)
    210             psList *inputCells = psListAlloc(NULL);
     213            psArray *inputCells = psArrayAllocEmpty(8);
    211214            for (int nChip = 0; nChip < inputChips->n; nChip++) {
    212215                pmChip *inputChip = inputChips->data[nChip];
    213216                for (int nCell = 0; nCell < inputChip->cells->n; nCell++) {
    214217                    fprintf (stderr, "input %d, %d : output %d\n", nChip, nCell, j);
    215                     psListAdd (inputCells, PS_LIST_TAIL, inputChip->cells->data[nCell]);
     218                    psArrayAdd (inputCells, 8, inputChip->cells->data[nCell]);
    216219                }
    217220            }
     
    220223            for (int nCell = 0; nCell < chip->cells->n; nCell++) {
    221224                pmCell *outputCell = chip->cells->data[nCell];
    222                 psMetadataAddPtr(outputCell->analysis, PS_LIST_TAIL, "INPUT.CELLS", PS_DATA_LIST , "input cells touching this output cell", inputCells);
     225                psList *outList = psMetadataLookupPtr(&status, outputCell->analysis, "INPUT.CELLS");
     226                if (!outList) {
     227                    outList = psListAlloc(NULL);
     228                    psMetadataAddPtr(outputCell->analysis, PS_LIST_TAIL, "INPUT.CELLS", PS_DATA_LIST , "input cells touching this output cell", outList);
     229                    psFree (outList);
     230                }
     231                for (int nCell = 0; nCell < inputCells->n; nCell ++) {
     232                    psListAdd (outList, PS_LIST_TAIL, inputCells->data[nCell]);
     233                }
    223234            }
    224235            psFree (inputCells);
  • branches/eam_branches/ipp-20130419/pswarp/src/pswarpPixelsLit.c

    r35512 r35525  
    7272    }
    7373
    74     // XXX need to add these in a container appropriate to the element
    7574    if (stats) {
    76         psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMIN", 0, "Minimum valid x value", xMin);
    77         psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMAX", 0, "Maximum valid x value", xMax);
    78         psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMIN", 0, "Minimum valid y value", yMin);
    79         psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMAX", 0, "Maximum valid y value", yMax);
     75        // XXX with multiple inputs (eg, output stacks -> exposure), these only represent the last input
     76        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMIN", PS_META_REPLACE, "Minimum valid x value", xMin);
     77        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.XMAX", PS_META_REPLACE, "Maximum valid x value", xMax);
     78        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMIN", PS_META_REPLACE, "Minimum valid y value", yMin);
     79        psMetadataAddS32(stats, PS_LIST_TAIL, "RANGE.YMAX", PS_META_REPLACE, "Maximum valid y value", yMax);
    8080    }
    8181
Note: See TracChangeset for help on using the changeset viewer.