IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 6, 2010, 6:41:06 PM (16 years ago)
Author:
eugene
Message:

fixing PSPHOT.SOURCES issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/stackphot.20100406/ppSim/src/ppSimInsertGalaxies.c

    r18011 r27630  
    7474    int dY = PM_CELL_TO_CHIP (0.0, y0Cell, yParityCell, binning);
    7575
    76     // psMetadataLookupPtr (readout->analysis, "PSPHOT.SOURCES", 0);
    77 
    78     psArray *sources = psArrayAllocEmpty (galaxies->n);
    79 
     76    pmDetections *detections = psMetadataLookupPtr (readout->analysis, "PSPHOT.DETECTIONS", 0);
     77    if (!detections) {
     78        detections = pmDetectionsAlloc();
     79        detection->allSources = psArrayAllocEmpty (galaxies->n);
     80        psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_DATA_ARRAY | PS_META_REPLACE, "psphot detections", detections);
     81    } else {
     82        psMemIncrRefCounter (detections);
     83    }
     84    psArray *sources = sources = detection->allSources;
    8085
    8186    // add sources to the readout image & weight
     
    181186    }
    182187
    183     // NOTE: readout must be part of the pmFPAfile named "PPSIM.OUTPUT"
    184     // psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE, "psphot sources", sources);
     188    // XXX many leaks in here, i think
     189    psFree (detections);
    185190
    186     // XXX many leaks in here, i think
    187191    return true;
    188192}
Note: See TracChangeset for help on using the changeset viewer.