IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 21, 2011, 6:18:28 PM (15 years ago)
Author:
eugene
Message:

add source to flag peaks with brighter neighbors in the footprint

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110505/psModules/src/objects/pmSourcePhotometry.c

    r31459 r31654  
    191191    }
    192192
     193    pmSourceNeighborFlags (source);
     194
    193195    // measure the aperture magnitude, if (SN > AP_MIN_SN)
    194196    if (!isfinite(SN)) {
     
    264266
    265267*/
     268
     269bool 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}
    266305
    267306// return source model magnitude
Note: See TracChangeset for help on using the changeset viewer.