IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 9, 2006, 4:06:47 PM (20 years ago)
Author:
magnier
Message:

moving WCS to modules, adding high-order terms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/astrom/pmAstrometryDistortion.c

    r9730 r10603  
    77*  @author EAM, IfA
    88*
    9 *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-10-24 22:55:04 $
     9*  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2006-12-10 02:06:47 $
    1111*
    1212*  Copyright 2006 Institute for Astronomy, University of Hawaii
     
    181181    // the order of the gradient fits need to be 1 less than the distortion term
    182182    // determine the gradient order(s) from the fpa->toTP structure
    183     localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTangentPlane->x->nX-1, fpa->toTangentPlane->x->nY);
    184     localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTangentPlane->x->nX,   fpa->toTangentPlane->x->nY-1);
     183    localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->x->nX-1, fpa->toTPA->x->nY);
     184    localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->x->nX,   fpa->toTPA->x->nY-1);
    185185
    186186    // set masks based on fpa->toTP
    187     for (int i = 0; i < fpa->toTangentPlane->x->nX; i++) {
    188         for (int j = 0; j < fpa->toTangentPlane->x->nY; j++) {
    189             if (fpa->toTangentPlane->x->mask[i][j][0][0]) {
     187    for (int i = 0; i < fpa->toTPA->x->nX; i++) {
     188        for (int j = 0; j < fpa->toTPA->x->nY; j++) {
     189            if (fpa->toTPA->x->mask[i][j][0][0]) {
    190190                localX->mask[i-1][j] = 1;
    191191                localY->mask[i][j-1] = 1;
     
    203203
    204204    // update fpa->toTP distortion terms
    205     fpa->toTangentPlane->x->coeff[0][0][0][0] = 0;
    206     for (int i = 1; i < fpa->toTangentPlane->x->nX; i++) {
    207         if (!fpa->toTangentPlane->x->mask[i][0][0][0]) {
    208             fpa->toTangentPlane->x->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;
    209         }
    210     }
    211     for (int j = 1; j < fpa->toTangentPlane->x->nY; j++) {
    212         if (!fpa->toTangentPlane->x->mask[0][j][0][0]) {
    213             fpa->toTangentPlane->x->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;
    214         }
    215     }
    216     for (int i = 1; i < fpa->toTangentPlane->x->nX; i++) {
    217         for (int j = 1; j < fpa->toTangentPlane->x->nY; j++) {
    218             if (!fpa->toTangentPlane->x->mask[i][j][0][0]) {
    219                 fpa->toTangentPlane->x->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
     205    fpa->toTPA->x->coeff[0][0][0][0] = 0;
     206    for (int i = 1; i < fpa->toTPA->x->nX; i++) {
     207        if (!fpa->toTPA->x->mask[i][0][0][0]) {
     208            fpa->toTPA->x->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;
     209        }
     210    }
     211    for (int j = 1; j < fpa->toTPA->x->nY; j++) {
     212        if (!fpa->toTPA->x->mask[0][j][0][0]) {
     213            fpa->toTPA->x->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;
     214        }
     215    }
     216    for (int i = 1; i < fpa->toTPA->x->nX; i++) {
     217        for (int j = 1; j < fpa->toTPA->x->nY; j++) {
     218            if (!fpa->toTPA->x->mask[i][j][0][0]) {
     219                fpa->toTPA->x->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
    220220            }
    221221        }
     
    226226    // the order of the gradient fits need to be 1 less than the distortion term
    227227    // determine the gradient order(s) from the fpa->toTP structure
    228     localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTangentPlane->y->nX-1, fpa->toTangentPlane->y->nY);
    229     localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTangentPlane->y->nX,   fpa->toTangentPlane->y->nY-1);
     228    localX = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->y->nX-1, fpa->toTPA->y->nY);
     229    localY = psPolynomial2DAlloc (PS_POLYNOMIAL_ORD, fpa->toTPA->y->nX,   fpa->toTPA->y->nY-1);
    230230
    231231    // set masks based on fpa->toTP
    232     for (int i = 0; i < fpa->toTangentPlane->y->nX; i++) {
    233         for (int j = 0; j < fpa->toTangentPlane->y->nY; j++) {
    234             if (fpa->toTangentPlane->y->mask[i][j][0][0]) {
     232    for (int i = 0; i < fpa->toTPA->y->nX; i++) {
     233        for (int j = 0; j < fpa->toTPA->y->nY; j++) {
     234            if (fpa->toTPA->y->mask[i][j][0][0]) {
    235235                localX->mask[i-1][j] = 1;
    236236                localY->mask[i][j-1] = 1;
     
    259259
    260260    // update fpa->toTP distortion terms
    261     fpa->toTangentPlane->y->coeff[0][0][0][0] = 0;
    262     for (int i = 1; i < fpa->toTangentPlane->y->nX; i++) {
    263         if (!fpa->toTangentPlane->y->mask[i][0][0][0]) {
    264             fpa->toTangentPlane->y->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;
    265         }
    266     }
    267     for (int j = 1; j < fpa->toTangentPlane->y->nY; j++) {
    268         if (!fpa->toTangentPlane->y->mask[0][j][0][0]) {
    269             fpa->toTangentPlane->y->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;
    270         }
    271     }
    272     for (int i = 1; i < fpa->toTangentPlane->y->nX; i++) {
    273         for (int j = 1; j < fpa->toTangentPlane->y->nY; j++) {
    274             if (!fpa->toTangentPlane->y->mask[i][j][0][0]) {
    275                 fpa->toTangentPlane->y->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
     261    fpa->toTPA->y->coeff[0][0][0][0] = 0;
     262    for (int i = 1; i < fpa->toTPA->y->nX; i++) {
     263        if (!fpa->toTPA->y->mask[i][0][0][0]) {
     264            fpa->toTPA->y->coeff[i][0][0][0] = localX->coeff[i-1][0] / i;
     265        }
     266    }
     267    for (int j = 1; j < fpa->toTPA->y->nY; j++) {
     268        if (!fpa->toTPA->y->mask[0][j][0][0]) {
     269            fpa->toTPA->y->coeff[0][j][0][0] = localY->coeff[0][j-1] / j;
     270        }
     271    }
     272    for (int i = 1; i < fpa->toTPA->y->nX; i++) {
     273        for (int j = 1; j < fpa->toTPA->y->nY; j++) {
     274            if (!fpa->toTPA->y->mask[i][j][0][0]) {
     275                fpa->toTPA->y->coeff[i][j][0][0] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
    276276            }
    277277        }
Note: See TracChangeset for help on using the changeset viewer.