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/apply_psf_model.c

    r4582 r4630  
    2222    float shapeNsigma = psMetadataLookupF32 (&status, config, "PSF_SHAPE_NSIGMA");
    2323    float OUTER       = psMetadataLookupF32 (&status, config, "OUTER_RADIUS");
     24    float FIT_MIN_SN  = psMetadataLookupF32 (&status, config, "FIT_MIN_SN");
     25    float FIT_MAX_CHI = psMetadataLookupF32 (&status, config, "FIT_MAX_CHI");
    2426
    2527    // set the object surface-brightness limit for fitted pixels
     
    3436
    3537        // skip non-astronomical objects (very likely defects)
    36         if (source->type == PS_SOURCE_DEFECT) continue;
     38        if (source->type == PS_SOURCE_DEFECT) continue; // XX should I try these anyway?
    3739        if (source->type == PS_SOURCE_SATURATED) continue;
    3840
     41        source->modelPSF = NULL;
     42
    3943        // use the source moments, etc to guess basic model parameters
    40         psModel  *model  = pmSourceModelGuess (source, psf->type);
     44        psModel *model  = pmSourceModelGuess (source, psf->type);
    4145
    4246        // set PSF parameters for this model
     
    4448        x = model->params->data.F32[2];
    4549        y = model->params->data.F32[3];
    46         // XXX I need to check if the model center has moved too much relative to the peak
    4750
    4851        // set the fit radius based on the object flux limit and the model
     
    5053        model->radius = modelRadius (model->params, FLUX_LIMIT) + FIT_PADDING;
    5154        if (isnan(model->radius)) {
    52           fprintf (stderr, "error in radius\n");
    53           continue;
     55          psAbort ("apply_psf_model", "error in radius");
    5456        }
    5557       
     
    6567        psImageKeepCircle (source->mask, x, y, model->radius, AND, 0x7f);
    6668        if (!status || (model->params->data.F32[1] < 0)) {
    67           // if the fit fails, we need to change the classification
    6869          psLogMsg ("psphot", 3, "PSF fit failed for %f, %f (%d iterations)\n", x, y, model->nIter);
    69           source->type = PS_SOURCE_OTHER;  // better choice?
     70          source->type = PS_SOURCE_FAIL_FIT_PSF;  // better choice?
    7071          continue;
    7172        }
     
    7576        Nfit ++;
    7677
    77         mark_psf_source (source, shapeNsigma, SATURATE);
     78        mark_psf_source (source, shapeNsigma, FIT_MIN_SN, FIT_MAX_CHI, SATURATE);
    7879        if (subtract_psf_source (source)) {
    7980          Nsub ++;
Note: See TracChangeset for help on using the changeset viewer.