IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 4, 2009, 2:18:54 PM (17 years ago)
Author:
eugene
Message:

updates to petrosian analysis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psphot/src/psphotPetrosianRadialBins.c

    r25178 r25275  
    1313// track the non-overlapping radius values.
    1414
    15 bool psphotPetrosianRadialBins (pmSource *source, pmPetrosian *petrosian, float radiusMax) {
     15bool psphotPetrosianRadialBins (pmSource *source, pmPetrosian *petrosian, float radiusMax, float skynoise) {
     16
     17    // XXX for testing, let's just set this to a value
     18   
     19    float skyModelErrorSQ = PS_SQR(skynoise);
     20
     21# if (0)
     22    // if backModel or backStdev are missing, the values of sky and/or skyErr will be set to NAN
     23    pmReadout *backModel = psphotSelectBackground (config, view);
     24    pmReadout *backStdev = psphotSelectBackgroundStdev (config, view);
     25# endif
    1626
    1727    psVector *radius = petrosian->radiusElliptical;
     
    104114    psVector *values = psVectorAllocEmpty (flux->n, PS_TYPE_F32);
    105115    psStats *stats = psStatsAlloc(PS_STAT_ROBUST_MEDIAN | PS_STAT_ROBUST_STDEV);
     116    // psStats *stats = psStatsAlloc(PS_STAT_FITTED_MEAN_V4 | PS_STAT_FITTED_STDEV_V4);
    106117
    107118    // integrate flux, radius for each of these bins.  since flux is sorted by radius,
     
    123134            // binSB->data.F32[nOut] = stats->sampleMedian;
    124135            binSB->data.F32[nOut] = stats->robustMedian;
    125             binSBstdev->data.F32[nOut] = stats->robustStdev / sqrt(values->n);
     136            binSBstdev->data.F32[nOut] = sqrt(PS_SQR(stats->robustStdev) / values->n + skyModelErrorSQ);
     137            // binSB->data.F32[nOut] = stats->fittedMean;
     138            // binSBstdev->data.F32[nOut] = sqrt(PS_SQR(stats->fittedStdev) / values->n + skyModelErrorSQ);
     139
     140            // error in the SB is the stdev per bin / sqrt (number of pixels)
     141            // added in quadrature to a fraction of the local sky (not the
     142            // residual flux, but the sky from the sky model)
    126143
    127144            if (1) {
     
    153170    petrosian->binSBstdev = binSBstdev;
    154171
    155     psphotPetrosianVisualProfileRadii (radius, flux, binRad, binSB, 0.0);
     172    psphotPetrosianVisualProfileRadii (radius, flux, binRad, binSB, source->peak->flux, 0.0);
    156173
    157174    psFree(radMin);
Note: See TracChangeset for help on using the changeset viewer.