- Timestamp:
- Sep 4, 2009, 2:18:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20090715/psphot/src/psphotPetrosianRadialBins.c
r25178 r25275 13 13 // track the non-overlapping radius values. 14 14 15 bool psphotPetrosianRadialBins (pmSource *source, pmPetrosian *petrosian, float radiusMax) { 15 bool 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 16 26 17 27 psVector *radius = petrosian->radiusElliptical; … … 104 114 psVector *values = psVectorAllocEmpty (flux->n, PS_TYPE_F32); 105 115 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); 106 117 107 118 // integrate flux, radius for each of these bins. since flux is sorted by radius, … … 123 134 // binSB->data.F32[nOut] = stats->sampleMedian; 124 135 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) 126 143 127 144 if (1) { … … 153 170 petrosian->binSBstdev = binSBstdev; 154 171 155 psphotPetrosianVisualProfileRadii (radius, flux, binRad, binSB, 0.0);172 psphotPetrosianVisualProfileRadii (radius, flux, binRad, binSB, source->peak->flux, 0.0); 156 173 157 174 psFree(radMin);
Note:
See TracChangeset
for help on using the changeset viewer.
