Changeset 23487 for trunk/pswarp
- Timestamp:
- Mar 23, 2009, 9:42:42 AM (17 years ago)
- Location:
- trunk/pswarp/src
- Files:
-
- 4 edited
-
pswarp.h (modified) (3 diffs)
-
pswarpMapGrid.c (modified) (9 diffs)
-
pswarpSetThreads.c (modified) (1 diff)
-
pswarpTransformTile.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarp.h
r23195 r23487 72 72 } pswarpTransformTileArgs; 73 73 74 pswarpTransformTileArgs *pswarpTransformTileArgsAlloc( );74 pswarpTransformTileArgs *pswarpTransformTileArgsAlloc(void); 75 75 bool pswarpTransformTile (pswarpTransformTileArgs *args); 76 76 … … 87 87 bool pswarpMatchRange (int *minX, int *minY, int *maxX, int *maxY, pmReadout *dest, pmReadout *src); 88 88 89 pswarpMap *pswarpMapAlloc ( );89 pswarpMap *pswarpMapAlloc (void); 90 90 pswarpMapGrid *pswarpMapGridAlloc (int Nx, int Ny); 91 91 … … 111 111 * define threads for this program 112 112 */ 113 bool pswarpSetThreads ( );113 bool pswarpSetThreads (void); 114 114 115 115 /// Return software version -
trunk/pswarp/src/pswarpMapGrid.c
r21323 r23487 43 43 // measure the map for the center of each superpixel 44 44 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 } 48 48 } 49 49 50 50 grid->nXpix = nXpix; 51 51 grid->nYpix = nYpix; … … 112 112 113 113 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 map117 // compare with the coordinates measured using the next grid map118 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 } 125 125 return maxError; 126 126 } … … 176 176 psPlaneTransformApply (FP, fpaDest->fromTPA, TP); 177 177 psPlaneTransformApply (V00, chipDest->fromFPA, FP); 178 178 179 179 /** V(1,0) position */ 180 180 offset->x = ix + 1; … … 186 186 psPlaneTransformApply (FP, fpaDest->fromTPA, TP); 187 187 psPlaneTransformApply (V10, chipDest->fromFPA, FP); 188 188 189 189 /** V(0,1) position */ 190 190 offset->x = ix; … … 204 204 map->Yy = V01->y - V00->y; 205 205 map->Yo = V00->y - map->Yx*ix - map->Yy*iy; 206 206 207 207 map->xo = ix; 208 208 map->yo = iy; … … 224 224 } 225 225 226 pswarpMap *pswarpMapAlloc () {226 pswarpMap *pswarpMapAlloc(void) { 227 227 228 228 pswarpMap *map = (pswarpMap *) psAlloc (sizeof(pswarpMap)); … … 238 238 239 239 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]); 244 244 } 245 245 psFree (grid->maps); … … 256 256 grid->maps[i] = psAlloc (nYpts*sizeof(void *)); 257 257 for (int j = 0; j < nYpts; j++) { 258 grid->maps[i][j] = pswarpMapAlloc();258 grid->maps[i][j] = pswarpMapAlloc(); 259 259 } 260 260 } … … 264 264 grid->nXpix = 0; 265 265 grid->nYpix = 0; 266 266 267 267 return grid; 268 268 } -
trunk/pswarp/src/pswarpSetThreads.c
r21323 r23487 23 23 } 24 24 25 bool pswarpSetThreads () {25 bool pswarpSetThreads(void) { 26 26 27 27 psThreadTask *task = NULL; -
trunk/pswarp/src/pswarpTransformTile.c
r21368 r23487 24 24 } 25 25 26 pswarpTransformTileArgs *pswarpTransformTileArgsAlloc( )26 pswarpTransformTileArgs *pswarpTransformTileArgsAlloc(void) 27 27 { 28 28 pswarpTransformTileArgs *args = psAlloc(sizeof(pswarpTransformTileArgs));
Note:
See TracChangeset
for help on using the changeset viewer.
