Changeset 3539
- Timestamp:
- Mar 29, 2005, 9:41:38 AM (21 years ago)
- Location:
- trunk/psLib/test/astronomy
- Files:
-
- 2 edited
-
Makefile.am (modified) (1 diff)
-
tst_psAstrometry01.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/astronomy/Makefile.am
r3531 r3539 28 28 tst_psMetadata_06 \ 29 29 tst_psMetadata_07 \ 30 tst_psAstrometry \31 30 tst_psCoord \ 32 31 tst_psCoord01 \ 33 tst_psAstrometry01 32 tst_psAstrometry \ 33 tst_psAstrometry01 \ 34 34 35 35 check_PROGRAMS =$(TESTS) -
trunk/psLib/test/astronomy/tst_psAstrometry01.c
r3264 r3539 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.1 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 2-17 19:26:24$7 * @version $Revision: 1.12 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-03-29 19:41:38 $ 9 9 * 10 10 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 17 17 static psS32 test2( void ); 18 18 static psS32 test3( void ); 19 static psS32 test4( void ); 19 20 20 21 testDescription tests[] = { … … 22 23 {test2, -2, "Tests psGrommitAlloc()", 0, false}, 23 24 {test3, -3, "MISC", 0, false}, 25 {test4, -1, "psPlaneTransformCombineTmp()", 0, false}, 24 26 {NULL} 25 27 }; … … 537 539 return(0); 538 540 } 541 542 int 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. 562 psS32 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 } 539 611 //This code is
Note:
See TracChangeset
for help on using the changeset viewer.
