IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 26785


Ignore:
Timestamp:
Feb 5, 2010, 1:32:17 PM (16 years ago)
Author:
eugene
Message:

updates to psphot APIs to enable stack photometry

Location:
branches/eam_branches/20091201/ppStack/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20091201/ppStack/src/ppStackConvolve.c

    r26690 r26785  
    9494        options->origCovars->data[i] = psMemIncrRefCounter(readout->covariance);
    9595        if (!ppStackMatch(readout, options, i, config)) {
     96            // XXX many things can cause a failure of ppStackMatch -- should some be handled differently?
    9697            psErrorStackPrint(stderr, "Unable to match image %d --- ignoring.", i);
    9798            options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_MATCH;
  • branches/eam_branches/20091201/ppStack/src/ppStackPhotometry.c

    r26674 r26785  
    9090    if (options->stats) {
    9191        pmReadout *photRO = pmFPAviewThisReadout(photView, photFile->fpa); // Readout with the sources
    92         psArray *sources = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.SOURCES"); // Sources
    93         psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0,
    94                          "Number of sources detected", sources ? sources->n : 0);
    95         psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_PHOT", 0,
    96                          "Time to do photometry", psTimerMark("PPSTACK_PHOT"));
     92        pmDetections *detections = psMetadataLookupPtr(NULL, photRO->analysis, "PSPHOT.DETECTIONS"); // detections
     93        if (detections) {
     94            psAssert (detections->allSources, "missing sources?");
     95            psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0, "Number of sources detected", detections->allSources->n);
     96        } else {
     97            psMetadataAddS32(options->stats, PS_LIST_TAIL, "NUM_SOURCES", 0, "Number of sources detected", 0);
     98        }
     99        psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_PHOT", 0, "Time to do photometry", psTimerMark("PPSTACK_PHOT"));
    97100    }
    98101    psFree(photView);
  • branches/eam_branches/20091201/ppStack/src/ppStackPrepare.c

    r26675 r26785  
    177177
    178178        bool redoPhot = psMetadataLookupBool(NULL, recipe, "PHOT");
    179         psArray *sources = NULL;
    180 
     179
     180        pmDetections *detections = NULL;
    181181        if (options->convolve || options->matchZPs || options->photometry || redoPhot) {
    182182            pmReadout *ro = pmFPAviewThisReadout(view, inputFile->fpa); // Readout with sources
    183             sources = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.SOURCES"); // Sources
    184             if (!sources) {
    185                 psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find sources in readout.");
     183            detections = psMetadataLookupPtr(NULL, ro->analysis, "PSPHOT.DETECTIONS"); // Sources
     184            if (!detections) {
     185                psError(PS_ERR_UNEXPECTED_NULL, false, "Unable to find source detections in readout.");
    186186                return NULL;
    187187            }
    188             options->sourceLists->data[index] = psMemIncrRefCounter(sources);
     188            psAssert (detections->allSources, "missing sources?");
     189           
     190            options->sourceLists->data[index] = psMemIncrRefCounter(detections->allSources);
    189191        }
    190192
     
    206208            pmReadout *ro = pmFPAviewThisReadout(view, file->fpa); // Readout of interest
    207209
    208             if (!ppStackInputPhotometer(ro, sources, config)) {
     210            if (!ppStackInputPhotometer(ro, detections->allSources, config)) {
    209211                psError(PS_ERR_UNKNOWN, false, "Unable to do photometry on input sources");
    210212                psFree(view);
Note: See TracChangeset for help on using the changeset viewer.