IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3000


Ignore:
Timestamp:
Jan 14, 2005, 1:27:56 PM (22 years ago)
Author:
gusciora
Message:

Replace ADD projections with mathworks formulas.

Location:
trunk/psLib/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r2983 r3000  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-01-13 22:45:28 $
     12*  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-01-14 23:27:55 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    333333         
    334334        */
    335 
    336335        // ********************************************
    337336        // From the mathworks: http://mathworld.wolfram.com/GnomonicProjection.html
     
    431430        // delta_0 and phi_1 are the projection centers, not the point being projected.
    432431        // (delta_0, phi_1) == (projection->R, projection->D)
     432        // XXX: figure out how to use the two-argument atan2() here.
    433433        // ********************************************
    434434        psF32 row = PS_SQRT_F32((coord->x * coord->x) + (coord->y * coord->y));
    435435        psF32 C = atan(row);
    436         tmp->d = asin((cos(C) * sin(projection->D)) + ((coord->y * sin(C) * cos(projection->D)) / row));
     436        tmp->d = asin((cos(C) * sin(projection->D)) +
     437                      ((coord->y * sin(C) * cos(projection->D)) / row));
    437438        psF32 tmpAtan = atan((coord->x * sin(C)) /
    438                              ((row * cos(projection->D) * cos(C)) - (coord->y * sin(projection->D) * sin(C))));
     439                             ((row * cos(projection->D) * cos(C)) -
     440                              (coord->y * sin(projection->D) * sin(C))));
    439441        tmp->r = projection->R + tmpAtan;
    440442
  • trunk/psLib/src/astronomy/psAstrometry.c

    r2990 r3000  
    88 *  @author GLG, MHPCC
    99 *
    10  *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2005-01-14 01:13:15 $
     10 *  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2005-01-14 23:27:55 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    310310    exp->observatory = psMemIncrRefCounter((psPtr)observatory);
    311311
    312     // XXX: how is these value derived?
     312    // XXX: how is this value derived?
    313313    *(double *)&exp->lst = psTimeToLST((psTime*)time,observatory->longitude);
    314314    *(float *)&exp->positionAngle = 0.0f; // XXX: need input, see Bug #207
  • trunk/psLib/src/astronomy/psCoord.c

    r2983 r3000  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-01-13 22:45:28 $
     12*  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-01-14 23:27:55 $
    1414*
    1515*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    333333         
    334334        */
    335 
    336335        // ********************************************
    337336        // From the mathworks: http://mathworld.wolfram.com/GnomonicProjection.html
     
    431430        // delta_0 and phi_1 are the projection centers, not the point being projected.
    432431        // (delta_0, phi_1) == (projection->R, projection->D)
     432        // XXX: figure out how to use the two-argument atan2() here.
    433433        // ********************************************
    434434        psF32 row = PS_SQRT_F32((coord->x * coord->x) + (coord->y * coord->y));
    435435        psF32 C = atan(row);
    436         tmp->d = asin((cos(C) * sin(projection->D)) + ((coord->y * sin(C) * cos(projection->D)) / row));
     436        tmp->d = asin((cos(C) * sin(projection->D)) +
     437                      ((coord->y * sin(C) * cos(projection->D)) / row));
    437438        psF32 tmpAtan = atan((coord->x * sin(C)) /
    438                              ((row * cos(projection->D) * cos(C)) - (coord->y * sin(projection->D) * sin(C))));
     439                             ((row * cos(projection->D) * cos(C)) -
     440                              (coord->y * sin(projection->D) * sin(C))));
    439441        tmp->r = projection->R + tmpAtan;
    440442
  • trunk/psLib/src/dataManip/psFunctions.c

    r2941 r3000  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.79 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-01-10 19:47:11 $
     9 *  @version $Revision: 1.80 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-01-14 23:27:56 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    19131913        if (i<(bounds->n-1)) {
    19141914            if (FLT_EPSILON < fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) {
     1915                printf("ERROR: psErrorMsg(data points must be distinct\n");
    19151916                // XXX: psErrorMsg(data points must be distinct)
    19161917            }
  • trunk/psLib/src/dataManip/psMinimize.c

    r2909 r3000  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.98 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-01-05 20:59:33 $
     11 *  @version $Revision: 1.99 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-01-14 23:27:56 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5757input parameter "x" between 0 and input parameter polyOrder.  The result is
    5858returned as a psVector sums.
    59  
    6059 
    6160XXX: Use a static vector.
     
    693692                    deriv->data.F32[n][p];
    694693            }
    695             // XXX: multiple by -1 here?
     694            // XXX: multiply by -1 here?
    696695            (beta->data.F64[p])*= -1.0;
    697696            psTrace(".psLib.dataManip.psMinimize", 6,
     
    11391138 
    11401139Algorithm:
    1141 XXX completely ad hoc:
    1142 start with the user-supplied starting
    1143 parameter and call that b.  Calculate a/c as a fractional amount
    1144 smaller/larger than b.  Repeat this process until a local minimum is found.
    1145  
    1146 XXX:
    1147 new algorithm:
     1140 
     1141XXX completely ad hoc: 
     1142start with the user-supplied starting parameter and
     1143call that b.  Calculate a/c as a fractional amount smaller/larger than b.
     1144Repeat this process until a local minimum is found.
     1145 
     1146XXX: 
     1147new algorithm: 
    11481148start at x=0, expand in one direction until the function
    11491149decreases.  Then you have two points in the bracket.  Keep going until it
     
    11511151direction.
    11521152 
    1153 XXX:
     1153XXX: 
    11541154This is F32 only.
    11551155 
    1156 XXX:
     1156XXX: 
    11571157output bracket vector should be an input as well.
    11581158*****************************************************************************/
  • trunk/psLib/src/dataManip/psStats.c

    r2989 r3000  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.109 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-01-14 00:53:56 $
     11 *  @version $Revision: 1.110 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-01-14 23:27:56 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    19591959Returns:
    19601960    The histogram structure "out".
    1961  
    1962 XXX: Waiting for direction on how to use the errors parameter.
    19631961 *****************************************************************************/
    19641962psHistogram* psVectorHistogram(psHistogram* out,
  • trunk/psLib/src/math/psMinimize.c

    r2909 r3000  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.98 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-01-05 20:59:33 $
     11 *  @version $Revision: 1.99 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-01-14 23:27:56 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    5757input parameter "x" between 0 and input parameter polyOrder.  The result is
    5858returned as a psVector sums.
    59  
    6059 
    6160XXX: Use a static vector.
     
    693692                    deriv->data.F32[n][p];
    694693            }
    695             // XXX: multiple by -1 here?
     694            // XXX: multiply by -1 here?
    696695            (beta->data.F64[p])*= -1.0;
    697696            psTrace(".psLib.dataManip.psMinimize", 6,
     
    11391138 
    11401139Algorithm:
    1141 XXX completely ad hoc:
    1142 start with the user-supplied starting
    1143 parameter and call that b.  Calculate a/c as a fractional amount
    1144 smaller/larger than b.  Repeat this process until a local minimum is found.
    1145  
    1146 XXX:
    1147 new algorithm:
     1140 
     1141XXX completely ad hoc: 
     1142start with the user-supplied starting parameter and
     1143call that b.  Calculate a/c as a fractional amount smaller/larger than b.
     1144Repeat this process until a local minimum is found.
     1145 
     1146XXX: 
     1147new algorithm: 
    11481148start at x=0, expand in one direction until the function
    11491149decreases.  Then you have two points in the bracket.  Keep going until it
     
    11511151direction.
    11521152 
    1153 XXX:
     1153XXX: 
    11541154This is F32 only.
    11551155 
    1156 XXX:
     1156XXX: 
    11571157output bracket vector should be an input as well.
    11581158*****************************************************************************/
  • trunk/psLib/src/math/psPolynomial.c

    r2941 r3000  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.79 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-01-10 19:47:11 $
     9 *  @version $Revision: 1.80 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-01-14 23:27:56 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    19131913        if (i<(bounds->n-1)) {
    19141914            if (FLT_EPSILON < fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) {
     1915                printf("ERROR: psErrorMsg(data points must be distinct\n");
    19151916                // XXX: psErrorMsg(data points must be distinct)
    19161917            }
  • trunk/psLib/src/math/psSpline.c

    r2941 r3000  
    77 *  polynomials.  It also contains a Gaussian functions.
    88 *
    9  *  @version $Revision: 1.79 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-01-10 19:47:11 $
     9 *  @version $Revision: 1.80 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-01-14 23:27:56 $
    1111 *
    1212 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    19131913        if (i<(bounds->n-1)) {
    19141914            if (FLT_EPSILON < fabs(bounds->data.F32[i+1]-bounds->data.F32[i])) {
     1915                printf("ERROR: psErrorMsg(data points must be distinct\n");
    19151916                // XXX: psErrorMsg(data points must be distinct)
    19161917            }
  • trunk/psLib/src/math/psStats.c

    r2989 r3000  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.109 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2005-01-14 00:53:56 $
     11 *  @version $Revision: 1.110 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2005-01-14 23:27:56 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    19591959Returns:
    19601960    The histogram structure "out".
    1961  
    1962 XXX: Waiting for direction on how to use the errors parameter.
    19631961 *****************************************************************************/
    19641962psHistogram* psVectorHistogram(psHistogram* out,
Note: See TracChangeset for help on using the changeset viewer.