IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astronomy/tst_psCoord.c

    r2984 r2998  
    66*  @author GLG, MHPCC
    77*
    8 *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-01-13 22:53:37 $
     8*  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     9*  @date $Date: 2005-01-14 23:25:39 $
    1010*
    1111*  XXX: Must test psSpherePrecess.
    12 *  XXX: psSphereSetOffset(&position1, &offset, PS_LINEAR, 0) doesn't work?
     12*  XXX: THe psProject() and psDeproject() functions do not work fully.  They
     13*  are not tested here.  The SphereGet/SetOffset() code that rely on them
     14*  is not tested.
     15*
    1316*  XXX: Test with a bad offfset unit type in the SphereGet/SetOffset() functions.
    1417*
     
    1821#include "psTest.h"
    1922#include "pslib.h"
    20 /*
    2123static psS32 test1( void );
    2224static psS32 test1b( void );
     
    3032static psS32 test7( void );
    3133static psS32 test8( void );
    32 static psS32 test20( void );
    33 static psS32 test21( void );
     34//static psS32 test20( void );
     35//static psS32 test21( void );
    3436static psS32 test40( void );
    3537static psS32 test41( void );
    36 static psS32 test43( void );
    37 */
    38 static psS32 test42( void );
     38//static psS32 test42( void );
     39//static psS32 test43( void );
    3940testDescription tests[] = {
    40                               /*
    41                                                             {test1, 0000, "psSphereTransformAlloc()", 0, false},
    42                                                             {test1b, 0000, "psPlaneTransformAlloc()", 0, false},
    43                                                             {test1c, 0000, "psPlaneDistortAlloc()", 0, false},
    44                                                             {test2, 0000, "psPlaneTransformApply()", 0, false},
    45                                                             {test3, 0000, "psPlaneDistortApply()", 0, false},
    46                                                             {test4, 0000, "psPSphereTransformApply()", 0, false},
    47                                                             {test4b, 0000, "psPSphereTransformApply()", 0, false},
    48                                                             {test5, 0000, "psSphereTransformICRSToEcliptic()", 0, false},
    49                                                             {test6, 0000, "psSphereTransformEclipticToICRS()", 0, false},
    50                                                             {test7, 0000, "psSphereTransformICRSToGalatic()", 0, false},
    51                                                             {test8, 0000, "psSphereTransformGalaticToICRS()", 0, false},
    52                                                             {test20, 0000, "psProject()", 0, false},
    53                                                             {test21, 0000, "psDeProject()", 0, false},
    54                                                             {test40, 0000, "psSphereGetOffset()", 0, false},
    55                                                             {test41, 0000, "psSphereSetOffset()", 0, false},
    56                                                             {test43, 0000, "psProject(), psDeproject", 0, false},
    57                               */
    58                               {test42, 0000, "psProject(), psDeproject", 0, false},
     41                              {test1, 0000, "psSphereTransformAlloc()", 0, false},
     42                              {test1b, 0000, "psPlaneTransformAlloc()", 0, false},
     43                              {test1c, 0000, "psPlaneDistortAlloc()", 0, false},
     44                              {test2, 0000, "psPlaneTransformApply()", 0, false},
     45                              {test3, 0000, "psPlaneDistortApply()", 0, false},
     46                              {test4, 0000, "psPSphereTransformApply()", 0, false},
     47                              {test4b, 0000, "psPSphereTransformApply()", 0, false},
     48                              {test5, 0000, "psSphereTransformICRSToEcliptic()", 0, false},
     49                              {test6, 0000, "psSphereTransformEclipticToICRS()", 0, false},
     50                              {test7, 0000, "psSphereTransformICRSToGalatic()", 0, false},
     51                              {test8, 0000, "psSphereTransformGalaticToICRS()", 0, false},
     52                              //         {test20, 0000, "psProject()", 0, false},
     53                              //         {test21, 0000, "psDeProject()", 0, false},
     54                              {test40, 0000, "psSphereGetOffset()", 0, false},
     55                              {test41, 0000, "psSphereSetOffset()", 0, false},
     56                              //         {test42, 0000, "psProject(), psDeproject", 0, false},
     57                              //         {test43, 0000, "psProject(), psDeproject", 0, false},
    5958                              {NULL}
    6059                          };
     
    10331032
    10341033            //HEY            /* XXX: This code does not work correctly.
    1035             printf("--------------- (%f, %f) to (%f, %f) is (%f, %f) ---------------\n",
    1036                    position1.r, position1.d, position2.r, position2.d,
    1037                    offset->r, offset->d);
    1038             /*
    1039                         offset = psSphereGetOffset(&position1, &position2, PS_LINEAR, 0);
    1040                         PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2.r - position1.r), 1);
    1041                         PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2.d - position1.d), 1);
    1042             */
    1043             psFree(offset);
    1044             //            */
     1034            //            printf("--------------- (%f, %f) to (%f, %f) is (%f, %f) ---------------\n",
     1035            //                   position1.r, position1.d, position2.r, position2.d,
     1036            //                   offset->r, offset->d);
     1037            //            offset = psSphereGetOffset(&position1, &position2, PS_LINEAR, 0);
     1038            //            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->r, (position2.r - position1.r), 1);
     1039            //            PS_COMPARE_TINY_THEN_PRINT_ERROR(offset->d, (position2.d - position1.d), 1);
     1040            //            psFree(offset);
    10451041        }
    10461042    }
     
    11011097    for (float r=0.0;r<180.0;r+=DEG_INC) {
    11021098        for (float d=0.0;d<90.0;d+=DEG_INC) {
    1103             offset.r = DEG_TO_RAD(offset.r);
    1104             offset.d = DEG_TO_RAD(offset.d);
     1099            offset.r = DEG_TO_RAD(r);
     1100            offset.d = DEG_TO_RAD(d);
    11051101            offset.rErr = 0.0;
    11061102            offset.dErr = 0.0;
     
    11091105                                          PS_SPHERICAL, PS_RADIAN);
    11101106            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 1);
    1111             PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 1);
     1107            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 2);
    11121108            psFree(position2);
    11131109
    1114             tmpOffset.r = DEG_TO_RAD(offset.r);
    1115             tmpOffset.d = DEG_TO_RAD(offset.d);
     1110            tmpOffset.r = RAD_TO_DEG(offset.r);
     1111            tmpOffset.d = RAD_TO_DEG(offset.d);
    11161112            tmpOffset.rErr = 0.0;
    11171113            tmpOffset.dErr = 0.0;
    11181114            position2 = psSphereSetOffset(&position1, &tmpOffset,
    11191115                                          PS_SPHERICAL, PS_DEGREE);
    1120             PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 1);
    1121             PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 1);
     1116            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 3);
     1117            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 4);
    11221118            psFree(position2);
    11231119
     
    11281124            position2 = psSphereSetOffset(&position1, &tmpOffset,
    11291125                                          PS_SPHERICAL, PS_ARCMIN);
    1130             PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 1);
    1131             PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 1);
     1126            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 5);
     1127            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 6);
    11321128            psFree(position2);
    11331129
     
    11381134            position2 = psSphereSetOffset(&position1, &tmpOffset,
    11391135                                          PS_SPHERICAL, PS_ARCSEC);
    1140             PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 1);
    1141             PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 1);
     1136            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->r, (position1.r + offset.r), 7);
     1137            PS_COMPARE_TINY_THEN_PRINT_ERROR(position2->d, (position1.d + offset.d), 8);
    11421138            psFree(position2);
    11431139
     
    12451241        return(false);
    12461242    }
    1247     return(false);
     1243    return(true);
    12481244}
    12491245
     
    12551251ensure that the resulting spherical coordinates are identical to the start
    12561252coordinates.
     1253 
     1254Currently, this test works only for angles near the first quadrant.
    12571255 *****************************************************************************/
    12581256psS32 test42( void )
     
    12641262    psPlane *planeCoords;
    12651263
    1266     #define PROG_CENTER_R_DEG 20.0
     1264    #define PROG_CENTER_R_DEG 15.0
    12671265    #define PROG_CENTER_D_DEG 20.0
    12681266
     
    13021300                printf("    endCoords (R, D) is (%f, %f)\n", endCoords->r, endCoords->d);
    13031301            }
    1304 
    13051302            psFree(planeCoords);
    13061303            psFree(endCoords);
Note: See TracChangeset for help on using the changeset viewer.