IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20084


Ignore:
Timestamp:
Oct 12, 2008, 4:05:31 PM (18 years ago)
Author:
eugene
Message:

drop deprecated source size measurements

File:
1 edited

Legend:

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

    r16820 r20084  
    11# include "psphotInternal.h"
    22
    3 // given a pmSource which has been fitted using modelPSF, evaluate the
    4 // resulting fit: did the fit succeed? is this object PSF-like? is this object
    5 // extended?  return status is TRUE for a valid PSF, FALSE otherwise.
     3// given a pmSource which has been fitted using modelPSF, evaluate the resulting fit: did
     4// the fit succeed? is this object saturated? return status is TRUE for a successful PSF
     5// fit, FALSE otherwise. 
    66
    7 // identify objects consistent with PSF shape/magnitude distribution
    8 // we expect dparams[PM_PAR_SXX],dparams[PM_PAR_SXX] to have a scatter of:
    9 // sigma_x / (S/N)
    10 
    11 // any objects which is consistent with the PSF should have
    12 // abs(dparams[PM_PAR_SXX]) < N * dsxLine(mag) & abs(dparams[PM_PAR_SYY]) < N * dsyLine(mag)
    13 // this includes a minimum buffer (DS) for the brighter objects
    14 
    15 // EAM : 2006.10.20 : I have re-defined params[PM_PAR_SXX] : it is now sqrt(2)*sigma_x, not 1/sigma_x
    16 
    17 // saturated stars should fall outside (larger), but have peaks above SATURATION
    18 // extended sources should be larger, cosmic rays smaller
    19 // we also reject objects with S/N too low or ChiSquare to high
    20 
    21 // floor for DS value
    22 // XXX EAM : add to configuration?
     7// NOTE : 2008.10.12 EAM : This function used to make a measurement of the consistency of
     8// the source shape with the PSF.  This feature has been superceded with the
     9// much-better-defined psphotSourceSize.c function
    2310
    2411static float SATURATION;
    2512static float PSF_MIN_SN;
    26 static float PSF_MIN_DS;
    2713static float PSF_MAX_CHI;
    28 static float PSF_SHAPE_NSIGMA;
    29 static float PSF_DSX_MEAN;
    30 static float PSF_DSY_MEAN;
    31 static float PSF_DSX_STDEV;
    32 static float PSF_DSY_STDEV;
    3314
    3415bool psphotInitLimitsPSF (psMetadata *recipe, pmReadout *readout) {
     
    4122    PSF_MIN_SN       = psMetadataLookupF32 (&status, recipe, "PSF_MIN_SN");
    4223    PSF_MAX_CHI      = psMetadataLookupF32 (&status, recipe, "PSF_MAX_CHI");
    43     PSF_SHAPE_NSIGMA = psMetadataLookupF32 (&status, recipe, "PSF_SHAPE_NSIGMA");
    44     PSF_MIN_DS       = psMetadataLookupF32 (&status, recipe, "PSF_MIN_DS");
    45     if (!status) PSF_MIN_DS = 0.01;
    46 
    47     PSF_DSX_MEAN     = psMetadataLookupF32 (&status, recipe, "DSX_MEAN");
    48     PSF_DSY_MEAN     = psMetadataLookupF32 (&status, recipe, "DSY_MEAN");
    49     PSF_DSX_STDEV    = psMetadataLookupF32 (&status, recipe, "DSX_STDV");
    50     PSF_DSY_STDEV    = psMetadataLookupF32 (&status, recipe, "DSY_STDV");
    5124
    5225    return true;
     
    5831
    5932    int keep;
    60     float dSX, dSY, SX, SY, SN;
    61     float nSx, nSy, Chi;
     33    float SN, Chi;
    6234
    6335    // do we actually have a valid PSF model?
     
    12294
    12395    SN  = model->params->data.F32[PM_PAR_I0]/model->dparams->data.F32[PM_PAR_I0];
    124     SX  = model->params->data.F32[PM_PAR_SXX];
    125     SY  = model->params->data.F32[PM_PAR_SYY];
    126     dSX = model->dparams->data.F32[PM_PAR_SXX];
    127     dSY = model->dparams->data.F32[PM_PAR_SYY];
    12896    Chi = model->chisqNorm / model->nDOF;
    129 
    130     // swing of sigma_x,y in sigmas
    131     nSx = (dSX - PSF_DSX_MEAN) / (PSF_DSX_STDEV * PS_MAX (PSF_MIN_DS, (SX / SN)));
    132     nSy = (dSY - PSF_DSY_MEAN) / (PSF_DSY_STDEV * PS_MAX (PSF_MIN_DS, (SY / SN)));
    13397
    13498    // assign PM_SOURCE_MODE_GOODSTAR to bright objects within PSF region of dparams[]
    13599    keep = TRUE;
    136     // keep &= (fabs(nSx) < PSF_SHAPE_NSIGMA);
    137     // keep &= (fabs(nSy) < PSF_SHAPE_NSIGMA);
    138100    keep &= (SN > PSF_MIN_SN);
    139101    keep &= (Chi < PSF_MAX_CHI);
    140102
    141103    if (source->mode & PM_SOURCE_MODE_SATSTAR) {
    142         psTrace ("psphot", 5, "satstar fit results: %f, %f  %d :  %f %f : %f %f : %f %f\n",
    143                      model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], keep,
    144                  dSX, nSx, dSY, nSy, SN, Chi);
     104        psTrace ("psphot", 5, "satstar fit results: %f, %f  %d :  SN: %f  Chisq: %f\n",
     105                     model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], keep, SN, Chi);
    145106    }
    146107
    147108    if (keep) {
    148109        if (source->mode & PM_SOURCE_MODE_PSFSTAR) {
    149             psTrace ("psphot", 7, "PSFSTAR kept (%f, %f  :  %f %f : %f %f : %f %f)\n",
    150                      model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], dSX, nSx, dSY, nSy, SN, Chi);
     110            psTrace ("psphot", 7, "PSFSTAR kept (%f, %f  :  SN: %f Chisq: %f)\n",
     111                     model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], SN, Chi);
    151112        }
    152113        return true;
     
    155116    // this source is not a star, warn if it was a PSFSTAR
    156117    if (source->mode & PM_SOURCE_MODE_PSFSTAR) {
    157         psTrace ("psphot", 5, "PSFSTAR demoted based on fit quality   (%f, %f  :  %f %f : %f %f : %f %f)\n",
    158                   model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], dSX, nSx, dSY, nSy, SN, Chi);
     118        psTrace ("psphot", 5, "PSFSTAR demoted based on fit quality   (%f, %f  :  SN: %f  Chisq: %f)\n",
     119                  model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], SN, Chi);
    159120    } else {
    160         psTrace ("psphot", 5, "fails PSF fit (%f, %f  :  %f %f : %f %f : %f %f)\n",
    161                   model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], dSX, nSx, dSY, nSy, SN, Chi);
    162     }
    163 
    164     // object appears to be small, suspected defect.  this is a weak indication for a defect: a
    165     // large positive or negative swing can also come from the bright sources for which we are
    166     // more sensitive to the wings than for the faint sources. 
    167     // XXX allow -NSIGMA and +NSIGMA to have different values?
    168     if ((nSx <= -PSF_SHAPE_NSIGMA) || (nSy <= -PSF_SHAPE_NSIGMA)) {
    169         source->type = PM_SOURCE_TYPE_DEFECT;
    170         return false;
    171     }
    172 
    173     // object appears to be large, suspected extended source
    174     if ((nSx >= PSF_SHAPE_NSIGMA) || (nSy >= PSF_SHAPE_NSIGMA)) {
    175         source->type = PM_SOURCE_TYPE_EXTENDED;
    176         return false;
     121        psTrace ("psphot", 5, "fails PSF fit (%f, %f  :  SN: %f  Chisq: %f)\n",
     122                  model->params->data.F32[PM_PAR_XPOS], model->params->data.F32[PM_PAR_YPOS], SN, Chi);
    177123    }
    178124
     
    224170
    225171    // if the object has a fitted peak below 0, the fit did not converge cleanly
    226     if (model->params->data.F32[PM_PAR_I0] <= 0) {
     172    if (model->params->data.F32[PM_PAR_I0] <= 0.02) {
    227173        source->mode |= PM_SOURCE_MODE_FAIL;
    228174        return false;
Note: See TracChangeset for help on using the changeset viewer.