IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5294 for trunk/psLib/src/astro


Ignore:
Timestamp:
Oct 12, 2005, 11:02:20 AM (21 years ago)
Author:
gusciora
Message:

Polynomial members are now nX, nY, nZ, nT.

File:
1 edited

Legend:

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

    r5090 r5294  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.87 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-09-22 02:47:16 $
     12*  @version $Revision: 1.88 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-10-12 21:02:20 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    9090
    9191    A = transform->x->coeff[0][0];
    92     if (transform->x->COOL_2D_nX >= 1) {
     92    if (transform->x->nX >= 1) {
    9393        B = transform->x->coeff[1][0];
    9494    }
    95     if (transform->x->COOL_2D_nY >= 1) {
     95    if (transform->x->nY >= 1) {
    9696        C = transform->x->coeff[0][1];
    9797    }
    9898    D = transform->y->coeff[0][0];
    99     if (transform->y->COOL_2D_nX >= 1) {
     99    if (transform->y->nX >= 1) {
    100100        E = transform->y->coeff[1][0];
    101101    }
    102     if (transform->y->COOL_2D_nY >= 1) {
     102    if (transform->y->nY >= 1) {
    103103        F = transform->y->coeff[0][1];
    104104    }
     
    154154    PS_ASSERT_PTR_NON_NULL(transform->y, 0);
    155155
    156     for (psS32 i=0;i<(1 + transform->x->COOL_2D_nX);i++) {
    157         for (psS32 j=0;j<(1 + transform->x->COOL_2D_nY);j++) {
     156    for (psS32 i=0;i<(1 + transform->x->nX);i++) {
     157        for (psS32 j=0;j<(1 + transform->x->nY);j++) {
    158158            if (transform->x->coeff[i][j] != 0.0) {
    159159                if (!(((i == 0) && (j == 0)) ||
     
    166166    }
    167167
    168     for (psS32 i=0;i<(1 + transform->y->COOL_2D_nX);i++) {
    169         for (psS32 j=0;j<(1 + transform->y->COOL_2D_nY);j++) {
     168    for (psS32 i=0;i<(1 + transform->y->nX);i++) {
     169        for (psS32 j=0;j<(1 + transform->y->nY);j++) {
    170170            if (transform->y->coeff[i][j] != 0.0) {
    171171                if (!(((i == 0) && (j == 0)) ||
     
    501501                                       psPolynomial2D *trans2)
    502502{
    503     //TRACE: printf("multiplyDPoly2D(%d %d: %d %d)\n", trans1->COOL_2D_nX, trans1->COOL_2D_nY, trans2->COOL_2D_nX, trans2->COOL_2D_nY);
     503    //TRACE: printf("multiplyDPoly2D(%d %d: %d %d)\n", trans1->nX, trans1->nY, trans2->nX, trans2->nY);
    504504    // XXX: OLD:  psS32 orderX = (trans1->nX + trans2->nX) - 1;
    505505    // XXX: Verify this (the poly order change)
    506     psS32 orderX = trans1->COOL_2D_nX + trans2->COOL_2D_nX + 1;
    507     psS32 orderY = trans1->COOL_2D_nY + trans2->COOL_2D_nY + 1;
     506    psS32 orderX = trans1->nX + trans2->nX + 1;
     507    psS32 orderY = trans1->nY + trans2->nY + 1;
    508508
    509509    // XXX: Verify this (the poly order change)
    510510    psPolynomial2D *out = psPolynomial2DAlloc(orderX-1, orderY-1, PS_POLYNOMIAL_ORD);
    511511    //TRACE: printf("Creating poly (%d, %d)\n", orderX, orderY);
    512     for (psS32 i = 0 ; i < (1 + out->COOL_2D_nX); i++) {
    513         for (psS32 j = 0 ; j < (1 + out->COOL_2D_nY); j++) {
     512    for (psS32 i = 0 ; i < (1 + out->nX); i++) {
     513        for (psS32 j = 0 ; j < (1 + out->nY); j++) {
    514514            out->coeff[i][j] = 0.0;
    515515            out->mask[i][j] = 0;
     
    517517    }
    518518
    519     for (psS32 t1x = 0 ; t1x < (1 + trans1->COOL_2D_nX) ; t1x++) {
    520         for (psS32 t1y = 0 ; t1y < (1 + trans1->COOL_2D_nY) ; t1y++) {
     519    for (psS32 t1x = 0 ; t1x < (1 + trans1->nX) ; t1x++) {
     520        for (psS32 t1y = 0 ; t1y < (1 + trans1->nY) ; t1y++) {
    521521            if (0.0 != trans1->coeff[t1x][t1y]) {
    522                 for (psS32 t2x = 0 ; t2x < (1 + trans2->COOL_2D_nX) ; t2x++) {
    523                     for (psS32 t2y = 0 ; t2y < (1 + trans2->COOL_2D_nY) ; t2y++) {
     522                for (psS32 t2x = 0 ; t2x < (1 + trans2->nX) ; t2x++) {
     523                    for (psS32 t2y = 0 ; t2y < (1 + trans2->nY) ; t2y++) {
    524524                        /* Possible debug-only macro which checks these coords?
    525525                        if ((t1x+t2x) >= orderX)
     
    552552    PS_ASSERT_PTR_NON_NULL(trans1, NULL);
    553553    PS_ASSERT_PTR_NON_NULL(trans2, NULL);
    554     //TRACE: printf("psPlaneTransformCombine(%d, %d, %d, %d: %d, %d, %d, %d)\n", trans1->x->COOL_2D_nX, trans1->x->COOL_2D_nY, trans1->y->COOL_2D_nX, trans1->y->COOL_2D_nY, trans2->x->COOL_2D_nX, trans2->x->COOL_2D_nY, trans2->y->COOL_2D_nX, trans2->y->COOL_2D_nY);
     554    //TRACE: printf("psPlaneTransformCombine(%d, %d, %d, %d: %d, %d, %d, %d)\n", trans1->x->nX, trans1->x->nY, trans1->y->nX, trans1->y->nY, trans2->x->COOL_2D_nX, trans2->x->COOL_2D_nY, trans2->y->COOL_2D_nX, trans2->y->COOL_2D_nY);
    555555    //
    556556    // Determine the size of the new psPlaneTransform.
     
    558558    // PS_MAX(  Number of x terms in T2->x * number of x terms in T1->x,
    559559    //          Number of y terms in T2->x * number of x terms in T1->y,
    560     psS32 orderXnX = PS_MAX(((1 + trans2->x->COOL_2D_nX) * (1 + trans1->x->COOL_2D_nX)),
    561                             ((1 + trans2->x->COOL_2D_nY) * (1 + trans1->y->COOL_2D_nX)));
    562     psS32 orderXnY = PS_MAX(((1 + trans2->x->COOL_2D_nX) * (1 + trans1->x->COOL_2D_nY)),
    563                             ((1 + trans2->x->COOL_2D_nY) * (1 + trans1->y->COOL_2D_nY)));
    564 
    565     psS32 orderYnX = PS_MAX(((1 + trans2->y->COOL_2D_nX) * (1 + trans1->x->COOL_2D_nX)),
    566                             ((1 + trans2->y->COOL_2D_nY) * (1 + trans1->y->COOL_2D_nX)));
    567     psS32 orderYnY = PS_MAX(((1 + trans2->y->COOL_2D_nX) * (1 + trans1->x->COOL_2D_nY)),
    568                             ((1 + trans2->y->COOL_2D_nY) * (1 + trans1->y->COOL_2D_nY)));
     560    psS32 orderXnX = PS_MAX(((1 + trans2->x->nX) * (1 + trans1->x->nX)),
     561                            ((1 + trans2->x->nY) * (1 + trans1->y->nX)));
     562    psS32 orderXnY = PS_MAX(((1 + trans2->x->nX) * (1 + trans1->x->nY)),
     563                            ((1 + trans2->x->nY) * (1 + trans1->y->nY)));
     564
     565    psS32 orderYnX = PS_MAX(((1 + trans2->y->nX) * (1 + trans1->x->nX)),
     566                            ((1 + trans2->y->nY) * (1 + trans1->y->nX)));
     567    psS32 orderYnY = PS_MAX(((1 + trans2->y->nX) * (1 + trans1->x->nY)),
     568                            ((1 + trans2->y->nY) * (1 + trans1->y->nY)));
    569569    psS32 orderX = PS_MAX(orderXnX, orderYnX);
    570570    psS32 orderY = PS_MAX(orderXnY, orderYnY);
     
    578578        myPT = psPlaneTransformAlloc(orderX, orderY);
    579579    } else {
    580         if (((1 + out->x->COOL_2D_nX) == orderX) && ((1 + out->x->COOL_2D_nY) == orderY) &&
    581                 ((1 + out->y->COOL_2D_nX) == orderX) && ((1 + out->y->COOL_2D_nY) == orderY)) {
     580        if (((1 + out->x->nX) == orderX) && ((1 + out->x->nY) == orderY) &&
     581                ((1 + out->y->nX) == orderX) && ((1 + out->y->nY) == orderY)) {
    582582            myPT = out;
    583583        } else {
     
    609609    //
    610610
    611     for (psS32 t2x = 0 ; t2x < (1 + trans2->x->COOL_2D_nX) ; t2x++) {
    612         for (psS32 t2y = 0 ; t2y < (1 + trans2->x->COOL_2D_nX) ; t2y++) {
     611    for (psS32 t2x = 0 ; t2x < (1 + trans2->x->nX) ; t2x++) {
     612        for (psS32 t2y = 0 ; t2y < (1 + trans2->x->nX) ; t2y++) {
    613613            // XXX: Verify this (poly order/nterm change)
    614614            psPolynomial2D *currPoly = psPolynomial2DAlloc(1-1, 1-1, PS_POLYNOMIAL_ORD);
     
    634634
    635635                // Set the appropriate coeffs in myPT->x
    636                 for (psS32 i = 0 ; i < (1 + currPoly->COOL_2D_nX) ; i++) {
    637                     for (psS32 j = 0 ; j < (1 + currPoly->COOL_2D_nY) ; j++) {
     636                for (psS32 i = 0 ; i < (1 + currPoly->nX) ; i++) {
     637                    for (psS32 j = 0 ; j < (1 + currPoly->nY) ; j++) {
    638638                        myPT->x->coeff[i][j]+= currPoly->coeff[i][j] * trans2->x->coeff[t2x][t2y];
    639639                    }
     
    645645
    646646
    647     for (psS32 t2x = 0 ; t2x < (1 + trans2->y->COOL_2D_nX) ; t2x++) {
    648         for (psS32 t2y = 0 ; t2y < (1 + trans2->y->COOL_2D_nY) ; t2y++) {
     647    for (psS32 t2x = 0 ; t2x < (1 + trans2->y->nX) ; t2x++) {
     648        for (psS32 t2y = 0 ; t2y < (1 + trans2->y->nY) ; t2y++) {
    649649            // XXX: Verify this (poly order/nterm change)
    650650            psPolynomial2D *currPoly = psPolynomial2DAlloc(1-1, 1-1, PS_POLYNOMIAL_ORD);
     
    670670
    671671                // Set the appropriate coeffs in myPT->x
    672                 for (psS32 i = 0 ; i < (1 + currPoly->COOL_2D_nX) ; i++) {
    673                     for (psS32 j = 0 ; j < (1 + currPoly->COOL_2D_nY) ; j++) {
     672                for (psS32 i = 0 ; i < (1 + currPoly->nX) ; i++) {
     673                    for (psS32 j = 0 ; j < (1 + currPoly->nY) ; j++) {
    674674                        myPT->y->coeff[i][j]+= currPoly->coeff[i][j] * trans2->y->coeff[t2x][t2y];
    675675                    }
     
    702702
    703703    psS32 numCoords = PS_MIN(source->n, dest->n);
    704     psS32 order = PS_MAX(trans->x->COOL_2D_nX, trans->x->COOL_2D_nY);
    705     order = PS_MAX(order, trans->y->COOL_2D_nX);
    706     order = PS_MAX(order, trans->y->COOL_2D_nY);
     704    psS32 order = PS_MAX(trans->x->nX, trans->x->nY);
     705    order = PS_MAX(order, trans->y->nX);
     706    order = PS_MAX(order, trans->y->nY);
    707707    // XXX: Verify, or recode, after the poly norder/nterm change.
    708708    order++;
     
    822822
    823823    // Ensure that the input transformation is symmetrical.
    824     if ((in->x->COOL_2D_nX != in->x->COOL_2D_nY) ||
    825             (in->y->COOL_2D_nX != in->y->COOL_2D_nY) ||
    826             (in->x->COOL_2D_nX != in->y->COOL_2D_nX)) {
     824    if ((in->x->nX != in->x->nY) ||
     825            (in->y->nX != in->y->nY) ||
     826            (in->x->nX != in->y->nX)) {
    827827        psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Input transformation must have same nX==nY.");
    828828    }
    829829    // XXX: recode or verify after poly changes
    830     psS32 order = 1 + in->x->COOL_2D_nX;
     830    psS32 order = 1 + in->x->nX;
    831831
    832832    psPlaneTransform *myPT = NULL;
     
    842842    } else {
    843843        // XXX: recode or verify after poly changes
    844         if (((1 + out->x->COOL_2D_nX) == order) && ((1 + out->x->COOL_2D_nY) == order) &&
    845                 ((1 + out->y->COOL_2D_nX) == order) && ((1 + out->y->COOL_2D_nX) == order)) {
     844        if (((1 + out->x->nX) == order) && ((1 + out->x->nY) == order) &&
     845                ((1 + out->y->nX) == order) && ((1 + out->y->nX) == order)) {
    846846            myPT = out;
    847847        } else {
     
    854854    // Copy the input transform to myPT.
    855855    //
    856     for (psS32 i = 0 ; i < (1 + in->x->COOL_2D_nX) ; i++) {
    857         for (psS32 j = 0 ; j < (1 + in->x->COOL_2D_nY) ; j++) {
     856    for (psS32 i = 0 ; i < (1 + in->x->nX) ; i++) {
     857        for (psS32 j = 0 ; j < (1 + in->x->nY) ; j++) {
    858858            myPT->x->coeff[i][j] = in->x->coeff[i][j];
    859859        }
    860860    }
    861     for (psS32 i = 0 ; i < (1 + in->y->COOL_2D_nX) ; i++) {
    862         for (psS32 j = 0 ; j < (1 + in->y->COOL_2D_nY) ; j++) {
     861    for (psS32 i = 0 ; i < (1 + in->y->nX) ; i++) {
     862        for (psS32 j = 0 ; j < (1 + in->y->nY) ; j++) {
    863863            myPT->y->coeff[i][j] = in->y->coeff[i][j];
    864864        }
     
    940940
    941941    // This loop starts at loop_x=1 since the derivative of the loop_x=0 terms are all 0.0
    942     for (psS32 loop_x = 1; loop_x < (1 + xPoly->COOL_2D_nX); loop_x++) {
     942    for (psS32 loop_x = 1; loop_x < (1 + xPoly->nX); loop_x++) {
    943943        ySum = 1.0;
    944         for (psS32 loop_y = 0; loop_y < (1 + xPoly->COOL_2D_nY); loop_y++) {
     944        for (psS32 loop_y = 0; loop_y < (1 + xPoly->nY); loop_y++) {
    945945            //
    946946            // For each iteration of the loop, we multiple the (x, y) coefficient
     
    960960
    961961    // This loop starts at loop_y=1 since the derivative of the loop_y=0 terms are all 0.0
    962     for (psS32 loop_x = 0; loop_x < (1 + yPoly->COOL_2D_nX); loop_x++) {
     962    for (psS32 loop_x = 0; loop_x < (1 + yPoly->nX); loop_x++) {
    963963        ySum = 1.0;
    964         for (psS32 loop_y = 1; loop_y < (1 + yPoly->COOL_2D_nY); loop_y++) {
     964        for (psS32 loop_y = 1; loop_y < (1 + yPoly->nY); loop_y++) {
    965965            //
    966966            // For each iteration of the loop, we multiple the (x, y) coefficient
Note: See TracChangeset for help on using the changeset viewer.