IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:12:39 PM (15 years ago)
Author:
eugene
Message:

use the smoothed image for footprint culling; use a more stringent culling for saturated stars; more tweaks to get sat stars to be fitted; various updates to psphotStack; unify psphotImageLoop varients; be a bit careful about number of stars in a PSF clump

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotMergeSources.c

    r30624 r31154  
    11# include "psphotInternal.h"
    22
     3// Mask to apply for PSF sources : only exclude bad sources -- we will re-test for extendedness
    34#define PSF_SOURCE_MASK (PM_SOURCE_MODE_FAIL | PM_SOURCE_MODE_SATSTAR | PM_SOURCE_MODE_BLEND | \
    45                         PM_SOURCE_MODE_BADPSF | PM_SOURCE_MODE_DEFECT | PM_SOURCE_MODE_SATURATED | \
    5                          PM_SOURCE_MODE_CR_LIMIT | PM_SOURCE_MODE_EXT_LIMIT) // Mask to apply for PSF sources
     6                         PM_SOURCE_MODE_CR_LIMIT)
    67
    78// for now, let's store the detections on the readout->analysis for each readout
     
    110111
    111112                // the supplied peak flux needs to be re-normalized
    112                 source->peak->flux = 1.0;
    113                 source->peak->value = 1.0;
     113                source->peak->rawFlux = 1.0;
     114                source->peak->smoothFlux = 1.0;
     115                source->peak->detValue = 1.0;
    114116
    115117                // drop the loaded source modelPSF
     
    281283    for (int i = 0; i < sources->n; i++) {
    282284      pmSource *source = sources->data[i];
    283       source->peak->flux = source->moments->Peak;
     285      source->peak->rawFlux = source->moments->Peak;
     286      source->peak->smoothFlux = source->moments->Peak;
    284287    }
    285288
     
    331334        float ypos = model->params->data.F32[PM_PAR_YPOS];
    332335
    333         pmPeak *peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE);
     336        pmPeak *peak = pmPeakAlloc(xpos, ypos, flux, PM_PEAK_LONE);
    334337        peak->xf = xpos;
    335338        peak->yf = ypos;
    336         peak->flux = flux; // this are being set wrong, but does it matter?
    337 
    338         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    339           peak->SN = 1.0 / source->errMag;
    340         } else {
    341           peak->SN = 0.0;
    342         }
    343339
    344340        psArrayAdd (detections->peaks, 100, peak);
     
    347343
    348344    psLogMsg ("psphot", 3, "%ld PSF sources loaded", detections->peaks->n);
     345    psphotVisualShowSources (sources);
     346    psphotVisualShowPeaks (detections);
    349347
    350348    // save detections on the readout->analysis
     
    354352    }
    355353    psFree (detections);
     354
    356355    return true;
    357356}
    358357
    359358// generate the detection structure for the supplied array of sources
     359// XXX this function is currently unused
    360360bool psphotSetSourceParams (pmConfig *config, psArray *sources, pmPSF *psf) {
    361361
     
    378378        float ypos = model->params->data.F32[PM_PAR_YPOS];
    379379
    380         pmPeak *peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE);
     380        pmPeak *peak = pmPeakAlloc(xpos, ypos, flux, PM_PEAK_LONE);
    381381        peak->xf = xpos;
    382382        peak->yf = ypos;
    383         peak->flux = flux; // this are being set wrong, but does it matter?
    384 
    385         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    386           peak->SN = 1.0 / source->errMag;
    387         } else {
    388           peak->SN = 0.0;
    389         }
     383        peak->rawFlux = flux; // this are being set wrong, but does it matter?
     384        peak->smoothFlux = flux; // this are being set wrong, but does it matter?
    390385
    391386        source->peak = peak;
     
    613608
    614609      // allocate image, weight, mask for the new image for each peak
    615       pmSourceRedefinePixels (sourceOut, readoutOut, sourceOut->peak->x, sourceOut->peak->y, sourceOut->modelPSF->fitRadius);
     610      if (sourceOut->modelPSF) {
     611        pmSourceRedefinePixels (sourceOut, readoutOut, sourceOut->peak->x, sourceOut->peak->y, sourceOut->modelPSF->fitRadius);
     612      }
    616613
    617614      // child sources have not been subtracted in this image, but this flag may be raised if
     
    679676        objectsOut->data[k] = objectOut;
    680677
    681         objectOut->SN = objectSrc->SN;
    682         objectOut->x  = objectSrc->x;
    683         objectOut->y  = objectSrc->y;
     678        objectOut->flux = objectSrc->flux;
     679        objectOut->x    = objectSrc->x;
     680        objectOut->y    = objectSrc->y;
    684681       
    685682        objectOut->sources = psArrayAlloc(objectSrc->sources->n);
     
    697694            sourceOut->parent = sourceSrc;
    698695
    699             // keep the original source flags
     696            // keep the original source flags and sequence ID (if set)
     697            sourceOut->seq      = sourceSrc->seq;
    700698            sourceOut->type     = sourceSrc->type;
    701699            sourceOut->mode     = sourceSrc->mode;
     
    723721
    724722            // allocate image, weight, mask for the new image for each peak
    725             pmSourceRedefinePixels (sourceOut, readout, sourceOut->peak->x, sourceOut->peak->y, sourceOut->modelPSF->fitRadius);
     723            if (sourceOut->modelPSF) {
     724              pmSourceRedefinePixels (sourceOut, readout, sourceOut->peak->x, sourceOut->peak->y, sourceOut->modelPSF->fitRadius);
     725            }
    726726
    727727            // child sources have not been subtracted in this image, but this flag may be raised if
Note: See TracChangeset for help on using the changeset viewer.