IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 16, 2005, 6:02:29 AM (21 years ago)
Author:
eugene
Message:

improved galaxy model guesses, better handling of errors

File:
1 edited

Legend:

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

    r4375 r4574  
    1515// PS_SOURCE_BRIGHTSTAR
    1616# define MIN_DS 0.01
    17 bool mark_psf_source (psSource *source, float shapeNsigma)
     17bool mark_psf_source (psSource *source, float shapeNsigma, float SATURATE)
    1818{
    1919    float dSX, dSY, SX, SY, SN;
     
    2222    if (source->modelPSF == NULL) return (false);
    2323
    24     // SATSTAR objects are fitted with PSF regardless
    25     if (source->type == PS_SOURCE_SATSTAR) return (true);
     24    // if object has fitted peak above saturation, label as SATSTAR
     25    // remember: fit does not use saturated pixels (masked)
     26    if (source->modelPSF->params->data.F32[1] >= SATURATE) {
     27        if (source->type == PS_SOURCE_PSFSTAR) {
     28            psLogMsg ("psphot", 3, "PSFSTAR marked saturated\n");
     29        }
     30        source->type = PS_SOURCE_SATSTAR;
     31        return (true);
     32    }
     33    if (source->type == PS_SOURCE_SATSTAR) {
     34        psLogMsg ("psphot", 4, "SATSTAR marked bright (fitted peak below saturation)\n");
     35        source->type = PS_SOURCE_BRIGHTSTAR;
     36    }
    2637
    2738    SN  = source->modelPSF->params->data.F32[1]/source->modelPSF->dparams->data.F32[1];
     
    3546    // sigma = 1 / SX
    3647    // dsx = 1 / (SX * SN)
    37     // dsx_o = hypot (1/SX*SN + MIN_DSX)
     48    // dsx_o = hypot (1/(SX*SN), MIN_DSX)
    3849
    3950    // assign PS_SOURCE_BRIGHTSTAR to bright objects within PSF region of dparams[]
    4051    if ((fabs(nSx) < shapeNsigma) && (fabs(nSy) < shapeNsigma)) {
    41       if (source->type == PS_SOURCE_PSFSTAR) return (true);
    42       source->type = PS_SOURCE_BRIGHTSTAR;
    43       return (true);
     52        if (source->type == PS_SOURCE_PSFSTAR) return (true);
     53        source->type = PS_SOURCE_BRIGHTSTAR;
     54        return (true);
    4455    }
    4556   
    4657    if (source->type == PS_SOURCE_PSFSTAR) {
    47       psLogMsg ("psphot", 3, "PSFSTAR demoted based on dSx, dSy\n");
     58        psLogMsg ("psphot", 3, "PSFSTAR demoted based on dSx, dSy\n");
    4859    }
    4960
    5061    if ((nSx >= shapeNsigma) || (nSy >= shapeNsigma)) {
    51       source->type = PS_SOURCE_GALAXY;
    52       return (false);
     62        source->type = PS_SOURCE_GALAXY;
     63        return (false);
    5364    }
    5465    // replace DEFECT with COSMIC?
    5566    if ((nSx <= -shapeNsigma) || (nSy <= -shapeNsigma)) {
    56       source->type = PS_SOURCE_DEFECT;
    57       return (false);
     67        source->type = PS_SOURCE_DEFECT;
     68        return (false);
    5869    }
    5970    psTrace (".psphot.mark_psf_source", 2, "unexpected result: unmarked object\n");
Note: See TracChangeset for help on using the changeset viewer.