IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2009, 6:15:31 PM (17 years ago)
Author:
beaumont
Message:

merged with head

Location:
branches/cnb_branches/cnb_branch_20090301
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/cnb_branches/cnb_branch_20090301

  • branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpMapGrid.c

    r21323 r23594  
    4343    // measure the map for the center of each superpixel
    4444    for (ni = 0, i = xMin; ni < nXpts; i += nXpix, ni++) {
    45         for (nj = 0, j = yMin; nj < nYpts; j += nYpix, nj++) {
    46             pswarpMapSetLocalModel (grid->maps[ni][nj], dest, src, i, j);
    47         }
     45        for (nj = 0, j = yMin; nj < nYpts; j += nYpix, nj++) {
     46            pswarpMapSetLocalModel (grid->maps[ni][nj], dest, src, i, j);
     47        }
    4848    }
    49            
     49
    5050    grid->nXpix = nXpix;
    5151    grid->nYpix = nYpix;
     
    112112
    113113    for (int i = 0; i < grid->nXpts - 1; i++) {
    114         for (int j = 0; j < grid->nYpts - 1; j++) {
    115 
    116             // measure the output coordinates for the next grid position using the current grid map
    117             // compare with the coordinates measured using the next grid map
    118             pswarpMapApply (&xRaw, &yRaw, grid->maps[i][j], grid->maps[i][j]->xo + grid->nXpix, grid->maps[i][j]->yo);
    119             pswarpMapApply (&xRef, &yRef, grid->maps[i+1][j], grid->maps[i][j]->xo + grid->nXpix, grid->maps[i][j]->yo);
    120 
    121             double posError = hypot (xRaw-xRef, yRaw-yRef);
    122             maxError = PS_MAX (maxError, posError);
    123         }
    124     }   
     114        for (int j = 0; j < grid->nYpts - 1; j++) {
     115
     116            // measure the output coordinates for the next grid position using the current grid map
     117            // compare with the coordinates measured using the next grid map
     118            pswarpMapApply (&xRaw, &yRaw, grid->maps[i][j], grid->maps[i][j]->xo + grid->nXpix, grid->maps[i][j]->yo);
     119            pswarpMapApply (&xRef, &yRef, grid->maps[i+1][j], grid->maps[i][j]->xo + grid->nXpix, grid->maps[i][j]->yo);
     120
     121            double posError = hypot (xRaw-xRef, yRaw-yRef);
     122            maxError = PS_MAX (maxError, posError);
     123        }
     124    }
    125125    return maxError;
    126126}
     
    176176    psPlaneTransformApply (FP, fpaDest->fromTPA, TP);
    177177    psPlaneTransformApply (V00, chipDest->fromFPA, FP);
    178    
     178
    179179    /** V(1,0) position */
    180180    offset->x = ix + 1;
     
    186186    psPlaneTransformApply (FP, fpaDest->fromTPA, TP);
    187187    psPlaneTransformApply (V10, chipDest->fromFPA, FP);
    188    
     188
    189189    /** V(0,1) position */
    190190    offset->x = ix;
     
    204204    map->Yy = V01->y - V00->y;
    205205    map->Yo = V00->y - map->Yx*ix - map->Yy*iy;
    206  
     206
    207207    map->xo = ix;
    208208    map->yo = iy;
     
    224224}
    225225
    226 pswarpMap *pswarpMapAlloc () {
     226pswarpMap *pswarpMapAlloc(void) {
    227227
    228228  pswarpMap *map = (pswarpMap *) psAlloc (sizeof(pswarpMap));
     
    238238
    239239    for (int i = 0; i < grid->nXpts; i++) {
    240         for (int j = 0; j < grid->nYpts; j++) {
    241             psFree (grid->maps[i][j]);
    242         }
    243         psFree (grid->maps[i]);
     240        for (int j = 0; j < grid->nYpts; j++) {
     241            psFree (grid->maps[i][j]);
     242        }
     243        psFree (grid->maps[i]);
    244244    }
    245245    psFree (grid->maps);
     
    256256      grid->maps[i] = psAlloc (nYpts*sizeof(void *));
    257257      for (int j = 0; j < nYpts; j++) {
    258           grid->maps[i][j] = pswarpMapAlloc();
     258          grid->maps[i][j] = pswarpMapAlloc();
    259259      }
    260260  }
     
    264264  grid->nXpix = 0;
    265265  grid->nYpix = 0;
    266  
     266
    267267  return grid;
    268268}
Note: See TracChangeset for help on using the changeset viewer.