IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 11, 2010, 5:08:29 PM (16 years ago)
Author:
eugene
Message:

updates to support psphotStack

Location:
trunk/ppSim
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSim

  • trunk/ppSim/src/ppSimInsertGalaxies.c

    r18011 r27657  
    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 (&mdok, readout->analysis, "PSPHOT.DETECTIONS");
     77    if (!detections) {
     78        detections = pmDetectionsAlloc();
     79        detections->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 = detections->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.