IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 20, 2019, 4:14:36 PM (7 years ago)
Author:
eugene
Message:

do not let crazy model axis values trigger an assert -- set extreme aspect-ratio objects to NAN

File:
1 edited

Legend:

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

    r40048 r40809  
    11#include "psphotInternal.h"
    2 
    32
    43typedef struct {
     
    637636                // now save the model parameters in the model structure
    638637
    639                 pmPSF_AxesToModel (model->params->data.F32, axes, model->class->useReff);
     638                // a crazy model can raise an assert in psEllise
     639                if ((fabs(axes.major) > 10000 * fabs(axes.minor)) || (fabs(axes.minor) > 10000 * fabs(axes.major))) {
     640                  model->params->data.F32[PM_PAR_SXX] = NAN;
     641                  model->params->data.F32[PM_PAR_SYY] = NAN;
     642                  model->params->data.F32[PM_PAR_SXY] = NAN;
     643                } else {
     644                  pmPSF_AxesToModel (model->params->data.F32, axes, model->class->useReff);
     645                }
    640646
    641647                model->mag = -2.5 * log10(flux0);
Note: See TracChangeset for help on using the changeset viewer.