IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10867


Ignore:
Timestamp:
Jan 1, 2007, 11:04:10 AM (19 years ago)
Author:
magnier
Message:

fixed convergence criterion

File:
1 edited

Legend:

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

    r10825 r10867  
    77 *  @author EAM, IfA
    88 *
    9  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2006-12-22 21:23:06 $
     9 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2007-01-01 21:04:10 $
    1111 *
    1212 *  Copyright 2006 Institute for Astronomy, University of Hawaii
     
    2323// given a 2D transformation -- L(x,y),M(x,y) -- find the coordinates x,y
    2424// for which L,M = 0,0. tol is the allowed error on x,y.
    25 psPlane *psPlaneTransformGetCenter (psPlaneTransform *trans, float tol)
     25psPlane *psPlaneTransformGetCenter (psPlaneTransform *trans, double tol)
    2626{
    2727
     
    4747        * Xo,Yo are in pixels;
    4848        */
    49         float dPos = tol + 1;
    50         for (int i = 0; (dPos > tol) && (i < 10); i++) {
     49        double dPos = tol + 1;
     50        for (int i = 0; (dPos > tol) && (i < 20); i++) {
    5151            // NOTE: order for Alpha is: [y][x]
    5252            Alpha->data.F32[0][0] = psPolynomial2DEval (XdX, Xo, Yo);
     
    6262            Xo -= Beta->data.F32[0];
    6363            Yo -= Beta->data.F32[1];
    64             dPos = hypot(Xo,Yo);
     64            dPos = hypot(Beta->data.F32[0], Beta->data.F32[1]);
    6565        }
    6666        psFree (Alpha);
     
    7979
    8080// convert a transformation L(x,y) to L'(x-xo,y-yo)
    81 psPlaneTransform *psPlaneTransformSetCenter (psPlaneTransform *output, psPlaneTransform *input, float Xo, float Yo)
     81psPlaneTransform *psPlaneTransformSetCenter (psPlaneTransform *output, psPlaneTransform *input, double Xo, double Yo)
    8282{
    8383
Note: See TracChangeset for help on using the changeset viewer.