Changeset 23594 for branches/cnb_branches/cnb_branch_20090301/pswarp/src
- Timestamp:
- Mar 29, 2009, 6:15:31 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 8 edited
-
. (modified) (1 prop)
-
pswarp/src/pswarp.h (modified) (3 diffs)
-
pswarp/src/pswarpMapGrid.c (modified) (9 diffs)
-
pswarp/src/pswarpParseCamera.c (modified) (1 diff)
-
pswarp/src/pswarpSetMaskBits.c (modified) (1 diff)
-
pswarp/src/pswarpSetThreads.c (modified) (1 diff)
-
pswarp/src/pswarpTransformReadout.c (modified) (1 diff)
-
pswarp/src/pswarpTransformTile.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarp.h
r23352 r23594 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 -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpMapGrid.c
r21323 r23594 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 } -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpParseCamera.c
r23352 r23594 24 24 25 25 // look for the file on the RUN metadata 26 pmFPAfile *file = pmFPAfileDefineFromRun(&status, config, filerule); // File to return26 pmFPAfile *file = pmFPAfileDefineFromRun(&status, bind, config, filerule); // File to return 27 27 if (!status) { 28 28 psError(PSWARP_ERR_CONFIG, false, "Failed to load file definition for %s", filerule); -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpSetMaskBits.c
r21368 r23594 33 33 34 34 // mask for non-linear flat regions (default to DETECTOR if not defined) 35 psImageMaskType badMask = pmConfigMaskGet(" BAD.WARP", config);35 psImageMaskType badMask = pmConfigMaskGet("CONV.BAD", config); 36 36 if (!badMask) { 37 37 badMask = 0x01; 38 pmConfigMaskSet (config, " BAD.WARP", badMask);38 pmConfigMaskSet (config, "CONV.BAD", badMask); 39 39 } 40 40 maskOut |= badMask; 41 41 42 42 // mask for non-linear flat regions (default to DETECTOR if not defined) 43 psImageMaskType poorMask = pmConfigMaskGet(" POOR.WARP", config);43 psImageMaskType poorMask = pmConfigMaskGet("CONV.POOR", config); 44 44 if (!poorMask) { 45 45 poorMask = 0x02; 46 pmConfigMaskSet (config, " POOR.WARP", poorMask);46 pmConfigMaskSet (config, "CONV.POOR", poorMask); 47 47 } 48 48 maskOut |= poorMask; -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpSetThreads.c
r21323 r23594 23 23 } 24 24 25 bool pswarpSetThreads () {25 bool pswarpSetThreads(void) { 26 26 27 27 psThreadTask *task = NULL; -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpTransformReadout.c
r21529 r23594 37 37 // output mask bits 38 38 psImageMaskType maskIn = psMetadataLookupImageMask(&mdok, recipe, "MASK.INPUT"); 39 psImageMaskType maskPoor = pmConfigMaskGet("POOR.WARP", config); 40 psImageMaskType maskBad = pmConfigMaskGet("BAD.WARP", config); 39 psImageMaskType maskPoor = pmConfigMaskGet("CONV.POOR", config); 40 if (!maskPoor) { 41 maskPoor = pmConfigMaskGet("POOR.WARP", config); 42 } 43 psImageMaskType maskBad = pmConfigMaskGet("CONV.BAD", config); 44 if (!maskBad) { 45 maskBad = pmConfigMaskGet("BAD.WARP", config); 46 } 41 47 psAssert(mdok, "MASK.INPUT was not defined"); 42 48 -
branches/cnb_branches/cnb_branch_20090301/pswarp/src/pswarpTransformTile.c
r21368 r23594 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.
