IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7118


Ignore:
Timestamp:
May 15, 2006, 3:08:58 PM (20 years ago)
Author:
drobbin
Message:

Updated outputting message in EOC. (Added VERBOSE option, set default = 0). Changed VERBOSE=1 in psPolyFit4D to analyze bug(s).

Location:
trunk/psLib
Files:
4 edited

Legend:

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

    r6425 r7118  
    88 *  @author Robert Daniel DeSonia, MHPCC
    99 *
    10  *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2006-02-14 00:09:26 $
     10 *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2006-05-16 01:08:57 $
    1212 *
    1313 *  Copyright 2005 Maui High Performance Computing Center, University of Hawaii
     
    10181018    // Convert psTime to MJD
    10191019    double MJD = psTimeToMJD(time);
    1020     printf("\nMJD check = %.13g\n", MJD);
     1020    //    printf("\nMJD check = %.13g\n", MJD);
    10211021    if (MJD == NAN) {
    10221022        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
  • trunk/psLib/test/astro/tst_psEarthOrientation.c

    r6987 r7118  
    55*  @author d-Rob, MHPCC
    66*
    7 *  @version $Revision: 1.31 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2006-04-26 01:09:13 $
     7*  @version $Revision: 1.32 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2006-05-16 01:08:58 $
    99*
    1010*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6464#define objR DEG_TO_RAD(122.9153182445501)
    6565#define objD DEG_TO_RAD(48.562968978679194)
     66#define VERBOSE 0
    6667static psSphere *obj = NULL;
    6768static void objSetup(void);
     
    149150    apparent = psAberration(apparent, actual, direction, speed);
    150151    psCube *outCube = psSphereToCube(apparent);
    151     printf("\n -- resultCube = x,y,z =     %.13g,      %.13g,    %.13g  -- \n",
    152            outCube->x, outCube->y, outCube->z);
     152    if (VERBOSE) {
     153        printf("\n -- resultCube = x,y,z =     %.13g,      %.13g,    %.13g  -- \n",
     154               outCube->x, outCube->y, outCube->z);
     155    }
    153156    //expected cube values
    154157    double x, y, z;
     
    157160    z = 0.7497078321908413;
    158161
    159     printf(" -- expectedCube = x,y,z =   %.13g,     %.13g,    %.13g  -- \n", x, y, z);
    160     printf("Cube Difference  =  x,y,z  = %.13g, %.13g, %.13g \n\n",
    161            (x - outCube->x), (y - outCube->y), (z - outCube->z) );
     162    if (VERBOSE) {
     163        printf(" -- expectedCube = x,y,z =   %.13g,     %.13g,    %.13g  -- \n", x, y, z);
     164        printf("Cube Difference  =  x,y,z  = %.13g, %.13g, %.13g \n\n",
     165               (x - outCube->x), (y - outCube->y), (z - outCube->z) );
     166    }
    162167    psFree(actual);
    163168    actualCube->x = x;
     
    166171    actual = psCubeToSphere(actualCube);
    167172    double xxx = greatCircle(actual, apparent);
    168     printf("   The great circle angular distance between expected & result = %.13g\n",
    169            xxx);
    170 
     173    if (VERBOSE) {
     174        printf("   The great circle angular distance between expected & result = %.13g\n",
     175               xxx);
     176    }
    171177    if ( fabs(x - outCube->x) > FLT_EPSILON || fabs(y - outCube->y) > FLT_EPSILON ||
    172178            fabs(z - outCube->z) > FLT_EPSILON ) {
     
    184190        actual = psCubeToSphere(actualCube);
    185191        x = greatCircle(actual, apparent);
    186         printf("   The great circle angular distance between expected & result = %.13g\n",
    187                x);
     192        if (VERBOSE) {
     193            printf("   The great circle angular distance between expected & result = %.13g\n",
     194                   x);
     195        }
    188196        return 3;
    189197    }
     
    216224    sunCube->y /= sunLength;
    217225    sunCube->z /= sunLength;
    218     printf("sunCube = x,y,z = %.13g, %.13g, %.13g\n", sunCube->x, sunCube->y, sunCube->z);
     226    if (VERBOSE) {
     227        printf("sunCube = x,y,z = %.13g, %.13g, %.13g\n",
     228               sunCube->x, sunCube->y, sunCube->z);
     229    }
    219230    psSphere *sun = psCubeToSphere(sunCube);
    220     printf("sunSphere  = r, d = %.13g, %.13g\n", sun->r, sun->d);
     231    if (VERBOSE) {
     232        printf("sunSphere  = r, d = %.13g, %.13g\n", sun->r, sun->d);
     233    }
    221234    psCube *outCube = psCubeAlloc();
    222235
     
    241254    //    psSphere *result = psSphereSetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN);
    242255    //    psSphere *result = psSphereGetOffset(apparent, actual, PS_SPHERICAL, PS_RADIAN);
    243     printf(" -- actualCube = x,y,z = %.13g, %.13g, %.13g  -- \n",
    244            actualCube->x, actualCube->y, actualCube->z);
     256    if (VERBOSE) {
     257        printf(" -- actualCube = x,y,z = %.13g, %.13g, %.13g  -- \n",
     258               actualCube->x, actualCube->y, actualCube->z);
     259    }
    245260    //    psCube *outCube = psSphereToCube(result);
    246261    //    printf(" -- resultCube = x,y,z = %.13g, %.13g, %.13g  -- \n",
    247262    //           outCube->x, outCube->y, outCube->z);
    248263    psCube *outCube2 = psSphereToCube(apparent);
    249     printf(" -- resultCube2= x,y,z = %.13g, %.13g, %.13g  -- \n",
    250            outCube2->x, outCube2->y, outCube2->z);
     264    if (VERBOSE) {
     265        printf(" -- resultCube2= x,y,z = %.13g, %.13g, %.13g  -- \n",
     266               outCube2->x, outCube2->y, outCube2->z);
     267    }
    251268    double x, y, z;
    252269    x = -0.35961949760293604;
     
    254271    z = 0.7496835020836093;
    255272
    256     printf(" -- expectCube = x,y,z = %.13g, %.13g, %.13g  -- \n\n", x, y, z);
    257 
    258     //    if ( fabs(x - outCube->x) > DBL_EPSILON || fabs(y - outCube->y) > DBL_EPSILON ||
    259     //            fabs(z - outCube->z) > DBL_EPSILON ) {
    260     //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    261     //                "psGravityDeflection returned incorrect values.\n");
    262     printf("expect-actual=  x,y,z  = %.13g, %.13g, %.13g \n",
    263            (x - actualCube->x), (y - actualCube->y), (z - actualCube->z) );
    264     printf("expect-result=  x,y,z  = %.13g, %.13g, %.13g \n",
    265            (x - outCube2->x), (y - outCube2->y), (z - outCube2->z) );
    266     printf("result-actual=  x,y,z  = %.13g, %.13g, %.13g \n",
    267            (outCube2->x - actualCube->x), (outCube2->y - actualCube->y),
    268            (outCube2->z - actualCube->z) );
     273    if (VERBOSE) {
     274        printf(" -- expectCube = x,y,z = %.13g, %.13g, %.13g  -- \n\n", x, y, z);
     275
     276        //    if ( fabs(x - outCube->x) > DBL_EPSILON || fabs(y - outCube->y) > DBL_EPSILON ||
     277        //            fabs(z - outCube->z) > DBL_EPSILON ) {
     278        //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
     279        //                "psGravityDeflection returned incorrect values.\n");
     280        printf("expect-actual=  x,y,z  = %.13g, %.13g, %.13g \n",
     281               (x - actualCube->x), (y - actualCube->y), (z - actualCube->z) );
     282        printf("expect-result=  x,y,z  = %.13g, %.13g, %.13g \n",
     283               (x - outCube2->x), (y - outCube2->y), (z - outCube2->z) );
     284        printf("result-actual=  x,y,z  = %.13g, %.13g, %.13g \n",
     285               (outCube2->x - actualCube->x), (outCube2->y - actualCube->y),
     286               (outCube2->z - actualCube->z) );
     287    }
    269288    //        return 1;
    270289    //    }
     
    278297    psFree(result2);
    279298    result2 = psSphereGetOffset(actual, apparent, PS_SPHERICAL, PS_RADIAN);
    280     printf("The apparent output sphere = r,d = %.13g, %.13g\n", result2->r, result2->d);
    281     printf("The expected output sphere = r,d = %.13g, %.13g\n\n", result->r, result->d);
     299    if (VERBOSE) {
     300        printf("The apparent output sphere = r,d = %.13g, %.13g\n", result2->r, result2->d);
     301        printf("The expected output sphere = r,d = %.13g, %.13g\n\n", result->r, result->d);
     302    }
    282303    psFree(result2);
    283304
     
    339360            return 4;
    340361        }
    341         printf("\n  PrecessionModel output = x,y,s = %.13g,  %.13g,  %.13g\n",
    342                pmodel->x, pmodel->y, pmodel->s);
    343         printf("  Expected output        = x,y,s = %.13g, %.13g,  %.13g\n", x, y, s);
    344         printf("  A difference of:                 %.13g, %.13g, %.13g\n",
    345                (pmodel->x - x), (pmodel->y - y), (pmodel->s - s) );
     362        if (VERBOSE) {
     363            printf("\n  PrecessionModel output = x,y,s = %.13g,  %.13g,  %.13g\n",
     364                   pmodel->x, pmodel->y, pmodel->s);
     365            printf("  Expected output        = x,y,s = %.13g, %.13g,  %.13g\n", x, y, s);
     366            printf("  A difference of:                 %.13g, %.13g, %.13g\n",
     367                   (pmodel->x - x), (pmodel->y - y), (pmodel->s - s) );
     368        }
    346369    }
    347370    psFree(pmodel);
     
    393416        return 7;
    394417    } else {
    395         printf("\nPrecessionCorr output (IERSA) = x,y,s = %.13g,  %.13g, %.13g\n",
    396                pcorr->x, pcorr->y, pcorr->s);
     418        if (VERBOSE) {
     419            printf("\nPrecessionCorr output (IERSA) = x,y,s = %.13g,  %.13g, %.13g\n",
     420                   pcorr->x, pcorr->y, pcorr->s);
     421        }
    397422    }
    398423    psFree(pcorr);
     
    415440        //            psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    416441        //                    "   psEOC_PrecessionCorr return incorrect values.\n");
    417         printf("PrecessionCorr output (IERSB) = x,y,s = %.13g, %.13g, %.13g\n",
    418                pcorr->x, pcorr->y, pcorr->s);
    419         printf("Expected output               = x,y,s = %.13g, %.13g, %.13g\n", xx, yy, ss);
    420         printf("          A difference of:              %.13g,  %.13g, %.13g\n\n",
    421                (pcorr->x - xx), (pcorr->y - yy), (pcorr->s - ss) );
     442        if (VERBOSE) {
     443            printf("PrecessionCorr output (IERSB) = x,y,s = %.13g, %.13g, %.13g\n",
     444                   pcorr->x, pcorr->y, pcorr->s);
     445            printf("Expected output               = x,y,s = %.13g, %.13g, %.13g\n", xx, yy, ss);
     446            printf("          A difference of:              %.13g,  %.13g, %.13g\n\n",
     447                   (pcorr->x - xx), (pcorr->y - yy), (pcorr->s - ss) );
     448        }
    422449        //            return 10;
    423450        //        }
     
    449476    //    printf("  Output from CEOtoGCRS only  = %.13g,%.13g,%.13g,%.13g\n",
    450477    //           pni->q0, pni->q1, pni->q2, pni->q3);
    451     printf("  Expected sphere rotation    = %.13g, %.13g, %.13g\n", q0,q1,q2);
    452     printf("  Result sphere rotation      = %.13g, %.13g, %.13g\n",
    453            precessNutInv->q0, precessNutInv->q1, precessNutInv->q2);
    454     printf("     Difference         =        %.13g, %.13g, %.13g\n\n",
    455            precessNutInv->q0-q0, precessNutInv->q1-q1, precessNutInv->q2-q2);
     478    if (VERBOSE) {
     479        printf("  Expected sphere rotation    = %.13g, %.13g, %.13g\n", q0,q1,q2);
     480        printf("  Result sphere rotation      = %.13g, %.13g, %.13g\n",
     481               precessNutInv->q0, precessNutInv->q1, precessNutInv->q2);
     482        printf("     Difference         =        %.13g, %.13g, %.13g\n\n",
     483               precessNutInv->q0-q0, precessNutInv->q1-q1, precessNutInv->q2-q2);
     484    }
    456485    psCube *objC = psCubeAlloc();
    457486    //    objC->x = -3.5963388069046304;
     
    479508    y = 0.5555012823608123;
    480509    z = 0.7496183628158023;
    481     printf("\n<<Expected out       = x,y,z = %.13g, %.13g, %.13g\n", x, y, z);
     510    if (VERBOSE) {
     511        printf("\n<<Expected out       = x,y,z = %.13g, %.13g, %.13g\n", x, y, z);
     512    }
    482513    //    psFree(objC);
    483514    //    objC = psSphereToCube(expect);
     
    490521    psFree(objC);
    491522    objC = psSphereToCube(result);
    492     printf("<<Resulting out      = x,y,z = %.13g, %.13g, %.13g\n", objC->x, objC->y, objC->z);
    493     printf("     Difference         =      %.13g, %.13g, %.13g\n\n", objC->x-x, objC->y-y, objC->z-z);
    494 
    495523    double xx = greatCircle(result, expect);
    496     printf("GREAT CIRCLE DIFFERENCE = %.13g \n", xx);
     524    if (VERBOSE) {
     525        printf("<<Resulting out      = x,y,z = %.13g, %.13g, %.13g\n", objC->x, objC->y, objC->z);
     526        printf("     Difference         =      %.13g, %.13g, %.13g\n\n",
     527               objC->x-x, objC->y-y, objC->z-z);
     528        printf("GREAT CIRCLE DIFFERENCE = %.13g \n", xx);
     529    }
     530
    497531    psFree(precess);
    498532    psFree(precessNut);
     
    556590    //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    557591    //                "psEOC_GetPolarMotion returned incorrect values.\n");
    558     printf("  <>PolarMotion output (IERSA)   = x,y,s = %.13g, %.13g, %.13g\n",
    559            polarMotion->x, polarMotion->y, polarMotion->s);
     592    if (VERBOSE) {
     593        printf("  <>PolarMotion output (IERSA)   = x,y,s = %.13g, %.13g, %.13g\n",
     594               polarMotion->x, polarMotion->y, polarMotion->s);
     595    }
    560596    //        printf("  <>PolarMotion expected (IERSA) = x,y,s = %.13g, %.13g, %.13g\n",
    561597    //               x, y, s);
     
    578614    //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    579615    //                "psEOC_GetPolarMotion returned incorrect values.\n");
    580     printf("  <>PolarMotion output (IERSB)   = x,y,s = %.13g,  %.13g, %.13g\n",
    581            polarMotion->x, polarMotion->y, polarMotion->s);
     616    if (VERBOSE) {
     617        printf("  <>PolarMotion output (IERSB)   = x,y,s = %.13g,  %.13g, %.13g\n",
     618               polarMotion->x, polarMotion->y, polarMotion->s);
     619    }
    582620    //        printf("  <>PolarMotion expected (IERSB) = x,y,s = %.13g, %.13g, %.13g\n",
    583621    //               x, y, s);
     
    603641    //        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    604642    //                "   psEOC_GetPolarMotion returned incorrect values.\n");
    605     printf("\n  PolarMotion + NutationCorr out = x,y,s = %.13g, %.13g, %.13g\n",
    606            polarMotion->x, polarMotion->y, polarMotion->s);
    607     printf("  Expected output                = x,y,s = %.13g,  %.13g, %.13g\n", x, y, s);
    608     printf("                     Difference  = x,y,s = %.13g, %.13g,  %.13g\n",
    609            polarMotion->x - x, polarMotion->y - y, polarMotion->s - s);
     643    if (VERBOSE) {
     644        printf("\n  PolarMotion + NutationCorr out = x,y,s = %.13g, %.13g, %.13g\n",
     645               polarMotion->x, polarMotion->y, polarMotion->s);
     646        printf("  Expected output                = x,y,s = %.13g,  %.13g, %.13g\n", x, y, s);
     647        printf("                     Difference  = x,y,s = %.13g, %.13g,  %.13g\n",
     648               polarMotion->x - x, polarMotion->y - y, polarMotion->s - s);
     649    }
    610650    //    }
    611651
     
    645685        return 2;
    646686    } else {
    647         printf("\nPolarTideCorr output = x,y,s = %.13g, %.13g, %.13g\n",
    648                eop->x, eop->y, eop->s);
     687        if (VERBOSE) {
     688            printf("\nPolarTideCorr output = x,y,s = %.13g, %.13g, %.13g\n",
     689                   eop->x, eop->y, eop->s);
     690        }
    649691    }
    650692
     
    689731        return 3;
    690732    } else {
    691         printf("Nutation Correction output = x,y,s = %.13g, %.13g, %.13g\n\n",
    692                nute->x, nute->y, nute->s);
     733        if (VERBOSE) {
     734            printf("Nutation Correction output = x,y,s = %.13g, %.13g, %.13g\n\n",
     735                   nute->x, nute->y, nute->s);
     736        }
    693737    }
    694738    psFree(nute);
     
    734778        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    735779                "psSphereRot_TEOtoCEO failed to return matching values for different time types.\n");
    736         printf("\n  Output Rotation1 = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
     780        if (VERBOSE) {
     781            printf("\n  Output Rotation1 = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
     782                   teoceo->q0, teoceo->q1, teoceo->q2, teoceo->q3 );
     783            printf("\n  Output Rotation2 = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
     784                   rot->q0, rot->q1, rot->q2, rot->q3 );
     785        }
     786        return 2;
     787    }
     788    if (VERBOSE) {
     789        printf("\n  Output Rotation = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
    737790               teoceo->q0, teoceo->q1, teoceo->q2, teoceo->q3 );
    738         printf("\n  Output Rotation2 = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
    739                rot->q0, rot->q1, rot->q2, rot->q3 );
    740         return 2;
    741     }
    742     printf("\n  Output Rotation = q0,q1,q2,q3 = %.13g, %.13g, %.13g, %.13g\n",
    743            teoceo->q0, teoceo->q1, teoceo->q2, teoceo->q3 );
     791    }
    744792
    745793    objSetup();
     
    757805        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    758806                "psSphereRot_TEOtoCEO returned incorrect values.\n");
    759         printf("\nOutput cube = x,y,z = %.13g, %.13g, %.13g\n",
    760                cube->x, cube->y, cube->z);
    761         printf("Expected cube = x,y,z = %.13g, %.13g, %.13g\n", x, y, z);
    762         printf("A difference of:   %.13g, %.13g, %.13g\n\n",
    763                (x-cube->x), (y-cube->y), (z-cube->z));
     807        if (VERBOSE) {
     808            printf("\nOutput cube = x,y,z = %.13g, %.13g, %.13g\n",
     809                   cube->x, cube->y, cube->z);
     810            printf("Expected cube = x,y,z = %.13g, %.13g, %.13g\n", x, y, z);
     811            printf("A difference of:   %.13g, %.13g, %.13g\n\n",
     812                   (x-cube->x), (y-cube->y), (z-cube->z));
     813        }
    764814        return 3;
    765815    }
     
    808858    }
    809859
    810     printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
    811            rot->q0, rot->q1, rot->q2, rot->q3);
    812     printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
    813     printf("  difference:                 %.13g, %.13g, %.13g \n",
    814            (rot->q0-q0), (rot->q1-q1), (rot->q2-q2) );
     860    if (VERBOSE) {
     861        printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
     862               rot->q0, rot->q1, rot->q2, rot->q3);
     863        printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
     864        printf("  difference:                 %.13g, %.13g, %.13g \n",
     865               (rot->q0-q0), (rot->q1-q1), (rot->q2-q2) );
     866    }
    815867    if (fabs(rot->q0-q0) > FLT_EPSILON || fabs(rot->q1-q1) > FLT_EPSILON ||
    816868            fabs(rot->q2-q2) > FLT_EPSILON || fabs(rot->q3+q3) > FLT_EPSILON) {
     
    832884    y = 0.5555012823608123;
    833885    z = 0.7496183628158023;
    834     printf("\n  Output cube = x,y,z = %.13g,  %.13g,    %.13g\n", cube->x, cube->y, cube->z);
    835     printf("Expected cube = x,y,z = %.13g,  %.13g,   %.13g\n", x, y, z);
    836     printf("  A difference of:    %.13g, %.13g, %.13g\n\n",
    837            (x-cube->x), (y-cube->y), (z-cube->z));
     886    if (VERBOSE) {
     887        printf("\n  Output cube = x,y,z = %.13g,  %.13g,    %.13g\n", cube->x, cube->y, cube->z);
     888        printf("Expected cube = x,y,z = %.13g,  %.13g,   %.13g\n", x, y, z);
     889        printf("  A difference of:    %.13g, %.13g, %.13g\n\n",
     890               (x-cube->x), (y-cube->y), (z-cube->z));
     891    }
    838892    psCube *expect = psCubeAlloc();
    839893    expect->x = x;
     
    842896    psSphere *expected = psCubeToSphere(expect);
    843897    double d = greatCircle(result, expected);
    844     printf("   The great circle angular distance between expected & result = %.13g\n", d);
     898    if (VERBOSE) {
     899        printf("   The great circle angular distance between expected & result = %.13g\n", d);
     900    }
    845901
    846902    psFree(expect);
     
    895951        psError(PS_ERR_BAD_PARAMETER_VALUE, false,
    896952                "psSphereRot_ITRStoTEO failed to return expected values.\n");
     953        if (VERBOSE) {
     954            printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
     955                   rot->q0, rot->q1, rot->q2, rot->q3);
     956            printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
     957            printf("  a difference:   %.13g, %.13g, %.13g, %.13g \n", (rot->q0-q0), (rot->q1-q1),
     958                   (rot->q2-q2), (rot->q3-q3) );
     959        }
     960        printf("Error #3\n");
     961        //        return 3;
     962    }
     963    if (VERBOSE) {
    897964        printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
    898965               rot->q0, rot->q1, rot->q2, rot->q3);
    899966        printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
    900         printf("  a difference:   %.13g, %.13g, %.13g, %.13g \n", (rot->q0-q0), (rot->q1-q1),
    901                (rot->q2-q2), (rot->q3-q3) );
    902         //        return 3;
    903     }
    904     printf("\n  Output sphere rotation   = %.13g, %.13g, %.13g, %.13g\n",
    905            rot->q0, rot->q1, rot->q2, rot->q3);
    906     printf("  Expected sphere rotation = %.13g, %.13g, %.13g, %.13g\n", q0,q1,q2,q3);
     967    }
    907968
    908969    psCube *temp = psCubeAlloc();
     
    920981    test = psSphereRotApply(NULL, newRot, obj);
    921982    temp = psSphereToCube(test);
    922     printf("\n  Cube -test- has x,y,z =     %.13g, %.13g, %.13g \n", temp->x, temp->y, temp->z);
    923983    double x, y, z;
    924984    x = 0.01698577185310146;
    925985    y = -0.6616538927902393;
    926986    z = 0.7496169753347885;
    927     printf("\n  Cube -expected- has x,y,z = %.13g,  %.13g, %.13g \n", x, y, z );
     987    if (VERBOSE) {
     988        printf("\n  Cube -test- has x,y,z =     %.13g, %.13g, %.13g \n",
     989               temp->x, temp->y, temp->z);
     990        printf("\n  Cube -expected- has x,y,z = %.13g,  %.13g, %.13g \n", x, y, z );
     991    }
    928992    temp->x = x;
    929993    temp->y = y;
     
    931995    psSphere *sphere = psCubeToSphere(temp);
    932996    double d = greatCircle(sphere, test);
    933     printf("Great circle difference of:  %.13g \n", d);
     997    if (VERBOSE) {
     998        printf("Great circle difference of:  %.13g \n", d);
     999    }
    9341000
    9351001    psFree(sphere);
  • trunk/psLib/test/astro/verified/tst_psEarthOrientation.stdout

    r6988 r7118  
    1 
    2  -- resultCube = x,y,z =     -0.359633878262,      0.5555192580977,    0.7497078280829  --
    3  -- expectedCube = x,y,z =   -0.3596338806905,     0.5555192509817,    0.7497078321908  --
    4 Cube Difference  =  x,y,z  = -2.428477863248e-09, -7.116060296575e-09, 4.107927886743e-09
    5 
    6    The great circle angular distance between expected & result = 0
    7 sunCube = x,y,z = 0.9820293796219, 0.1731564131522, 0.0750676637684
    8 sunSphere  = r, d = 0.1745310859793, 0.0751383461293
    91 Theta = 1.772849258423
    102 r0 = -7.3028651010049865723e+11
    113 Theta = -1.913704437867e-08
    124 phi = 7.882970755914e-09
    13  -- actualCube = x,y,z = -0.3596195125758, 0.5555613903456, 0.7496834983725  --
    14  -- resultCube2= x,y,z = -0.3596194987327, 0.5555613922666, 0.7496835035894  --
    15  -- expectCube = x,y,z = -0.3596194976029, 0.5555613950298, 0.7496835020836  --
    16 
    17 expect-actual=  x,y,z  = 1.497289375818e-08, 4.684221899254e-09, 3.711128404582e-09
    18 expect-result=  x,y,z  = 1.129748239403e-09, 2.763238637904e-09, -1.505794267054e-09
    19 result-actual=  x,y,z  = 1.384314551878e-08, 1.92098326135e-09, 5.216922671636e-09
    20 The apparent output sphere = r,d = -1.91370443936e-08, 7.88297072063e-09
    21 The expected output sphere = r,d = -2.283899158684e-08, 5.607657671547e-09
    22 
    23 
    24   PrecessionModel output = x,y,s = 0.0002857180163421,  2.394794321783e-05,  -1.397070873644e-08
    25   Expected output        = x,y,s = 0.0002857175590089, 2.396873937773e-05,  -1.39700664579e-08
    26   A difference of:                 4.57333152468e-10, -2.079615990713e-08, -6.422785401238e-13
    27 
    28 PrecessionCorr output (IERSA) = x,y,s = 1.947922616393e-10,  1.721410388291e-10, 0
    29 PrecessionCorr output (IERSB) = x,y,s = 3.054127043514e-10, -1.396712376063e-10, 0
    30 Expected output               = x,y,s = 3.052243007204e-10, -1.394413392358e-10, 0
    31           A difference of:              1.884036310428e-13,  -2.298983704727e-13, 0
    32 
    33   Expected sphere rotation    = -1.198452240676e-05, 0.0001428589335861, 1.219119351891e-10
    34   Result sphere rotation      = -1.197390289426e-05, 0.0001428591622618, 6.98535429644e-09
    35      Difference         =        1.061951249492e-08, 2.286756638811e-10, 6.863442361251e-09
    36 
    37 
    38 <<Expected out       = x,y,z = -0.3598480726985, 0.5555012823608, 0.7496183628158
    39 <<Resulting out      = x,y,z = -0.3598480654143, 0.5555013032212, 0.7496183508541
    40      Difference         =      7.28427523855e-09, 2.086037931281e-08, -1.196173393669e-08
    41 
    42 GREAT CIRCLE DIFFERENCE = 2.107342425545e-08
    43   <>PolarMotion output (IERSA)   = x,y,s = -6.454357026873e-07, 2.112611340557e-06, 0
    44   <>PolarMotion output (IERSB)   = x,y,s = -6.453778846156e-07,  2.112824593826e-06, 0
    45 
    46 MJD check = 52730.06284722
    47 
    48   PolarMotion + NutationCorr out = x,y,s = -6.453259754967e-07, 2.113939222748e-06, -7.396173345101e-12
    49   Expected output                = x,y,s = -6.43607313124e-07,  2.113514369736e-06, -7.396175813246e-12
    50                      Difference  = x,y,s = -1.718662372636e-09, 4.248530125326e-10,  2.468145872205e-18
    51 
    52 PolarTideCorr output = x,y,s = 5.576394041032e-11, 1.141315275255e-09, -2.661051633224e-05
    53 
    54 MJD check = 52730.06284722
    55 Nutation Correction output = x,y,s = -3.854821468189e-12, -2.668635296536e-11, -7.396173345101e-12
    56 
    57 
    58   Output Rotation = q0,q1,q2,q3 = 0, 0, -0.9625401013456, 0.2711393614023
    59 
    60   Output sphere rotation   = -1.198437080989e-05, 0.0001428587808888, 6.985033157173e-09, 0.9999999897239
    61   Expected sphere rotation = -1.198452240676e-05, 0.0001428589335861, 1.219119351891e-10, -0.9999999897238
    62   difference:                 1.515968626689e-10, -1.526973275742e-10, 6.863121221984e-09
    63 
    64   Output cube = x,y,z = -0.3598480648445,  0.555501287526,    0.7496183627584
    65 Expected cube = x,y,z = -0.3598480726985,  0.5555012823608,   0.7496183628158
    66   A difference of:    -7.854020045439e-09, -5.165185501532e-09, 5.738021169321e-11
    67 
    68    The great circle angular distance between expected & result = 1.490116119385e-08
    69 
    70   Output sphere rotation   = -1.056757184868e-06, 3.218036565618e-07, -3.410955728293e-13, 0.9999999999994
    71   Expected sphere rotation = -1.056757184866e-06, 3.218036562932e-07, -3.35801958072e-12, -0.9999999999994
    72 
    73   Cube -test- has x,y,z =     0.01698577184911, -0.6616538927903, 0.7496169753348
    74 
    75   Cube -expected- has x,y,z = 0.0169857718531,  -0.6616538927902, 0.7496169753348
    76 Great circle difference of:  0
     5Error #3
  • trunk/psLib/test/math/tst_psPolyFit4D.c

    r7111 r7118  
    3333#define ERROR_TOLERANCE 0.10
    3434#define YERR 10.0
    35 #define VERBOSE 0
     35#define VERBOSE 1
    3636#define NUM_ITERATIONS 5
    3737#define CLIP_SIGMA 4.0
Note: See TracChangeset for help on using the changeset viewer.