IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 31654


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

Location:
branches/eam_branches/ipp-20110505/psModules/src/objects
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110505/psModules/src/objects/pmSourceMasks.h

    r31451 r31654  
    5353
    5454    PM_SOURCE_MODE2_PASS1_SRC        = 0x00000080, ///< source detected in first pass analysis
     55
     56    PM_SOURCE_MODE2_HAS_BRIGHTER_NEIGHBOR = 0x00000100, ///< peak is not the brightest in its footprint
     57    PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_1     = 0x00000200, ///< flux_n / (r^2 flux_p) > 1
     58    PM_SOURCE_MODE2_BRIGHT_NEIGHBOR_10    = 0x00000400, ///< flux_n / (r^2 flux_p) > 10
    5559} pmSourceMode2;
    5660
  • 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
  • branches/eam_branches/ipp-20110505/psModules/src/objects/pmSourcePhotometry.h

    r31451 r31654  
    7979double pmSourceModelWeight(const pmSource *Mi, int term, const bool unweighted_sum, const float covarFactor, psImageMaskType maskVal);
    8080
     81bool pmSourceNeighborFlags (pmSource *source);
     82
    8183// retire these:
    8284// double pmSourceCrossProduct(const pmSource *Mi, const pmSource *Mj, const bool unweighted_sum);
Note: See TracChangeset for help on using the changeset viewer.