Changeset 35563 for trunk/pswarp/src/pswarpTransformReadout.c
- Timestamp:
- May 9, 2013, 12:26:48 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/pswarp/src/pswarpTransformReadout.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pswarp/src/pswarpTransformReadout.c
r34800 r35563 16 16 * NOTE: in this function, the coordinates are transformed from the OUTPUT to the INPUT 17 17 */ 18 bool pswarpTransformReadout(pmReadout *output, pmReadout *input, pmConfig *config )18 bool pswarpTransformReadout(pmReadout *output, pmReadout *input, pmConfig *config, bool backgroundWarp) 19 19 { 20 20 // XXX this implementation currently ignores the use of the region … … 52 52 } 53 53 54 // XXX unused int nThreads = psMetadataLookupS32(&mdok, config->arguments, "NTHREADS"); // Number of threads55 // XXX unused if (!mdok) {56 // XXX unused nThreads = 0;57 // XXX unused }58 54 float poorFrac = psMetadataLookupF32(NULL, config->arguments, "POOR.FRAC"); ///< Flux fraction for "poor" 59 55 … … 61 57 // output coordinates to input coordinates 62 58 pswarpMapGrid *grid = pswarpMapGridFromImage(input, output, nGridX, nGridY); 63 // if (psMetadataLookupBool(NULL,config->arguments,"BACKGROUND_WARPING")) {64 59 65 60 // XXX optionally modify the grid based on this result and force the maxError < XXX … … 117 112 psAssert (xGridMax < grid->nXpts, "xGridMax too big\n"); 118 113 psAssert (yGridMax < grid->nYpts, "yGridMax too big\n"); 114 115 // fprintf (stderr, "warp %d,%d - %d,%d\n", xGridMin, yGridMin, xGridMax, yGridMax); 119 116 120 117 // create jobs and supply them to the threads … … 132 129 args->goodPixels = 0; 133 130 134 if ( psMetadataLookupBool(NULL,config->arguments,"BACKGROUND_WARPING")) {131 if (backgroundWarp) { 135 132 args->background_warping = true; 136 133 args->offset_x = psMetadataLookupF32(NULL,config->arguments,"BKG_WARP_XOFFSET"); 137 134 args->offset_y = psMetadataLookupF32(NULL,config->arguments,"BKG_WARP_YOFFSET"); 138 135 } 139 140 136 141 137 // allocate a job … … 210 206 psFree(interp); 211 207 212 if (goodPixels > 0 && psMetadataLookupBool(&mdok, recipe, "SOURCES")) { 213 if (!psMetadataLookupBool(NULL,config->arguments,"BACKGROUND_WARPING")) { 214 if (!pswarpTransformSources(output, input, config)) { 215 psError(psErrorCodeLast(), false, "Unable to interpolate image."); 216 return false; 208 if (goodPixels > 0 && !backgroundWarp && psMetadataLookupBool(&mdok, recipe, "SOURCES")) { 209 if (!pswarpTransformSources(output, input, config)) { 210 psError(psErrorCodeLast(), false, "Unable to transform sources."); 211 return false; 217 212 } 218 }219 213 } 220 214
Note:
See TracChangeset
for help on using the changeset viewer.
