IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 1, 2005, 3:07:25 PM (21 years ago)
Author:
drobbin
Message:

updated tests, function spec's and verified files. resolved some existing issues.

Location:
trunk/psLib/test/astro
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astro/tst_psEarthOrientation.c

    r5450 r5455  
    11/** @file  tst_psEarthOrientation.c
    22*
    3 *  @brief The code will go on ...
    4 *
     3*  @brief The code will perform earth orientation calculations and sphere rotations.
    54*
    65*  @author d-Rob, MHPCC
    76*
    8 *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-10-28 02:25:22 $
     7*  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2005-11-02 01:07:25 $
    109*
    1110*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    4342psS32 testAberration(void)
    4443{
    45     psSphere *actual = NULL;
    46     psSphere *apparent = psSphereAlloc();
     44    psSphere *apparent = NULL;
     45    psSphere *actual = psSphereAlloc();
    4746    psSphere *direction = psSphereAlloc();
    4847    psSphere *empty = NULL;
    4948
    50     apparent->r = 0.2;
    51     apparent->d = 0.2;
     49    actual->r = 0.2;
     50    actual->d = 0.2;
    5251    direction->r = 0.2035;
    5352    direction->d = 0.2035;
    5453
    55     empty = psAberration(empty, actual, direction, 0.1);
     54    empty = psAberration(empty, apparent, direction, 0.1);
    5655    if (empty != NULL) {
    5756        psError(PS_ERR_BAD_PARAMETER_NULL, false,
    58                 "psAberration failed to return NULL for NULL apparent input.\n");
     57                "psAberration failed to return NULL for NULL actual input.\n");
    5958        return 1;
    6059    }
    61     empty = psAberration(empty, apparent, actual, 0.1);
     60    empty = psAberration(empty, actual, apparent, 0.1);
    6261    if (empty != NULL) {
    6362        psError(PS_ERR_BAD_PARAMETER_NULL, false,
     
    6665    }
    6766
    68     actual = psAberration(actual, apparent, direction, 0.4);
    69     printf("\nactual = r,d  = %.8g, %.8g\n", actual->r, actual->d);
     67    apparent = psAberration(apparent, actual, direction, 0.4);
     68    printf("\napparent = r,d  = %.8g, %.8g\n", apparent->r, apparent->d);
    7069
     70    psFree(apparent);
    7171    psFree(actual);
    72     psFree(apparent);
    7372    psFree(direction);
    7473
     
    7978{
    8079
    81     psSphere *actual = NULL;
    82     psSphere *apparent = psSphereAlloc();
     80    psSphere *actual = psSphereAlloc();
     81    psSphere *apparent = NULL;
    8382    psSphere *sun = psSphereAlloc();
    8483    psSphere *empty = NULL;
     
    8685    sun->r = 0.2;
    8786    sun->d = 0.2;
    88     apparent->r = 0.2035;
    89     apparent->d = 0.2035;
     87    actual->r = 0.2035;
     88    actual->d = 0.2035;
    9089
    91     empty = psGravityDeflection(empty, actual, sun);
     90    empty = psGravityDeflection(apparent, empty, sun);
    9291    if (empty != NULL) {
    9392        psError(PS_ERR_BAD_PARAMETER_NULL, true,
    94                 "psGravityDeflection Failed to return NULL for NULL apparent input sphere.\n");
     93                "psGravityDeflection Failed to return NULL for NULL actual input sphere.\n");
    9594        return 1;
    9695    }
    97     empty = psGravityDeflection(empty, apparent, actual);
     96    empty = psGravityDeflection(apparent, actual, empty);
    9897    if (empty != NULL) {
    9998        psError(PS_ERR_BAD_PARAMETER_NULL, true,
     
    102101    }
    103102
    104     actual = psGravityDeflection(actual, apparent, sun);
    105     psSphere *result = psSphereSetOffset(apparent, actual, PS_SPHERICAL, PS_RADIAN);
    106     printf("\nApparent r,d = %.13g,%.13g    Actual r,d = %.13g, %.13g \n",
    107            apparent->r, apparent->d, result->r, result->d);
     103    apparent = psGravityDeflection(apparent, actual, sun);
     104    psSphere *result = psSphereSetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN);
     105    printf("\nActual r,d = %.13g,%.13g    Apparent r,d = %.13g, %.13g \n",
     106           actual->r, actual->d, result->r, result->d);
    108107    psFree(result);
    109108    psFree(actual);
  • trunk/psLib/test/astro/tst_psSphereOps.c

    r5450 r5455  
    11/** @file  tst_psSphereOps.c
    22*
    3 *  @brief The code will ..... Work ....
    4 *
     3*  @brief The code will perform sphere rotations and transformations.
    54*
    65*  @author d-Rob, MHPCC
    76*
    8 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    9 *  @date $Date: 2005-10-28 02:25:22 $
     7*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2005-11-02 01:07:25 $
    109*
    1110*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1413#include "psTest.h"
    1514#include "pslib_strict.h"
     15
    1616static psS32 testSphereRotAlloc(void);
    1717static psS32 testSphereRotQuat(void);
     
    275275                    RAD_TO_DEG(galactic->r),RAD_TO_DEG(galactic->d),
    276276                    l[x], b[x]);
    277             printf("togal- %lf,%lf,%lf,%lf   fromgal- %lf,%lf,%lf,%lf\n",
    278                    toGalactic->q0, toGalactic->q1, toGalactic->q2, toGalactic->q3,
    279                    fromGalactic->q0, fromGalactic->q1, fromGalactic->q2, fromGalactic->q3);
    280277            return 3;
    281278        }
    282         if (fabs(RAD_TO_DEG(icrsFromGalactic->r) - alpha[x]) > TOLERANCE ||
     279        if ( (fabs(RAD_TO_DEG(icrsFromGalactic->r) - alpha[x]) > TOLERANCE &&
     280                fabs(RAD_TO_DEG(icrsFromGalactic->d) - 90.0) > TOLERANCE ) ||
    283281                fabs(RAD_TO_DEG(icrsFromGalactic->d) - delta[x]) > TOLERANCE) {
    284282            psError(PS_ERR_UNKNOWN, false,
  • trunk/psLib/test/astro/verified/tst_psEarthOrientation.stderr

    r5450 r5455  
    66
    77<DATE><TIME>|<HOST>|E|psAberration (FILE:LINENO)
    8     Unallowable operation: apparent is NULL.
     8    Unallowable operation: actual is NULL.
    99<DATE><TIME>|<HOST>|E|psAberration (FILE:LINENO)
    1010    Unallowable operation: direction is NULL.
     
    1919
    2020<DATE><TIME>|<HOST>|E|psGravityDeflection (FILE:LINENO)
    21     Unallowable operation: apparent is NULL.
     21    Unallowable operation: actual is NULL.
    2222<DATE><TIME>|<HOST>|E|psGravityDeflection (FILE:LINENO)
    2323    Unallowable operation: sun is NULL.
  • trunk/psLib/test/astro/verified/tst_psEarthOrientation.stdout

    r5450 r5455  
    11
    2 actual = r,d  = 0.10218436, 0.10218436
     2apparent = r,d  = 0.10218436, 0.10218436
    33
    4 Apparent r,d = 0.2035,0.2035    Actual r,d = 0.2035000000002, 0.2035000000391
     4Actual r,d = 0.2035,0.2035    Apparent r,d = 0.2035000000002, 0.2035000000391
  • trunk/psLib/test/astro/verified/tst_psSphereOps.stderr

    r5437 r5455  
    11/***************************** TESTPOINT ******************************************\
    22*             TestFile: tst_psSphereOps.c                                          *
    3 *            TestPoint: psCoord{psSphereRotAlloc()}                                *
     3*            TestPoint: psSphereOps{psSphereRotAlloc()}                            *
    44*             TestType: Positive                                                   *
    55\**********************************************************************************/
    66
    77
    8 ---> TESTPOINT PASSED (psCoord{psSphereRotAlloc()} | tst_psSphereOps.c)
     8---> TESTPOINT PASSED (psSphereOps{psSphereRotAlloc()} | tst_psSphereOps.c)
    99
    1010/***************************** TESTPOINT ******************************************\
    1111*             TestFile: tst_psSphereOps.c                                          *
    12 *            TestPoint: psCoord{psSphereRotQuat()}                                 *
     12*            TestPoint: psSphereOps{psSphereRotQuat()}                             *
    1313*             TestType: Positive                                                   *
    1414\**********************************************************************************/
    1515
    1616
    17 ---> TESTPOINT PASSED (psCoord{psSphereRotQuat()} | tst_psSphereOps.c)
     17---> TESTPOINT PASSED (psSphereOps{psSphereRotQuat()} | tst_psSphereOps.c)
    1818
    1919/***************************** TESTPOINT ******************************************\
    2020*             TestFile: tst_psSphereOps.c                                          *
    21 *            TestPoint: psCoord{psSphereRotApply()}                                *
     21*            TestPoint: psSphereOps{psSphereRotApply()}                            *
    2222*             TestType: Positive                                                   *
    2323\**********************************************************************************/
     
    3232    Unallowable operation: coord is NULL.
    3333
    34 ---> TESTPOINT PASSED (psCoord{psSphereRotApply()} | tst_psSphereOps.c)
     34---> TESTPOINT PASSED (psSphereOps{psSphereRotApply()} | tst_psSphereOps.c)
    3535
    3636/***************************** TESTPOINT ******************************************\
    3737*             TestFile: tst_psSphereOps.c                                          *
    38 *            TestPoint: psCoord{psSphereRotApplyCel()}                             *
     38*            TestPoint: psSphereOps{psSphereRotApplyCel()}                         *
    3939*             TestType: Positive                                                   *
    4040\**********************************************************************************/
    4141
    42 <DATE><TIME>|<HOST>|E|testSphereRotApplyCelestial (FILE:LINENO)
    43     ICRS for Galactic tranformation incorrect.  Result is (180,90), expected (0,90)
    4442
    45 ---> TESTPOINT PASSED (psCoord{psSphereRotApplyCel()} | tst_psSphereOps.c)
     43---> TESTPOINT PASSED (psSphereOps{psSphereRotApplyCel()} | tst_psSphereOps.c)
    4644
    4745/***************************** TESTPOINT ******************************************\
    4846*             TestFile: tst_psSphereOps.c                                          *
    49 *            TestPoint: psCoord{psSphereRotPrecess()}                              *
     47*            TestPoint: psSphereOps{psSphereRotPrecess()}                          *
    5048*             TestType: Positive                                                   *
    5149\**********************************************************************************/
     
    6462    Unallowable operation: coords is NULL.
    6563
    66 ---> TESTPOINT PASSED (psCoord{psSphereRotPrecess()} | tst_psSphereOps.c)
     64---> TESTPOINT PASSED (psSphereOps{psSphereRotPrecess()} | tst_psSphereOps.c)
    6765
    6866/***************************** TESTPOINT ******************************************\
    6967*             TestFile: tst_psSphereOps.c                                          *
    70 *            TestPoint: psCoord{testSphereToFromCube()}                            *
     68*            TestPoint: psSphereOps{testSphereOffset()}                            *
    7169*             TestType: Positive                                                   *
    7270\**********************************************************************************/
    7371
     72<DATE><TIME>|<HOST>|E|psSphereSetOffset (FILE:LINENO)
     73    Unallowable operation: position is NULL.
     74<DATE><TIME>|<HOST>|E|psSphereSetOffset (FILE:LINENO)
     75    Unallowable operation: offset is NULL.
     76<DATE><TIME>|<HOST>|E|psSphereGetOffset (FILE:LINENO)
     77    Unallowable operation: position1 is NULL.
     78<DATE><TIME>|<HOST>|E|psSphereGetOffset (FILE:LINENO)
     79    Unallowable operation: position2 is NULL.
    7480
    75 ---> TESTPOINT PASSED (psCoord{testSphereToFromCube()} | tst_psSphereOps.c)
     81---> TESTPOINT PASSED (psSphereOps{testSphereOffset()} | tst_psSphereOps.c)
    7682
    77 /***************************** TESTPOINT ******************************************\
    78 *             TestFile: tst_psSphereOps.c                                          *
    79 *            TestPoint: psCoord{testSphereOffset()}                                *
    80 *             TestType: Positive                                                   *
    81 \**********************************************************************************/
    82 
    83 
    84 ---> TESTPOINT PASSED (psCoord{testSphereOffset()} | tst_psSphereOps.c)
    85 
Note: See TracChangeset for help on using the changeset viewer.