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/ppSimPhotomReadout.c

    r26900 r27630  
    66    PS_ASSERT_PTR_NON_NULL (readout, NULL);
    77
    8     psArray *sources = psMetadataLookupPtr (NULL, readout->analysis, "PSPHOT.SOURCES");
     8    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
     9    psAssert (detections, "missing detections?");
     10
     11    psArray *sources = detections->allSources;
    912    return sources;
    1013}
     
    151154
    152155    // create the exported-metadata and free local data
    153     // XXX this places the sources on readout->analysis as PSPHOT.SOURCES.  modify?
    154     // (or don't supply the sources, and do this with a different function)
    155156    psphotReadoutCleanup(config, readout, recipe, NULL, psf, NULL);
    156157
     
    167168    psAssert (forceReadout, "no forceReadout?");
    168169    pmChipSetDataStatus (forceChip, true);
    169     psMetadataAddArray (forceReadout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "forced photometry ", forceSources);
    170     psFree (forceSources);
     170
     171    pmDetections *detectionsForce = pmDetectionsAlloc();
     172    detectionForce->allSources = forceSources;
     173
     174    // save detections on the readout->analysis
     175    if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "force sources", detectionsForce)) {
     176        psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout");
     177        return false;
     178    }
     179    psFree(detectionsForce);
    171180
    172181    pmCell    *fakeCell    = pmFPAfileThisCell (config->files, view, "PPSIM.FAKE.SOURCES"); psAssert (fakeCell, "no cell?");
     
    179188    psAssert (fakeReadout, "no fakeReadout?");
    180189    pmChipSetDataStatus (fakeChip, true);
    181     psMetadataAddArray (fakeReadout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_META_REPLACE, "fake photometry ", fakeSources);
     190
     191    pmDetections *detectionsFake = pmDetectionsAlloc();
     192    detectionFake->allSources = fakeSources;
     193
     194    // save detections on the readout->analysis
     195    if (!psMetadataAddPtr (readout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, "fake sources", detectionsFake)) {
     196        psError (PSPHOT_ERR_CONFIG, false, "problem saving detections on readout");
     197        return false;
     198    }
     199    psFree(detectionsFake);
    182200
    183201    return true;
Note: See TracChangeset for help on using the changeset viewer.