- Timestamp:
- May 3, 2010, 8:45:22 AM (16 years ago)
- Location:
- branches/simmosaic_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pswarp/src/pswarpTransformReadout.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simmosaic_branches
- Property svn:mergeinfo changed
-
branches/simmosaic_branches/pswarp/src/pswarpTransformReadout.c
r24494 r27839 89 89 90 90 if (!pmReadoutMaskNonfinite(input, pmConfigMaskGet("SAT", config))) { 91 psError( PS_ERR_UNKNOWN, false, "Unable to mask non-finite pixels in input.");91 psError(psErrorCodeLast(), false, "Unable to mask non-finite pixels in input."); 92 92 return false; 93 93 } … … 107 107 psImageInit(output->mask, maskBad); 108 108 } 109 110 // Ensure threading is off for the covariance calculation, since we are threading on a different level. 111 psImageCovarianceSetThreads(false); 109 112 110 113 // create jobs and supply them to the threads … … 126 129 psArrayAdd(job->args, 1, args); 127 130 if (!psThreadJobAddPending(job)) { 128 psError( PS_ERR_UNKNOWN, false, "Unable to warp image.");131 psError(psErrorCodeLast(), false, "Unable to warp image."); 129 132 return false; 130 133 } … … 137 140 // wait here for the threaded jobs to finish 138 141 if (!psThreadPoolWait (false)) { 139 psError( PS_ERR_UNKNOWN, false, "Unable to interpolate image.");142 psError(psErrorCodeLast(), false, "Unable to interpolate image."); 140 143 return false; 141 144 } … … 178 181 psTrace("pswarp.transform", 1, "No overlap\n"); 179 182 } 180 181 // Store the variance factor and number of good pixels182 if (goodPixels > 0) {183 // Variance factor: large factor --> small scale184 float varFactor = psImageInterpolateVarianceFactor(input->image->numCols / 2.0 + input->image->col0,185 input->image->numRows / 2.0 + input->image->row0,186 interp->mode);187 psMetadataItem *vfItem = psMetadataLookup(output->analysis, PSWARP_ANALYSIS_VARFACTOR);188 if (vfItem) {189 psMetadataItem *goodpixItem = psMetadataLookup(output->analysis, PSWARP_ANALYSIS_GOODPIX);190 psAssert(goodpixItem, "It should be where we left it!");191 psAssert(vfItem->type == PS_TYPE_F32 && goodpixItem->type == PS_TYPE_S64,192 "Should be the type we said.");193 194 vfItem->data.F32 += varFactor * goodPixels;195 goodpixItem->data.S64 += goodPixels;196 } else {197 psMetadataAddF32(output->analysis, PS_LIST_TAIL, PSWARP_ANALYSIS_VARFACTOR, 0,198 "Variance factor weighted by the good pixels", varFactor * goodPixels);199 psMetadataAddS64(output->analysis, PS_LIST_TAIL, PSWARP_ANALYSIS_GOODPIX, 0,200 "Number of good pixels", goodPixels);201 }202 }203 183 psFree(interp); 204 184 205 185 if (goodPixels > 0) { 206 186 if (!pswarpTransformSources(output, input, config)) { 207 psError( PS_ERR_UNKNOWN, false, "Unable to interpolate image.");187 psError(psErrorCodeLast(), false, "Unable to interpolate image."); 208 188 return false; 209 189 }
Note:
See TracChangeset
for help on using the changeset viewer.
