IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 13, 2007, 1:41:51 PM (19 years ago)
Author:
magnier
Message:

replaced pmModel.status with pmModel.flags; using bit values instead of ints; names are now of the form PM_MODEL_STATUS_XXX; no error on limit saturation for model parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmSourceFitModel.c

    r13034 r13803  
    66 *  @author GLG, MHPCC
    77 *
    8  *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-04-26 01:20:29 $
     8 *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-06-13 23:41:51 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    157157    if (nPix <  nParams + 1) {
    158158        psTrace ("psModules.objects", 4, "insufficient valid pixels\n");
    159         model->status = PM_MODEL_BADARGS;
     159        model->flags |= PM_MODEL_STATUS_BADARGS;
    160160        psFree (x);
    161161        psFree (y);
     
    184184    model->nIter = myMin->iter;
    185185    model->nDOF  = y->n - nParams;
     186    model->flags |= PM_MODEL_STATUS_FITTED;
     187    if (!fitStatus) model->flags |= PM_MODEL_STATUS_NONCONVERGE;
    186188
    187189    // get the Gauss-Newton distance for fixed model parameters
     
    207209    }
    208210
    209     // set the model success or failure status
    210     if (!fitStatus) {
    211         model->status = PM_MODEL_NONCONVERGE;
    212     } else {
    213         model->status = PM_MODEL_SUCCESS;
    214     }
    215 
    216211    // models can go insane: reject these
    217212    onPic &= (params->data.F32[PM_PAR_XPOS] >= source->pixels->col0);
     
    220215    onPic &= (params->data.F32[PM_PAR_YPOS] <  source->pixels->row0 + source->pixels->numRows);
    221216    if (!onPic) {
    222         model->status = PM_MODEL_OFFIMAGE;
     217        model->flags |= PM_MODEL_STATUS_OFFIMAGE;
    223218    }
    224219
     
    461456        psTrace (__func__, 4, "insufficient valid pixels\n");
    462457        psTrace("psModules.objects", 3, "---- %s() end : fail pixels ----\n", __func__);
    463         model->status = PM_MODEL_BADARGS;
     458        model->flags |= PM_MODEL_STATUS_BADARGS;
    464459        psFree (x);
    465460        psFree (y);
     
    529524
    530525        // set the model success or failure status
    531         model->status = fitStatus ? PM_MODEL_SUCCESS : PM_MODEL_NONCONVERGE;
     526        model->flags |= PM_MODEL_STATUS_FITTED;
     527        if (!fitStatus) model->flags |= PM_MODEL_STATUS_NONCONVERGE;
    532528
    533529        // models can go insane: reject these
     
    536532        onPic &= (model->params->data.F32[PM_PAR_XPOS] >= source->pixels->row0);
    537533        onPic &= (model->params->data.F32[PM_PAR_XPOS] <  source->pixels->row0 + source->pixels->numRows);
    538         if (!onPic) {
    539             model->status = PM_MODEL_OFFIMAGE;
    540         }
     534        if (!onPic) model->flags |= PM_MODEL_STATUS_OFFIMAGE;
    541535    }
    542536    psTrace ("psModules.objects", 4, "niter: %d, chisq: %f", myMin->iter, myMin->value);
Note: See TracChangeset for help on using the changeset viewer.