IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 27, 2005, 3:26:57 PM (21 years ago)
Author:
eugene
Message:

various tests and changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/mark_psf_source.c

    r4574 r4630  
    1515// PS_SOURCE_BRIGHTSTAR
    1616# define MIN_DS 0.01
    17 bool mark_psf_source (psSource *source, float shapeNsigma, float SATURATE)
     17bool mark_psf_source (psSource *source, float shapeNsigma, float minSN, float maxChi, float SATURATE)
    1818{
     19    int keep;
    1920    float dSX, dSY, SX, SY, SN;
    20     float nSx, nSy;
     21    float nSx, nSy, Chi;
    2122
    2223    if (source->modelPSF == NULL) return (false);
     
    2627    if (source->modelPSF->params->data.F32[1] >= SATURATE) {
    2728        if (source->type == PS_SOURCE_PSFSTAR) {
    28             psLogMsg ("psphot", 3, "PSFSTAR marked saturated\n");
     29            psLogMsg ("psphot", 3, "PSFSTAR marked SATSTAR\n");
    2930        }
    3031        source->type = PS_SOURCE_SATSTAR;
     
    3233    }
    3334    if (source->type == PS_SOURCE_SATSTAR) {
    34         psLogMsg ("psphot", 4, "SATSTAR marked bright (fitted peak below saturation)\n");
    35         source->type = PS_SOURCE_BRIGHTSTAR;
     35        psLogMsg ("psphot", 4, "SATSTAR marked GOODSTAR (fitted peak below saturation)\n");
     36        source->type = PS_SOURCE_GOODSTAR;
    3637    }
    3738
     
    4142    dSX = source->modelPSF->dparams->data.F32[4];
    4243    dSY = source->modelPSF->dparams->data.F32[5];
     44    Chi = source->modelPSF->chisq / source->modelPSF->nDOF;
    4345
    4446    nSx = dSX / hypot (MIN_DS, 1 / (SX * SN));
     
    4850    // dsx_o = hypot (1/(SX*SN), MIN_DSX)
    4951
    50     // assign PS_SOURCE_BRIGHTSTAR to bright objects within PSF region of dparams[]
    51     if ((fabs(nSx) < shapeNsigma) && (fabs(nSy) < shapeNsigma)) {
     52    // assign PS_SOURCE_GOODSTAR to bright objects within PSF region of dparams[]
     53    keep = TRUE;
     54    keep &= (fabs(nSx) < shapeNsigma);
     55    keep &= (fabs(nSy) < shapeNsigma);
     56    keep &= (SN > minSN);
     57    keep &= (Chi < maxChi);
     58    if (keep) {
    5259        if (source->type == PS_SOURCE_PSFSTAR) return (true);
    53         source->type = PS_SOURCE_BRIGHTSTAR;
     60        source->type = PS_SOURCE_GOODSTAR;
    5461        return (true);
    5562    }
    5663   
    5764    if (source->type == PS_SOURCE_PSFSTAR) {
    58         psLogMsg ("psphot", 3, "PSFSTAR demoted based on dSx, dSy\n");
     65        psLogMsg ("psphot", 3, "PSFSTAR demoted based on fit quality\n");
    5966    }
    6067
     68    // object appears to be small, suspected defect
     69    if ((nSx <= -shapeNsigma) || (nSy <= -shapeNsigma)) {
     70        source->type = PS_SOURCE_DEFECT;
     71        return (false);
     72    }
     73
     74    // object appears to be large, suspected galaxy
    6175    if ((nSx >= shapeNsigma) || (nSy >= shapeNsigma)) {
    6276        source->type = PS_SOURCE_GALAXY;
    6377        return (false);
    6478    }
    65     // replace DEFECT with COSMIC?
    66     if ((nSx <= -shapeNsigma) || (nSy <= -shapeNsigma)) {
    67         source->type = PS_SOURCE_DEFECT;
     79
     80    // object appears to be extremely faint: what is this?
     81    if (SN < minSN) {
     82        source->type = PS_SOURCE_FAINTSTAR;
    6883        return (false);
    6984    }
    70     psTrace (".psphot.mark_psf_source", 2, "unexpected result: unmarked object\n");
     85
     86    // these are pooly fitted, probable stars near other stars?
     87    source->type = PS_SOURCE_POOR_FIT_PSF;
    7188    return (false);
    7289}       
Note: See TracChangeset for help on using the changeset viewer.