IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 29, 2006, 8:30:36 AM (20 years ago)
Author:
magnier
Message:

catch failures on no objects

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryObjects.c

    r10829 r10852  
    88*  @author EAM, IfA
    99*
    10 *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2006-12-25 01:49:49 $
     10*  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2006-12-29 18:30:36 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    569569
    570570        // only check bins with at least 1/2 of max bin
    571         int minNpts = 0.5*imStats->max;
     571        // XXX requiring at least 3 matches in bin
     572        int minNpts = PS_MAX (0.5*imStats->max, 3);
    572573        psTrace("psModule.astrom.grid.angle", 5, "minNpts: %d, max: %d", minNpts, (int)(imStats->max));
    573574
     
    596597
    597598        // convert the bin to delta-delta
    598         stats->offset.x  = DX[minY][minX] / NP[minY][minX];
    599         stats->offset.y  = DY[minY][minX] / NP[minY][minX];
    600         stats->minMetric = minMetric;
    601         stats->minVar    = minVar;
    602         stats->nMatch    = NP[minY][minX];
     599        if ((minX < 0) || (minY < 0))
     600        {
     601            // no valid matches found
     602            stats->offset.x   = 0;
     603            stats->offset.y   = 0;
     604            stats->minMetric  = minMetric;
     605            stats->minVar     = minVar;
     606            stats->nMatch     = 0;
     607        } else
     608        {
     609            stats->offset.x  = DX[minY][minX] / NP[minY][minX];
     610            stats->offset.y  = DY[minY][minX] / NP[minY][minX];
     611            stats->minMetric = minMetric;
     612            stats->minVar    = minVar;
     613            stats->nMatch    = NP[minY][minX];
     614        }
    603615
    604616        psFree (imStats);
Note: See TracChangeset for help on using the changeset viewer.