IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 30975


Ignore:
Timestamp:
Mar 18, 2011, 2:10:35 PM (15 years ago)
Author:
eugene
Message:

we had 3 items conceptually equivalent to the brightness of a peak: "value", "flux", and "SN"; Ive modified pmPeak to carry explicitly named elements "rawFlux", "smoothFlux", and "detValue". Ive also added the corresponding variance values for rawFlux and smoothFlux. This lets us choose independently of the peak detection process whether flux comparisons are done relative to the smoothed or unsmoothed image. It also simplifies tests of the peak flux compared to something else

Location:
branches/eam_branches/ipp-20110213/psphot
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110213/psphot/src/models/pmModel_STRAIL.c

    r19881 r30975  
    496496
    497497    params[PM_PAR_SKY]  = Smoments->Sky;
    498     params[PM_PAR_I0]   = peak->flux;
     498    params[PM_PAR_I0]   = peak->rawFlux;
    499499    params[PM_PAR_XPOS] = peak->xf;
    500500    params[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psphot/src/models/pmModel_TEST1.c

    r19881 r30975  
    139139
    140140    PAR[PM_PAR_SKY] = moments->Sky;
    141     PAR[PM_PAR_I0]   = peak->flux;
     141    PAR[PM_PAR_I0]   = peak->rawFlux;
    142142    PAR[PM_PAR_XPOS] = peak->xf;
    143143    PAR[PM_PAR_YPOS] = peak->yf;
  • branches/eam_branches/ipp-20110213/psphot/src/psphot.h

    r30936 r30975  
    182182// used by psphotFindDetections
    183183pmReadout      *psphotSignificanceImage (pmReadout *readout, psMetadata *recipe, psImageMaskType maskVal);
    184 psArray        *psphotFindPeaks (psImage *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax);
     184psArray        *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax);
    185185bool            psphotFindFootprints (pmDetections *detections, pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int pass, psImageMaskType maskVal);
    186186psErrorCode     psphotCullPeaks(const pmReadout *readout, const pmReadout *signifRO, const psMetadata *recipe, psArray *footprints);
  • branches/eam_branches/ipp-20110213/psphot/src/psphotBasicDeblend.c

    r29936 r30975  
    6363    for (int i = 0; i < SN->n; i++) {
    6464        source = sources->data[i];
    65         SN->data.F32[i] = source->peak->SN;
     65        SN->data.F32[i] = source->peak->rawFlux;
    6666    }
    6767    psVector *index = psVectorSortIndex (NULL, SN);
     
    115115        // threshold is fraction of the source peak flux
    116116        // image is background subtracted; source->moments->Sky should always be 0.0
    117         threshold = FRACTION * source->peak->SN;
     117        threshold = FRACTION * sqrt(source->peak->detValue);
    118118        // threshold is no less than NSIGMA
    119119        threshold = PS_MAX (threshold, NSIGMA);
     
    138138            testSource = overlap->data[k];
    139139            if (testSource->mode & PM_SOURCE_MODE_BLEND) continue;
    140             if (testSource->peak->value > source->peak->value) continue;
     140            if (testSource->peak->rawFlux > source->peak->rawFlux) continue;
    141141            for (int j = 0; j < xv->n; j+=2) {
    142142                if (fabs(yv->data.F32[j] - testSource->peak->y) > 0.5) continue;
  • branches/eam_branches/ipp-20110213/psphot/src/psphotBlendFit.c

    r30764 r30975  
    104104
    105105    // source analysis is done in S/N order (brightest first)
    106     sources = psArraySort (sources, pmSourceSortBySN);
     106    sources = psArraySort (sources, pmSourceSortByFlux);
    107107    if (!sources->n) {
    108108        psLogMsg ("psphot", PS_LOG_INFO, "no sources, skipping blend");
     
    243243
    244244        // limit selection to some SN limit
    245         if (source->peak->SN < FIT_SN_LIM) continue;
     245        if (sqrt(source->peak->detValue) < FIT_SN_LIM) continue;
    246246
    247247        // exclude sources outside optional analysis region
  • branches/eam_branches/ipp-20110213/psphot/src/psphotChoosePSF.c

    r30772 r30975  
    7070
    7171    // examine PSF sources in S/N order (brightest first)
    72     sources = psArraySort (sources, pmSourceSortBySN);
     72    sources = psArraySort (sources, pmSourceSortByFlux);
    7373
    7474    // structure to store user options defining the psf
  • branches/eam_branches/ipp-20110213/psphot/src/psphotCullPeaks.c

    r30932 r30975  
    11# include "psphotInternal.h"
    2 
    3 # define CULL_WITH_SMOOTHED_IMAGE 1
    42
    53/*
     
    6361    float SAT_THRESHOLD  = 0.05*SATURATION;
    6462
    65 # if (CULL_WITH_SMOOTHED_IMAGE)
     63# if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE)
    6664    psLogMsg ("psphot", PS_LOG_INFO, "Culling peaks from footprints using the smoothed image");
    6765# else
     
    8179        pmPeak *brightPeak = fp->peaks->data[0];
    8280        float max_threshold = SAT_TEST_LEVEL;
    83         if (brightPeak->flux > SAT_TEST_LEVEL) {
     81        if (brightPeak->rawFlux > SAT_TEST_LEVEL) {
    8482            max_threshold = SAT_THRESHOLD;
    8583            brightPeak->type = PM_PEAK_SUSPECT_SATURATION;
    8684        }
    8785
    88 # if (CULL_WITH_SMOOTHED_IMAGE)
     86# if (PM_PEAKS_CULL_WITH_SMOOTHED_IMAGE)
    8987        // New (post r30869) style of culling using the smoothed image and variance (S/N)
    9088        // if we cull using the significance image, then the definition of variance is different (thus the bool in arg 8)
    91         if (pmFootprintCullPeaks(signifR->image, signifR->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, false) != PS_ERR_NONE) {
     89        if (pmFootprintCullPeaks(signifR->image, signifR->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) {
    9290            return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);
    9391        }
    9492# else
    9593        // Old (pre r30869) style of culling using the raw image and variance
    96         if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) {
     94        if (pmFootprintCullPeaks(readout->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, false) != PS_ERR_NONE) {
    9795             return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);
    98         }
    99 # endif
    100 
    101 // Alternate style of culling using the smoothed image and raw variance (probably a bad idea)
    102 # if (0)
    103         if (pmFootprintCullPeaks(signifR->image, readout->variance, fp, nsigma_delta, fPadding, MIN_THRESHOLD, max_threshold, true) != PS_ERR_NONE) {
    104             return psError(PS_ERR_UNKNOWN, false, "Culling pmFootprint %d", fp->id);
    10596        }
    10697# endif
  • branches/eam_branches/ipp-20110213/psphot/src/psphotDeblendSatstars.c

    r30871 r30975  
    7474    for (int i = 0; i < SN->n; i++) {
    7575        source = sources->data[i];
    76         SN->data.F32[i] = source->peak->SN;
     76        SN->data.F32[i] = source->peak->rawFlux;
    7777    }
    7878    psVector *index = psVectorSortIndex (NULL, SN);
     
    8686        // XXX filter? if (source->mode & PM_SOURCE_MODE_SATSTAR) continue;
    8787        if (source->mode & PM_SOURCE_MODE_BLEND) continue;
    88         if (source->peak->flux < SAT_TEST_LEVEL) continue;
     88        if (source->peak->rawFlux < SAT_TEST_LEVEL) continue;
    8989
    9090        // save these for reference below
  • branches/eam_branches/ipp-20110213/psphot/src/psphotEllipticalProfile.c

    r27819 r30975  
    8282    // }
    8383
    84     psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, source->peak->flux, 0.0);
     84    psphotPetrosianVisualProfileRadii (radius, flux, radiusRaw, fluxRaw, source->peak->rawFlux, 0.0);
    8585    // psphotPetrosianVisualProfileByAngle (radius, flux);
    8686
  • branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceAnalysis.c

    r30707 r30975  
    7979
    8080    // source analysis is done in S/N order (brightest first)
    81     sources = psArraySort (sources, pmSourceSortBySN);
     81    sources = psArraySort (sources, pmSourceSortByFlux);
    8282
    8383    // option to limit analysis to a specific region
     
    105105        // limit selection to some SN limit
    106106        assert (source->peak); // how can a source not have a peak?
    107         if (source->peak->SN < SN_LIM) continue;
     107        if (sqrt(source->peak->detValue) < SN_LIM) continue;
    108108
    109109        // limit selection by analysis region
  • branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceAnalysisByObject.c

    r30776 r30975  
    6161
    6262    // source analysis is done in S/N order (brightest first)
    63     objects = psArraySort (objects, pmPhotObjSortBySN);
     63    objects = psArraySort (objects, pmPhotObjSortByFlux);
    6464
    6565    // process the objects in order. 
     
    8888            // limit selection to some SN limit
    8989            assert (source->peak); // how can a source not have a peak?
    90             if (source->peak->SN < SN_LIM) continue;
     90            if (sqrt(source->peak->detValue) < SN_LIM) continue;
    9191            measureSource = true;
    9292        }
  • branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceFits.c

    r30780 r30975  
    146146
    147147    // source analysis is done in S/N order (brightest first)
    148     sources = psArraySort (sources, pmSourceSortBySN);
     148    sources = psArraySort (sources, pmSourceSortByFlux);
    149149
    150150    // choose Cx, Cy (see psphotThreadTools.c for overview of the concepts)
     
    383383          // limit selection to some SN limit
    384384          assert (source->peak); // how can a source not have a peak?
    385           if (source->peak->SN < SNlim) {
     385          if (sqrt(source->peak->detValue) < SNlim) {
    386386              Nfaint ++;
    387387              continue;
  • branches/eam_branches/ipp-20110213/psphot/src/psphotFindDetections.c

    r30903 r30975  
    9393
    9494    // detect the peaks in the significance image
    95     detections->peaks = psphotFindPeaks (significance->variance, readout, recipe, threshold, NMAX);
     95    detections->peaks = psphotFindPeaks (significance, readout, recipe, threshold, NMAX);
    9696    psMetadataAddF32  (readout->analysis, PS_LIST_TAIL, "PEAK_THRESHOLD", PS_META_REPLACE, "Peak Detection Threshold", threshold);
    9797    if (!detections->peaks) {
  • branches/eam_branches/ipp-20110213/psphot/src/psphotFindPeaks.c

    r26894 r30975  
    44// image must be constructed to represent (S/N)^2.  If nMax is non-zero, only return a maximum
    55// of nMax peaks
    6 psArray *psphotFindPeaks (psImage *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax) {
     6psArray *psphotFindPeaks (pmReadout *significance, pmReadout *readout, psMetadata *recipe, const float threshold, const int nMax) {
    77
    88    bool status = false;
     
    1111
    1212    // find the peaks in the smoothed image
    13     psArray *peaks = pmPeaksInImage (significance, threshold);
     13    // NOTE : significance->variance actually carries the detection S/N image
     14    psArray *peaks = pmPeaksInImage (significance->variance, threshold);
    1415    if (peaks == NULL) {
    1516        // we only get a NULL peaks array due to a programming or config error.
     
    3435    for (int i = 0; i < peaks->n; i++) {
    3536        pmPeak *peak = peaks->data[i];
    36         peak->SN = sqrt(peak->value);
    37         peak->flux = readout->image->data.F32[peak->y-row0][peak->x-col0];
    38         // if (peak->flux / peak->value > 5.0/12.0) {
    39         //     psWarning ("odd peak levels (1)");
    40         // }
    41         // if (peak->value / peak->flux > 5*12.0) {
    42         //     psWarning ("odd peak levels (2)");
    43         // }
     37        peak->rawFlux = readout->image->data.F32[peak->y-row0][peak->x-col0];
     38        peak->rawFluxStdev = sqrt(readout->variance->data.F32[peak->y-row0][peak->x-col0]);
     39        peak->smoothFlux = significance->image->data.F32[peak->y-row0][peak->x-col0];
     40        peak->smoothFluxStdev = peak->smoothFlux / sqrt(significance->variance->data.F32[peak->y-row0][peak->x-col0]);
     41        // NOTE smoothFluxStdev is actually (sqrt(variance) / covar_factor)
     42
     43        // do we need this or not?
     44        // peak->SN = sqrt(peak->detValue);
     45
    4446        if (readout->variance && isfinite (peak->dx)) {
    4547            peak->dx *= sqrt(readout->variance->data.F32[peak->y-row0][peak->x-col0]);
     
    5153
    5254    // limit the total number of returned peaks as specified
    53     psArraySort (peaks, pmPeakSortBySN);
     55    psArraySort (peaks, pmPeaksSortByRawFluxDescend);
    5456    if (nMax && (peaks->n > nMax)) {
    5557        psArray *tmpPeaks = psArrayAllocEmpty (nMax);
  • branches/eam_branches/ipp-20110213/psphot/src/psphotFitSourcesLinear.c

    r30784 r30975  
    174174        if (modelSum < 0.8) {
    175175            fprintf (stderr, "low-sig model @ %f, %f (%f sum, %f peak)\n",
    176                      source->peak->xf, source->peak->yf, modelSum, source->peak->flux);
     176                     source->peak->xf, source->peak->yf, modelSum, source->peak->rawFlux);
    177177        }
    178178
  • branches/eam_branches/ipp-20110213/psphot/src/psphotGuessModels.c

    r30932 r30975  
    176176
    177177        // the guess central intensity comes from the peak:
    178         float Io = source->peak->flux;
     178        float Io = source->peak->rawFlux;
    179179
    180180        // We have two options to get a guess for the object position: the position from the
  • branches/eam_branches/ipp-20110213/psphot/src/psphotLoadSRCTEXT.c

    r29004 r30975  
    7878
    7979            source->peak = pmPeakAlloc(PAR[PM_PAR_XPOS], PAR[PM_PAR_YPOS], peakFlux, PM_PEAK_LONE);
    80             source->peak->flux = peakFlux;
     80            source->peak->rawFlux = peakFlux;
     81            source->peak->smoothFlux = peakFlux;
    8182            source->peak->dx   = dPAR[PM_PAR_XPOS];
    8283            source->peak->dy   = dPAR[PM_PAR_YPOS];
  • branches/eam_branches/ipp-20110213/psphot/src/psphotMergeSources.c

    r30883 r30975  
    111111
    112112                // the supplied peak flux needs to be re-normalized
    113                 source->peak->flux = 1.0;
    114                 source->peak->value = 1.0;
     113                source->peak->rawFlux = 1.0;
     114                source->peak->smoothFlux = 1.0;
     115                source->peak->detValue = 1.0;
    115116
    116117                // drop the loaded source modelPSF
     
    282283    for (int i = 0; i < sources->n; i++) {
    283284      pmSource *source = sources->data[i];
    284       source->peak->flux = source->moments->Peak;
     285      source->peak->rawFlux = source->moments->Peak;
     286      source->peak->smoothFlux = source->moments->Peak;
    285287    }
    286288
     
    332334        float ypos = model->params->data.F32[PM_PAR_YPOS];
    333335
    334         pmPeak *peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE);
     336        pmPeak *peak = pmPeakAlloc(xpos, ypos, flux, PM_PEAK_LONE);
    335337        peak->xf = xpos;
    336338        peak->yf = ypos;
    337         peak->flux = flux; // this are being set wrong, but does it matter?
    338 
    339         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    340           peak->SN = 1.0 / source->errMag;
    341         } else {
    342           peak->SN = 0.0;
    343         }
     339        peak->rawFlux = flux; // this are being set wrong, but does it matter?
     340        peak->smoothFlux = flux; // this are being set wrong, but does it matter?
    344341
    345342        psArrayAdd (detections->peaks, 100, peak);
     
    383380        float ypos = model->params->data.F32[PM_PAR_YPOS];
    384381
    385         pmPeak *peak = pmPeakAlloc(xpos, ypos, 1.0, PM_PEAK_LONE);
     382        pmPeak *peak = pmPeakAlloc(xpos, ypos, flux, PM_PEAK_LONE);
    386383        peak->xf = xpos;
    387384        peak->yf = ypos;
    388         peak->flux = flux; // this are being set wrong, but does it matter?
    389 
    390         if (isfinite (source->errMag) && (source->errMag > 0.0)) {
    391           peak->SN = 1.0 / source->errMag;
    392         } else {
    393           peak->SN = 0.0;
    394         }
     385        peak->rawFlux = flux; // this are being set wrong, but does it matter?
     386        peak->smoothFlux = flux; // this are being set wrong, but does it matter?
    395387
    396388        source->peak = peak;
     
    686678        objectsOut->data[k] = objectOut;
    687679
    688         objectOut->SN = objectSrc->SN;
    689         objectOut->x  = objectSrc->x;
    690         objectOut->y  = objectSrc->y;
     680        objectOut->flux = objectSrc->flux;
     681        objectOut->x    = objectSrc->x;
     682        objectOut->y    = objectSrc->y;
    691683       
    692684        objectOut->sources = psArrayAlloc(objectSrc->sources->n);
  • branches/eam_branches/ipp-20110213/psphot/src/psphotMosaicSubimage.c

    r21253 r30975  
    2929    inRegion = psRegionForImage (inImage, inRegion);
    3030
    31     float peak = source->peak->flux;
     31    float peak = source->peak->rawFlux;
    3232
    3333    psImage *subImage = psImageSubset (inImage, inRegion);
  • branches/eam_branches/ipp-20110213/psphot/src/psphotOutput.c

    r30749 r30975  
    7070        // float mpeak = model ? model->params->data.F32[PM_PAR_I0] : NAN;
    7171        // bool subtracted = source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED;
    72         // fprintf (stderr, "%d %d : %d : %f %f : %f %f\n", source->peak->x, source->peak->y, subtracted, source->peak->flux, source->pixels->data.F32[yc][xc], mcore, mpeak);
     72        // fprintf (stderr, "%d %d : %d : %f %f : %f %f\n", source->peak->x, source->peak->y, subtracted, source->peak->rawFlux, source->pixels->data.F32[yc][xc], mcore, mpeak);
    7373
    7474        fprintf (f, "%6.1f %6.1f : %6.1f %6.1f : %8.3f %8.3f %8.3f : %f : %f %f %f : %f\n",
     
    436436        if (!source->moments) continue;
    437437
    438         float Io = source->peak->flux;
     438        float Io = source->peak->rawFlux;
    439439
    440440        fprintf (f, "%f %f : %f %f :: %f\n",
  • branches/eam_branches/ipp-20110213/psphot/src/psphotPetrosianAnalysis.c

    r30624 r30975  
    2929
    3030    // source analysis is done in S/N order (brightest first)
    31     sources = psArraySort (sources, pmSourceSortBySN);
     31    sources = psArraySort (sources, pmSourceSortByFlux);
    3232
    3333    // choose the sources of interest
  • branches/eam_branches/ipp-20110213/psphot/src/psphotRadialApertures.c

    r30932 r30975  
    7979    // source analysis is done in S/N order (brightest first)
    8080    // XXX are we getting the objects out of order? does it matter?
    81     sources = psArraySort (sources, pmSourceSortBySN);
     81    sources = psArraySort (sources, pmSourceSortByFlux);
    8282
    8383    // option to limit analysis to a specific region
     
    9999        // limit selection to some SN limit
    100100        assert (source->peak); // how can a source not have a peak?
    101         if (source->peak->SN < SN_LIM) continue;
     101        if (sqrt(source->peak->detValue) < SN_LIM) continue;
    102102
    103103        // limit selection by analysis region
  • branches/eam_branches/ipp-20110213/psphot/src/psphotRadialAperturesByObject.c

    r30776 r30975  
    6060   
    6161    // source analysis is done in S/N order (brightest first)
    62     objects = psArraySort (objects, pmPhotObjSortBySN);
     62    objects = psArraySort (objects, pmPhotObjSortByFlux);
    6363
    6464    // generate look-up arrays for readouts
     
    106106            // limit selection to some SN limit
    107107            assert (source->peak); // how can a source not have a peak?
    108             if (source->peak->SN < SN_LIM) continue;
     108            if (sqrt(source->peak->detValue) < SN_LIM) continue;
    109109
    110110            int index = source->imageID;
  • branches/eam_branches/ipp-20110213/psphot/src/psphotRadialProfile.c

    r30776 r30975  
    1414    float Rmax = 200;
    1515    float fluxMin = 0.0;
    16     float fluxMax = source->peak->flux;
     16    float fluxMax = source->peak->rawFlux;
    1717
    1818    bool RAW_RADIUS = psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_RAW_RADIUS");
  • branches/eam_branches/ipp-20110213/psphot/src/psphotReplaceUnfit.c

    r30771 r30975  
    239239      if (isPSF || model->isPCM) {
    240240          // the guess central intensity comes from the peak:
    241           float Io = source->peak->flux;
     241          float Io = source->peak->rawFlux;
    242242          float Xo = source->modelPSF->params->data.F32[PM_PAR_XPOS];
    243243          float Yo = source->modelPSF->params->data.F32[PM_PAR_YPOS];
  • branches/eam_branches/ipp-20110213/psphot/src/psphotSavePSFStars.c

    r19869 r30975  
    1717
    1818    // examine PSF sources in S/N order (brightest first)
    19     sources = psArraySort (sources, pmSourceSortBySN);
     19    sources = psArraySort (sources, pmSourceSortByFlux);
    2020
    2121    // counters to track the size of the image and area used in a row
  • branches/eam_branches/ipp-20110213/psphot/src/psphotSourceFits.c

    r30790 r30975  
    5151    psArrayAdd (sourceSet, 16, source);
    5252
    53     psTrace ("psphot", 4, "fitting blended source at %f %f : %f\n", source->peak->xf, source->peak->yf, source->peak->flux);
     53    psTrace ("psphot", 4, "fitting blended source at %f %f : %f\n", source->peak->xf, source->peak->yf, source->peak->rawFlux);
    5454
    5555    // we need to include all blends in the fit (unless primary is saturated?)
     
    6969
    7070        // XXX assume local sky is 0.0?
    71         model->params->data.F32[PM_PAR_I0] = blend->peak->flux;
     71        model->params->data.F32[PM_PAR_I0] = blend->peak->rawFlux;
    7272        model->params->data.F32[PM_PAR_XPOS] = blend->peak->xf;
    7373        model->params->data.F32[PM_PAR_YPOS] = blend->peak->yf;
     
    8383        psArrayAdd (sourceSet, 16, blend);
    8484
    85         psTrace ("psphot", 5, "adding source at %f %f : %f\n", blend->peak->xf, blend->peak->yf, blend->peak->flux);
     85        psTrace ("psphot", 5, "adding source at %f %f : %f\n", blend->peak->xf, blend->peak->yf, blend->peak->rawFlux);
    8686
    8787        // free to avoid double counting model
  • branches/eam_branches/ipp-20110213/psphot/src/psphotSourceMatch.c

    r30892 r30975  
    233233            float peakFlux = readout->image->data.F32[(int)(obj->y-row0-0.5)][(int)(obj->x-col0-0.5)];
    234234            pmPeak *peak = pmPeakAlloc(obj->x, obj->y, peakFlux, PM_PEAK_LONE);
    235             peak->flux = peakFlux;
    236             peak->SN = 1.0;
     235            peak->rawFlux = peakFlux;
     236            peak->smoothFlux = peakFlux;
    237237            peak->xf = obj->x;
    238238            peak->yf = obj->y;
  • branches/eam_branches/ipp-20110213/psphot/src/psphotSourcePlots.c

    r25755 r30975  
    1818
    1919    // examine PSF sources in S/N order (brightest first)
    20     sources = psArraySort (sources, pmSourceSortBySN);
     20    sources = psArraySort (sources, pmSourceSortByFlux);
    2121
    2222    // counters to track the size of the image and area used in a row
  • branches/eam_branches/ipp-20110213/psphot/src/psphotSourceSize.c

    r30772 r30975  
    12681268
    12691269        // Soften variances (add systematic error)
    1270         float softening = options->soft * PS_SQR(source->peak->flux); // Softening for variances
     1270        float softening = options->soft * PS_SQR(source->peak->rawFlux); // Softening for variances
    12711271
    12721272        // Across the middle: y = 0
  • branches/eam_branches/ipp-20110213/psphot/src/psphotSourceStats.c

    r30883 r30975  
    398398
    399399        // skip faint sources for moments measurement
    400         if (source->peak->SN < MIN_SN) {
     400        if (sqrt(source->peak->detValue) < MIN_SN) {
    401401            source->mode |= PM_SOURCE_MODE_BELOW_MOMENTS_SN;
    402402            Nfaint++;
     
    494494    int   Nout[NSIGMA]; // number of stars found in clump : use this to control the number of regions measured by psphotRoughClass
    495495
    496     // this sorts by peak->SN
    497     sources = psArraySort (sources, pmSourceSortBySN);
     496    // this sorts by peak->rawFlux
     497    sources = psArraySort (sources, pmSourceSortByFlux);
    498498
    499499    // loop over radii:
     
    508508
    509509            // skip faint sources for moments measurement
    510             if (source->peak->SN < MIN_SN) {
     510            if (sqrt(source->peak->detValue) < MIN_SN) {
    511511                continue;
    512512            }
  • branches/eam_branches/ipp-20110213/psphot/src/psphotStackMatchPSFsUtils.c

    r30772 r30975  
    6464        }
    6565        if (!source->peak) continue;
    66         if (source->peak->SN < SN_MIN) continue;
     66        if (sqrt(source->peak->detValue) < SN_MIN) continue;
    6767        coordsFromSource(&x->data.F32[numGood], &y->data.F32[numGood], source);
    6868        numGood++;
     
    8181        }
    8282        if (!source->peak) continue;
    83         if (source->peak->SN < SN_MIN) continue;
     83        if (sqrt(source->peak->detValue) < SN_MIN) continue;
    8484        float xSource, ySource;         // Coordinates of source
    8585        coordsFromSource(&xSource, &ySource, source);
  • branches/eam_branches/ipp-20110213/psphot/src/psphotTestPSF.c

    r21183 r30975  
    1717
    1818    // examine PSF sources in S/N order (brightest first)
    19     sources = psArraySort (sources, pmSourceSortBySN);
     19    sources = psArraySort (sources, pmSourceSortByFlux);
    2020
    2121    // array to store candidate PSF stars
  • branches/eam_branches/ipp-20110213/psphot/src/psphotVisual.c

    r30883 r30975  
    10291029
    10301030    // examine PSF sources in S/N order (brightest first)
    1031     sources = psArraySort (sources, pmSourceSortBySN);
     1031    sources = psArraySort (sources, pmSourceSortByFlux);
    10321032
    10331033    // counters to track the size of the image and area used in a row
     
    11811181
    11821182    // examine PSF sources in S/N order (brightest first)
    1183     sources = psArraySort (sources, pmSourceSortBySN);
     1183    sources = psArraySort (sources, pmSourceSortByFlux);
    11841184
    11851185    // counters to track the size of the image and area used in a row
  • branches/eam_branches/ipp-20110213/psphot/test/tap_psphot_forced.pro

    r30838 r30975  
    134134
    135135  # create the chip output
    136   echo ppImage $ppImageConfig -file $basename.fits $basename
    137   exec ppImage $ppImageConfig -file $basename.fits $basename
     136  echo ppImage $ppImageConfig -file $basename.fits $basename -seed 12345
     137  exec ppImage $ppImageConfig -file $basename.fits $basename -seed 12345
    138138end
    139139
     
    158158  $forcedOpt = $forcedOpt -psf $basename.psf
    159159  $forcedOpt = $forcedOpt -srctext $basename.$2.frc.dat
    160   exec psphotForced $forcedOpt $basename.$2.frc
     160  exec psphotForced $forcedOpt $basename.$2.frc -seed 12345
    161161end
    162162
Note: See TracChangeset for help on using the changeset viewer.