IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 9, 2007, 9:27:04 AM (19 years ago)
Author:
eugene
Message:

changed mask to coeffMask, define PS_POLY_MASK_FIT,SET; distinguish between coeffs masked for fitting (FIT) and masked for evaluation (SET)

File:
1 edited

Legend:

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

    r15050 r15254  
    1010 *  @author GLG, MHPCC
    1111 *
    12  *  @version $Revision: 1.140 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2007-09-28 00:37:27 $
     12 *  @version $Revision: 1.141 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2007-10-09 19:25:44 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    765765                for (psS32 j = 0 ; j < orderY+1 ; j++) {
    766766                    myPT->x->coeff[i][j] = 0.0;
    767                     myPT->x->mask[i][j] = 0;
    768767                    myPT->y->coeff[i][j] = 0.0;
    769                     myPT->y->mask[i][j] = 0;
     768                    myPT->x->coeffMask[i][j] = PS_POLY_MASK_NONE;
     769                    myPT->y->coeffMask[i][j] = PS_POLY_MASK_NONE;
    770770                }
    771771            }
     
    807807        for (psS32 t2y = 0 ; t2y < (trans2->x->nY + 1) ; t2y++) {
    808808            psTrace("psLib.astro", 6, "X: -------------------- (t2x, t2y) (%d, %d) --------------------\n", t2x, t2y);
    809             if (trans2->x->mask[t2x][t2y] == 0) {
    810                 psTrace("psLib.astro", 6, "In this iteration, we raise trans1->x to the %d power and trans1->y to the %d-power.\n", t2x, t2y);
    811                 psPolynomial2D *newPoly = multiplyDPoly2D(trans1XPolys[t2x], trans1YPolys[t2y]);
    812 
    813                 if (psTraceGetLevel("psLib.astro") >= 6) {
    814                     PS_POLY_PRINT_2D(newPoly);
    815                 }
    816 
    817                 // Set the appropriate coeffs in myPT->x
    818                 for (psS32 i = 0 ; i < (1 + newPoly->nX) ; i++) {
    819                     for (psS32 j = 0 ; j < (1 + newPoly->nY) ; j++) {
    820                         myPT->x->coeff[i][j]+= newPoly->coeff[i][j] * trans2->x->coeff[t2x][t2y];
    821                     }
    822                 }
    823 
    824                 if (psTraceGetLevel("psLib.astro") >= 6) {
    825                     PS_POLY_PRINT_2D(myPT->x);
    826                 }
    827                 psFree(newPoly);
    828             }
     809            if (trans2->x->coeffMask[t2x][t2y] & PS_POLY_MASK_SET) {
     810                continue;
     811            }
     812
     813            psTrace("psLib.astro", 6, "In this iteration, we raise trans1->x to the %d power and trans1->y to the %d-power.\n", t2x, t2y);
     814            psPolynomial2D *newPoly = multiplyDPoly2D(trans1XPolys[t2x], trans1YPolys[t2y]);
     815
     816            if (psTraceGetLevel("psLib.astro") >= 6) {
     817                PS_POLY_PRINT_2D(newPoly);
     818            }
     819
     820            // Set the appropriate coeffs in myPT->x
     821            for (psS32 i = 0 ; i < (1 + newPoly->nX) ; i++) {
     822                for (psS32 j = 0 ; j < (1 + newPoly->nY) ; j++) {
     823                    myPT->x->coeff[i][j]+= newPoly->coeff[i][j] * trans2->x->coeff[t2x][t2y];
     824                }
     825            }
     826
     827            if (psTraceGetLevel("psLib.astro") >= 6) {
     828                PS_POLY_PRINT_2D(myPT->x);
     829            }
     830            psFree(newPoly);
    829831        }
    830832    }
     
    841843        for (psS32 t2y = 0 ; t2y < (trans2->y->nY + 1) ; t2y++) {
    842844            psTrace("psLib.astro", 5, "Y: -------------------- (t2x, t2y) (%d, %d) --------------------\n", t2x, t2y);
    843             if (trans2->y->mask[t2x][t2y] == 0) {
    844                 psTrace("psLib.astro", 5, "In this iteration, we raise trans1->x to the %d power and trans1->y to the %d-power.\n", t2x, t2y);
    845                 psPolynomial2D *newPoly = multiplyDPoly2D(trans1XPolys[t2x], trans1YPolys[t2y]);
    846 
    847                 if (psTraceGetLevel("psLib.astro") >= 6) {
    848                     PS_POLY_PRINT_2D(newPoly);
    849                 }
    850 
    851                 // Set the appropriate coeffs in myPT->x
    852                 for (psS32 i = 0 ; i < (1 + newPoly->nX) ; i++) {
    853                     for (psS32 j = 0 ; j < (1 + newPoly->nY) ; j++) {
    854                         myPT->y->coeff[i][j]+= newPoly->coeff[i][j] * trans2->y->coeff[t2x][t2y];
    855                     }
    856                 }
    857                 if (psTraceGetLevel("psLib.astro") >= 6) {
    858                     PS_POLY_PRINT_2D(myPT->x);
    859                 }
    860                 psFree(newPoly);
    861             }
     845            if (trans2->y->coeffMask[t2x][t2y] & PS_POLY_MASK_SET) {
     846                continue;
     847            }
     848            psTrace("psLib.astro", 5, "In this iteration, we raise trans1->x to the %d power and trans1->y to the %d-power.\n", t2x, t2y);
     849            psPolynomial2D *newPoly = multiplyDPoly2D(trans1XPolys[t2x], trans1YPolys[t2y]);
     850
     851            if (psTraceGetLevel("psLib.astro") >= 6) {
     852                PS_POLY_PRINT_2D(newPoly);
     853            }
     854
     855            // Set the appropriate coeffs in myPT->x
     856            for (psS32 i = 0 ; i < (1 + newPoly->nX) ; i++) {
     857                for (psS32 j = 0 ; j < (1 + newPoly->nY) ; j++) {
     858                    myPT->y->coeff[i][j]+= newPoly->coeff[i][j] * trans2->y->coeff[t2x][t2y];
     859                }
     860            }
     861            if (psTraceGetLevel("psLib.astro") >= 6) {
     862                PS_POLY_PRINT_2D(myPT->x);
     863            }
     864            psFree(newPoly);
    862865        }
    863866    }
Note: See TracChangeset for help on using the changeset viewer.