IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 3539


Ignore:
Timestamp:
Mar 29, 2005, 9:41:38 AM (21 years ago)
Author:
gusciora
Message:

...

Location:
trunk/psLib/test/astronomy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/astronomy/Makefile.am

    r3531 r3539  
    2828         tst_psMetadata_06 \
    2929         tst_psMetadata_07 \
    30          tst_psAstrometry \
    3130         tst_psCoord \
    3231         tst_psCoord01 \
    33          tst_psAstrometry01
     32         tst_psAstrometry \
     33         tst_psAstrometry01 \
    3434
    3535check_PROGRAMS =$(TESTS)
  • trunk/psLib/test/astronomy/tst_psAstrometry01.c

    r3264 r3539  
    55*  @author GLG, MHPCC
    66*
    7 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    8 *  @date $Date: 2005-02-17 19:26:24 $
     7*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     8*  @date $Date: 2005-03-29 19:41:38 $
    99*
    1010*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    1717static psS32 test2( void );
    1818static psS32 test3( void );
     19static psS32 test4( void );
    1920
    2021testDescription tests[] = {
     
    2223                              {test2, -2, "Tests psGrommitAlloc()", 0, false},
    2324                              {test3, -3, "MISC", 0, false},
     25                              {test4, -1, "psPlaneTransformCombineTmp()", 0, false},
    2426                              {NULL}
    2527                          };
     
    537539    return(0);
    538540}
     541
     542int printTrans(psPlaneTransform *trans)
     543{
     544    printf("-------------------- trans->x coeffs --------------------\n");
     545    for (psS32 i = 0 ; i < trans->x->nX ; i++) {
     546        for (psS32 j = 0 ; j < trans->x->nY ; j++) {
     547            printf("(%.1f) ", trans->x->coeff[i][j]);
     548        }
     549        printf("\n");
     550    }
     551    printf("-------------------- trans->y coeffs --------------------\n");
     552    for (psS32 i = 0 ; i < trans->y->nX ; i++) {
     553        for (psS32 j = 0 ; j < trans->y->nY ; j++) {
     554            printf("(%.1f) ", trans->y->coeff[i][j]);
     555        }
     556        printf("\n");
     557    }
     558    return(0);
     559}
     560
     561// XXX: This function must verify the outputs.
     562psS32 test4( void )
     563{
     564    psPlaneTransform *trans1 = psPlaneTransformAlloc(2, 2);
     565    psPlaneTransform *trans2 = psPlaneTransformAlloc(2, 2);
     566
     567    printf("trans1: x = x+y, y = x+y\n");
     568    trans1->x->coeff[0][0] = 0.0;
     569    trans1->x->coeff[0][1] = 1.0;
     570    trans1->x->coeff[1][0] = 1.0;
     571    trans1->x->coeff[1][1] = 0;
     572    trans1->y->coeff[0][0] = 0.0;
     573    trans1->y->coeff[0][1] = 1.0;
     574    trans1->y->coeff[1][0] = 1.0;
     575    trans1->y->coeff[1][1] = 0;
     576    printTrans(trans1);
     577
     578    printf("trans2: x = x+y, y = x+y\n");
     579    trans2->x->coeff[0][0] = 0.0;
     580    trans2->x->coeff[0][1] = 1.0;
     581    trans2->x->coeff[1][0] = 1.0;
     582    trans2->x->coeff[1][1] = 0;
     583    trans2->y->coeff[0][0] = 0.0;
     584    trans2->y->coeff[0][1] = 1.0;
     585    trans2->y->coeff[1][0] = 1.0;
     586    trans2->y->coeff[1][1] = 0;
     587    printTrans(trans2);
     588
     589    printf("trans2: x = xy, y = xy\n");
     590    trans2->x->coeff[0][0] = 0.0;
     591    trans2->x->coeff[0][1] = 0.0;
     592    trans2->x->coeff[1][0] = 0.0;
     593    trans2->x->coeff[1][1] = 1.0;
     594    trans2->y->coeff[0][0] = 0.0;
     595    trans2->y->coeff[0][1] = 0.0;
     596    trans2->y->coeff[1][0] = 0.0;
     597    trans2->y->coeff[1][1] = 1.0;
     598    printTrans(trans2);
     599
     600
     601
     602    psPlaneTransform *trans3 = psPlaneTransformCombine(NULL, trans1, trans2);
     603
     604    printf("trans3: \n");
     605    printTrans(trans3);
     606    psFree(trans1);
     607    psFree(trans2);
     608    psFree(trans3);
     609    return(0);
     610}
    539611//This code is
Note: See TracChangeset for help on using the changeset viewer.