Changeset 31670 for trunk/psModules/src/objects/pmSourcePhotometry.c
- Timestamp:
- Jun 22, 2011, 12:48:29 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/objects/pmSourcePhotometry.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/objects/pmSourcePhotometry.c
r31451 r31670 134 134 // measure PSF model photometry 135 135 status = pmSourcePhotometryModel (&source->psfMag, &source->psfFlux, modelPSF); 136 source->psfFluxErr = source->psfFlux * source->psfMagErr;136 source->psfFluxErr = fabs(source->psfFlux * source->psfMagErr); 137 137 138 138 # if (0) … … 191 191 } 192 192 193 pmSourceNeighborFlags (source); 194 193 195 // measure the aperture magnitude, if (SN > AP_MIN_SN) 194 196 if (!isfinite(SN)) { … … 264 266 265 267 */ 268 269 bool pmSourceNeighborFlags (pmSource *source) { 270 271 return false; 272 273 // source must have a peak to have a footprint 274 if (!source) return false; 275 if (!source->peak) return false; 276 if (!source->peak->footprint) return false; 277 if (!source->peak->footprint->peaks) return false; 278 if (!source->peak->footprint->peaks->n) return false; 279 280 // find the brightest peak (first peak) 281 pmPeak *brightPeak = source->peak->footprint->peaks->data[0]; 282 283 // are we the brightest peak? 284 if (source->peak == brightPeak) return true; 285 286 // if not, raise a flag: 287 source->mode2 |= PM_SOURCE_MODE2_HAS_BRIGHTER_NEIGHBOR; 288 289 // but, this is a common situation. more interesting is if the ratio flux_n / (r^2 flux_o) is large 290 291 float radius2 = PS_SQR(source->peak->xf - brightPeak->xf) + PS_SQR(source->peak->yf - brightPeak->yf); 292 293 float ratio = brightPeak->rawFlux / (source->peak->rawFlux * radius2); 294 295 if (ratio > 1) { 296 source->mode2 |= PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_1; 297 } 298 299 if (ratio > 10) { 300 source->mode2 |= PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_10; 301 } 302 303 return true; 304 } 266 305 267 306 // return source model magnitude
Note:
See TracChangeset
for help on using the changeset viewer.
