IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39500


Ignore:
Timestamp:
Mar 31, 2016, 6:31:12 AM (10 years ago)
Author:
eugene
Message:

copy concepts from image to sigma and counts structures; pre-alloc a header if needed

File:
1 edited

Legend:

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

    r24114 r39500  
    110110                pmHDU *hdu = pmHDUGetHighest(outCell->parent->parent, outCell->parent, outCell); // File HDU
    111111                if (hdu && hdu != *lastHDU) {
     112                    if (!hdu->header) {
     113                        hdu->header = psMetadataAlloc();
     114                    }
    112115                    ppMergeVersionHeader(hdu->header);
    113116                    *lastHDU = hdu;
     
    285288        if (!outCell->process) continue;
    286289
    287         pmHDU *hdu = pmHDUFromCell(outCell); ///< HDU for cell
     290        // pmHDU *hdu = pmHDUFromCell(outCell); ///< HDU for cell
     291        pmHDU *hdu = pmHDUGetLowest(outFPA, outChip, outCell); ///< HDU for cell
    288292        if (!hdu || hdu->blankPHU) continue;
    289293
     
    307311
    308312        // Supplementary outputs
     313        pmCell *countsCell = NULL;
     314        pmCell *sigmaCell = NULL;
    309315        {
    310316            // The counts image is fairly useless, but it preserves the model
    311             pmCell *countsCell = pmFPAfileThisCell(config->files, outView, "PPMERGE.OUTPUT.COUNT");
     317            countsCell = pmFPAfileThisCell(config->files, outView, "PPMERGE.OUTPUT.COUNT");
    312318            pmReadout *countsRO = pmReadoutAlloc(countsCell); ///< Readout with count of inputs per pixel
    313319            countsRO->image = psImageAlloc(outRO->mask->numCols, outRO->mask->numRows, PS_TYPE_F32);
     
    316322            psFree(countsRO);
    317323
    318             pmCell *sigmaCell = pmFPAfileThisCell(config->files, outView, "PPMERGE.OUTPUT.SIGMA");
     324            sigmaCell = pmFPAfileThisCell(config->files, outView, "PPMERGE.OUTPUT.SIGMA");
    319325            pmReadout *sigmaRO = pmReadoutAlloc(sigmaCell); ///< Readout with suspect image
    320326            psImage *suspect = psMetadataLookupPtr(NULL, outRO->analysis, PM_MASK_ANALYSIS_SUSPECT);
     
    323329            sigmaRO->data_exists = sigmaCell->data_exists = sigmaCell->parent->data_exists = true;
    324330            psFree(sigmaRO);
     331
    325332        }
    326333
     
    354361            }
    355362            psFree(cells);
     363
     364            // XXX EAM 2016.03.29 : sigmaCell and countsCell need to have their concepts copied from outCell.
     365            // This was causing segfaults for VYSOS5; Why did this ever work for SIMTEST?
     366            if (!pmConceptsCopyCell(countsCell, outCell)) {
     367              psError(PS_ERR_UNKNOWN, false, "Unable to copy cell concepts.");
     368              goto MERGE_MASK_ERROR;
     369            }
     370
     371            if (!pmConceptsCopyCell(sigmaCell, outCell)) {
     372              psError(PS_ERR_UNKNOWN, false, "Unable to copy cell concepts.");
     373              goto MERGE_MASK_ERROR;
     374            }
    356375
    357376            // Statistics on the merged cell using a fake image
Note: See TracChangeset for help on using the changeset viewer.