IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 8, 2008, 2:58:39 PM (18 years ago)
Author:
Paul Price
Message:

Adding check for NAN moments.

File:
1 edited

Legend:

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

    r19987 r20010  
    66 *  @author EAM, IfA: significant modifications.
    77 *
    8  *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2008-10-08 04:23:31 $
     8 *  @version $Revision: 1.62 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2008-10-09 00:58:39 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    347347            float ar = Mxx / Myy;       // Radius
    348348
     349            if (!isfinite(Mxx) || !isfinite(Myy)) {
     350                psTrace("psModules.objects", 10,
     351                        "Rejecting source from clump because of non-finite moments (%f,%f)\n",
     352                        Mxx, Myy);
     353                continue;
     354            }
     355
    349356            // Sx,Sy are limited at 0.  a peak at 0,0 is artificial
    350357            if (fabs(Mxx) < 0.05 || fabs(Myy < 0.05)) {
     
    612619
    613620    if (starsn_moments->n) {
    614         psStats *stats = NULL;
    615         stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX);
    616 
    617         if (!psVectorStats (stats, starsn_moments, NULL, NULL, 0)) {
    618             // Don't care about this error
    619             psErrorClear();
    620         }
    621         psLogMsg ("pmObjects", 3, "SN range (moments): %f - %f\n", stats->min, stats->max);
    622         psFree (stats);
     621        psStats *stats = NULL;
     622        stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX);
     623
     624        if (!psVectorStats (stats, starsn_moments, NULL, NULL, 0)) {
     625            // Don't care about this error
     626            psErrorClear();
     627        }
     628        psLogMsg ("pmObjects", 3, "SN range (moments): %f - %f\n", stats->min, stats->max);
     629        psFree (stats);
    623630    }
    624631    psFree (starsn_moments);
    625632
    626633    if (starsn_peaks->n) {
    627         psStats *stats = NULL;
    628         stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX);
    629         if (!psVectorStats (stats, starsn_peaks, NULL, NULL, 0)) {
    630             // Don't care about this error
    631             psErrorClear();
    632         }
    633         psLogMsg ("pmObjects", 3, "SN range (peaks)  : %f - %f\n", stats->min, stats->max);
    634         psFree (stats);
     634        psStats *stats = NULL;
     635        stats = psStatsAlloc (PS_STAT_MIN | PS_STAT_MAX);
     636        if (!psVectorStats (stats, starsn_peaks, NULL, NULL, 0)) {
     637            // Don't care about this error
     638            psErrorClear();
     639        }
     640        psLogMsg ("pmObjects", 3, "SN range (peaks)  : %f - %f\n", stats->min, stats->max);
     641        psFree (stats);
    635642    }
    636643    psFree (starsn_peaks);
Note: See TracChangeset for help on using the changeset viewer.