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/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src

    • Property svn:ignore
      •  

        old new  
        2121psphotForced
        2222psphotMakePSF
         23psphotStack
  • trunk/psphot/src/psphotSourceStats.c

    r27571 r27657  
    22
    33// convert detections to sources and measure their basic properties (moments, local sky, sky
    4 // variance) Note: this function only generates sources for the new peaks (peak->assigned)
     4// variance) Note: this function only generates sources for the new peaks (peak->assigned).
     5// The new sources are added to any existing sources on detections->newSources.  The sources
     6// on detections->allSources are ignored.
    57bool psphotSourceStats (pmConfig *config, const pmFPAview *view, bool setWindow)
    68{
     
    4042    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
    4143    psAssert (detections, "missing detections?");
    42     psAssert (!detections->newSources, "new sources already defined?");
    4344
    4445    // XXX TEST:
     
    8485
    8586    // generate the array of sources, define the associated pixel
    86     sources = psArrayAllocEmpty (peaks->n);
     87    if (!detections->newSources) {
     88        detections->newSources = psArrayAllocEmpty (peaks->n);
     89    }
     90    sources = detections->newSources;
    8791
    8892    // if there are no peaks, we save the empty source array and return
    8993    if (!peaks->n) {
    90         // save the new sources on the detection structure:
    91         detections->newSources = sources;
    9294        return true;
    9395    }
     
    100102        // create a new source
    101103        pmSource *source = pmSourceAlloc();
     104        source->imageID = index;
    102105
    103106        // add the peak
     
    119122        psLogMsg ("psphot", PS_LOG_INFO, "break point PEAKS, skipping MOMENTS\n");
    120123        psphotVisualShowMoments (sources);
    121         detections->newSources = sources;
    122124        return true;
    123125    }
     
    126128        if (!psphotSetMomentsWindow(recipe, readout->analysis, sources)) {
    127129            psError(PS_ERR_UNEXPECTED_NULL, false, "Failed to determine Moments Window!");
    128             psFree(sources);
     130            psFree(detections->newSources);
    129131            return false;
    130132        }
     
    178180                psError(PS_ERR_UNKNOWN, false, "Unable to launch thread job PSPHOT_SOURCE_STATS");
    179181                psFree (job);
    180                 psFree(sources);
     182                psFree(detections->newSources);
    181183                return false;
    182184            }
     
    187189        if (!psThreadPoolWait (false)) {
    188190            psError(PS_ERR_UNKNOWN, false, "Failure in thread job PSPHOT_SOURCE_STATS");
    189             psFree(sources);
     191            psFree(detections->newSources);
    190192            return false;
    191193        }
     
    215217    psphotVisualShowMoments (sources);
    216218
    217     // save the new sources on the detection structure:
    218     detections->newSources = sources;
    219 
    220 
    221219    if (detections->allSources) {
    222220        psphotMaskCosmicRayFootprintCheck(detections->allSources);
     
    377375        pmSource *source = sources->data[i];
    378376
     377        if (source->tmpFlags & PM_SOURCE_TMPF_MOMENTS_MEASURED) continue;
     378        source->tmpFlags |= PM_SOURCE_TMPF_MOMENTS_MEASURED;
     379
    379380        // skip faint sources for moments measurement
    380381        if (source->peak->SN < MIN_SN) {
Note: See TracChangeset for help on using the changeset viewer.