IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 24, 2010, 2:59:09 PM (16 years ago)
Author:
Paul Price
Message:

Merging trunk in advance of reintegrating into trunk.

Location:
branches/pap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/pap

  • branches/pap/psphot

  • branches/pap/psphot/src/psphotSourceStats.c

    r28013 r28484  
    33// convert detections to sources and measure their basic properties (moments, local sky, sky
    44// 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 
     5// The new sources are added to any existing sources on detections->newSources.  The sources
    66// on detections->allSources are ignored.
    77bool psphotSourceStats (pmConfig *config, const pmFPAview *view, const char *filerule, bool setWindow)
     
    2222    // loop over the available readouts
    2323    for (int i = 0; i < num; i++) {
    24         // if (i == chisqNum) continue; // skip chisq image
     24        // if (i == chisqNum) continue; // skip chisq image
    2525        if (!psphotSourceStatsReadout (config, view, filerule, i, recipe, setWindow)) {
    2626            psError (PSPHOT_ERR_CONFIG, false, "failed to find initial detections for %s entry %d", filerule, i);
     
    9191    // generate the array of sources, define the associated pixel
    9292    if (!detections->newSources) {
    93         detections->newSources = psArrayAllocEmpty (peaks->n);
     93        detections->newSources = psArrayAllocEmpty (peaks->n);
    9494    }
    9595    sources = detections->newSources;
     
    107107        // create a new source
    108108        pmSource *source = pmSourceAlloc();
    109         source->imageID = index;
     109        source->imageID = index;
    110110
    111111        // add the peak
     
    184184            if (!psThreadJobAddPending(job)) {
    185185                psError(PS_ERR_UNKNOWN, false, "Unable to launch thread job PSPHOT_SOURCE_STATS");
    186                 psFree (job);
    187186                psFree(detections->newSources);
    188187                return false;
    189188            }
    190             psFree(job);
    191189        }
    192190
     
    194192        if (!psThreadPoolWait (false)) {
    195193            psError(PS_ERR_UNKNOWN, false, "Failure in thread job PSPHOT_SOURCE_STATS");
    196             psFree(detections->newSources);
     194            psFree(detections->newSources);
    197195            return false;
    198196        }
     
    315313            if (!psThreadJobAddPending(job)) {
    316314                psError(PS_ERR_UNKNOWN, false, "Unable to launch thread job PSPHOT_SOURCE_STATS");
    317                 psFree (job);
    318315                return NULL;
    319316            }
    320             psFree(job);
    321317        }
    322318
     
    380376        pmSource *source = sources->data[i];
    381377
    382         if (source->tmpFlags & PM_SOURCE_TMPF_MOMENTS_MEASURED) continue;
    383         source->tmpFlags |= PM_SOURCE_TMPF_MOMENTS_MEASURED;
     378        if (source->tmpFlags & PM_SOURCE_TMPF_MOMENTS_MEASURED) continue;
     379        source->tmpFlags |= PM_SOURCE_TMPF_MOMENTS_MEASURED;
    384380
    385381        // skip faint sources for moments measurement
     
    493489        psLogMsg ("psphot", 3, "radius %.1f, nStars: %d, nSigma: %5.2f, X,  Y: %f, %f (%f, %f)\n", sigma[i], psfClump.nStars, psfClump.nSigma, psfClump.X, psfClump.Y, sqrt(psfClump.X) / sigma[i], sqrt(psfClump.Y) / sigma[i]);
    494490
     491#if 0
     492        // Modifying clump parameters without restoring!
    495493        psMetadataAddS32 (analysis, PS_LIST_TAIL, "PSF.CLUMP.NREGIONS",  PS_META_REPLACE, "psf clump regions", 1);
    496494        psMetadata *regionMD = psMetadataLookupPtr (&status, analysis, "PSF.CLUMP.REGION.000");
     
    504502        psMetadataAddF32 (regionMD, PS_LIST_TAIL, "PSF.CLUMP.DX", PS_META_REPLACE, "psf clump center", psfClump.dX);
    505503        psMetadataAddF32 (regionMD, PS_LIST_TAIL, "PSF.CLUMP.DY", PS_META_REPLACE, "psf clump center", psfClump.dY);
    506 
    507504        psphotVisualPlotMoments (recipe, analysis, sources);
     505#endif
    508506
    509507        Sout[i] = sqrt(0.5*(psfClump.X + psfClump.Y)) / sigma[i];
Note: See TracChangeset for help on using the changeset viewer.