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.

File:
1 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);
Note: See TracChangeset for help on using the changeset viewer.