IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10872


Ignore:
Timestamp:
Jan 1, 2007, 11:05:09 AM (19 years ago)
Author:
magnier
Message:

fixed endpost errors

File:
1 edited

Legend:

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

    r10859 r10872  
    77*  @author EAM, IfA
    88*
    9 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
    10 *  @date $Date: 2006-12-30 03:27:19 $
     9*  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
     10*  @date $Date: 2007-01-01 21:05:09 $
    1111*
    1212*  Copyright 2006 Institute for Astronomy, University of Hawaii
     
    118118                continue;
    119119
    120             char key;
    121             pmKapaPlotVectorPair (L, M);
    122             fscanf (stdin, "%c", &key);
    123 
    124             pmKapaPlotVectorPair (L, dP);
    125             fscanf (stdin, "%c", &key);
    126 
    127             pmKapaPlotVectorPair (L, dQ);
    128             fscanf (stdin, "%c", &key);
    129 
    130120            // stats structure and mask for use in measuring the clipping statistic
    131121            // this analysis has too few data points to use the robust median method
     
    236226                    localX->mask[i-1][j] = 1;
    237227                }
    238                 if ((j > 0) && (j <= fpa->toTPA->y->nY)) {
     228                if ((j > 0) && (j <= fpa->toTPA->x->nY)) {
    239229                    localY->mask[i][j-1] = 1;
    240230                }
     
    260250    // update fpa->toTP distortion terms
    261251    fpa->toTPA->x->coeff[0][0] = 0;
    262     for (int i = 1; i < fpa->toTPA->x->nX; i++) {
     252    for (int i = 1; i <= fpa->toTPA->x->nX; i++) {
    263253        if (!fpa->toTPA->x->mask[i][0]) {
    264254            fpa->toTPA->x->coeff[i][0] = localX->coeff[i-1][0] / i;
    265255        }
    266256    }
    267     for (int j = 1; j < fpa->toTPA->x->nY; j++) {
     257    for (int j = 1; j <= fpa->toTPA->x->nY; j++) {
    268258        if (!fpa->toTPA->x->mask[0][j]) {
    269259            fpa->toTPA->x->coeff[0][j] = localY->coeff[0][j-1] / j;
    270260        }
    271261    }
    272     for (int i = 1; i < fpa->toTPA->x->nX; i++) {
    273         for (int j = 1; j < fpa->toTPA->x->nY; j++) {
     262    for (int i = 1; i <= fpa->toTPA->x->nX; i++) {
     263        for (int j = 1; j <= fpa->toTPA->x->nY; j++) {
    274264            if (!fpa->toTPA->x->mask[i][j]) {
    275265                fpa->toTPA->x->coeff[i][j] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
     
    277267        }
    278268    }
     269    fpa->toTPA->x->coeff[1][0] += 1.0;
    279270    psFree (localX);
    280271    psFree (localY);
     
    289280        for (int j = 0; j < fpa->toTPA->y->nY; j++) {
    290281            if (fpa->toTPA->y->mask[i][j]) {
    291                 localX->mask[i-1][j] = 1;
    292                 localY->mask[i][j-1] = 1;
     282                if ((i > 0) && (i <= fpa->toTPA->y->nX)) {
     283                    localX->mask[i-1][j] = 1;
     284                }
     285                if ((j > 0) && (j <= fpa->toTPA->y->nY)) {
     286                    localY->mask[i][j-1] = 1;
     287                }
    293288            }
    294289        }
     
    320315    // update fpa->toTP distortion terms
    321316    fpa->toTPA->y->coeff[0][0] = 0;
    322     for (int i = 1; i < fpa->toTPA->y->nX; i++) {
     317    for (int i = 1; i <= fpa->toTPA->y->nX; i++) {
    323318        if (!fpa->toTPA->y->mask[i][0]) {
    324319            fpa->toTPA->y->coeff[i][0] = localX->coeff[i-1][0] / i;
    325320        }
    326321    }
    327     for (int j = 1; j < fpa->toTPA->y->nY; j++) {
     322    for (int j = 1; j <= fpa->toTPA->y->nY; j++) {
    328323        if (!fpa->toTPA->y->mask[0][j]) {
    329324            fpa->toTPA->y->coeff[0][j] = localY->coeff[0][j-1] / j;
    330325        }
    331326    }
    332     for (int i = 1; i < fpa->toTPA->y->nX; i++) {
    333         for (int j = 1; j < fpa->toTPA->y->nY; j++) {
     327    for (int i = 1; i <= fpa->toTPA->y->nX; i++) {
     328        for (int j = 1; j <= fpa->toTPA->y->nY; j++) {
    334329            if (!fpa->toTPA->y->mask[i][j]) {
    335330                fpa->toTPA->y->coeff[i][j] = 0.5*(localX->coeff[i-1][j] / i + localY->coeff[i][j-1] / j);
     
    337332        }
    338333    }
     334    fpa->toTPA->y->coeff[0][1] += 1.0;
    339335    psFree (localX);
    340336    psFree (localY);
     
    353349    // XXX choose an appropriate region based on the range of values
    354350    // in L and M?
    355     psRegion region = psRegionSet (0, 4000, 0, 4000);
    356     psPlaneTransformInvert(fpa->fromTPA, fpa->toTPA, region, 50);
     351    psRegion region = psRegionSet (-125000, +125000, -125000, +125000);
     352    psFree (fpa->fromTPA);
     353    fpa->fromTPA = psPlaneTransformInvert(NULL, fpa->toTPA, region, 50);
    357354
    358355    return true;
Note: See TracChangeset for help on using the changeset viewer.