- Timestamp:
- Mar 29, 2010, 3:55:49 PM (16 years ago)
- Location:
- branches/eam_branches/20100225
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pswarp/src/pswarpTransformSources.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/20100225
- Property svn:mergeinfo changed
-
branches/eam_branches/20100225/pswarp/src/pswarpTransformSources.c
r26896 r27517 45 45 psArray *outSources = outDetections->allSources; 46 46 if (!outSources) { 47 outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER);48 outSources = outDetections->allSources;47 outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER); 48 outSources = outDetections->allSources; 49 49 } 50 50 … … 60 60 61 61 int xGrid, yGrid; ///< Grid coordinates for local map 62 if (!pswarpMapGridSetGrid(sourceGrid, xIn + 0.5, yIn + 0.5, &xGrid, &yGrid)) {63 psError( PS_ERR_UNKNOWN, false, "Unable to get grid coordinates for source at %f,%f\n",62 if (!pswarpMapGridSetGrid(sourceGrid, xIn, yIn, &xGrid, &yGrid)) { 63 psError(psErrorCodeLast(), false, "Unable to get grid coordinates for source at %f,%f\n", 64 64 xIn, yIn); 65 65 psFree(outDetections); … … 75 75 pswarpMap *map = sourceGrid->maps[xGrid][yGrid]; ///< Locally linear transformation 76 76 double xOut, yOut; ///< Output coordinates 77 if (!pswarpMapApply(&xOut, &yOut, map, xIn + 0.5, yIn + 0.5)) {78 psError( PS_ERR_UNKNOWN, false, "Unable to transform coordinates for source at %f,%f\n",77 if (!pswarpMapApply(&xOut, &yOut, map, xIn, yIn)) { 78 psError(psErrorCodeLast(), false, "Unable to transform coordinates for source at %f,%f\n", 79 79 xIn, yIn); 80 80 psFree(outDetections); … … 82 82 return false; 83 83 } 84 xOut += output->image->col0 - 0.5;85 yOut += output->image->row0 - 0.5;84 xOut += output->image->col0; 85 yOut += output->image->row0; 86 86 if (xOut < minX || xOut > maxX || yOut < minY || yOut > maxY) { 87 87 // It's not in the output image … … 111 111 112 112 new->modelPSF = pmModelAlloc(source->modelPSF->type); 113 new->modelPSF->params->data.F32[PM_PAR_I0]=114 (isfinite(new->psfMag) ? pow(10.0, -0.4*new->psfMag) : NAN);115 new->modelPSF->dparams->data.F32[PM_PAR_I0]=116 (isfinite(new->psfMag) ? new->errMag*pow(10.0, -0.4*new->psfMag) : NAN);113 new->modelPSF->params->data.F32[PM_PAR_I0]= 114 (isfinite(new->psfMag) ? pow(10.0, -0.4*new->psfMag) : NAN); 115 new->modelPSF->dparams->data.F32[PM_PAR_I0]= 116 (isfinite(new->psfMag) ? new->errMag*pow(10.0, -0.4*new->psfMag) : NAN); 117 117 118 118 #if 0
Note:
See TracChangeset
for help on using the changeset viewer.
