IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 29, 2006, 8:32:01 AM (19 years ago)
Author:
magnier
Message:

catch errors in input file (nan)

File:
1 edited

Legend:

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

    r10258 r10854  
    33 *  @author EAM, IfA
    44 *
    5  *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
    6  *  @date $Date: 2006-11-29 02:36:38 $
     5 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
     6 *  @date $Date: 2006-12-29 18:32:01 $
    77 *
    88 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    244244            psString line = psStringNCopy (&buffer[j*BYTES_STAR], BYTES_STAR);
    245245
    246             psList *list = psStringSplit (line, " ", false);
    247             psArray *array = psListToArray (list);
     246            psArray *array = psStringSplitArray (line, " ", false);
    248247
    249248            // XXX this is a bit cheap: I don't even attempt to interpret the
     
    251250            // your milage may vary...
    252251            pmSource *source = pmSourceAlloc ();
    253             pmModel *model = pmModelAlloc (modelType);
    254 
    255             PAR = model->params->data.F32;
    256             dPAR = model->dparams->data.F32;
     252            source->modelPSF = pmModelAlloc (modelType);
     253            source->type = PM_SOURCE_TYPE_STAR;
     254
     255            PAR = source->modelPSF->params->data.F32;
     256            dPAR = source->modelPSF->dparams->data.F32;
    257257
    258258            PAR[PM_PAR_SKY] = pow (atof (array->data[5]), 10.0);
     
    267267            axes.theta  = atof (array->data[10]);
    268268
     269            if (!isfinite(axes.major))
     270                goto skip_source;
     271            if (!isfinite(axes.minor))
     272                goto skip_source;
     273            if (!isfinite(axes.theta))
     274                goto skip_source;
     275
    269276            shape = psEllipseAxesToShape (axes);
    270277
     
    273280            PAR[PM_PAR_SXY] = shape.sxy;
    274281
    275             source->modelPSF = model;
    276             source->type = PM_SOURCE_TYPE_STAR;
    277 
    278282            psArrayAdd (sources, 100, source);
    279283
     284skip_source:
    280285            psFree (line);
    281             psFree (list);
    282286            psFree (array);
    283287            psFree (source);
Note: See TracChangeset for help on using the changeset viewer.