IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 29, 2010, 3:55:49 PM (16 years ago)
Author:
eugene
Message:

update merges from trunk

Location:
branches/eam_branches/20100225
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20100225

  • branches/eam_branches/20100225/pswarp/src/pswarpTransformSources.c

    r26896 r27517  
    4545    psArray *outSources = outDetections->allSources;
    4646    if (!outSources) {
    47         outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER);
    48         outSources = outDetections->allSources;
     47        outDetections->allSources = psArrayAllocEmpty(SOURCE_ARRAY_BUFFER);
     48        outSources = outDetections->allSources;
    4949    }
    5050
     
    6060
    6161        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",
    6464                    xIn, yIn);
    6565            psFree(outDetections);
     
    7575        pswarpMap *map = sourceGrid->maps[xGrid][yGrid]; ///< Locally linear transformation
    7676        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",
    7979                    xIn, yIn);
    8080            psFree(outDetections);
     
    8282            return false;
    8383        }
    84         xOut += output->image->col0 - 0.5;
    85         yOut += output->image->row0 - 0.5;
     84        xOut += output->image->col0;
     85        yOut += output->image->row0;
    8686        if (xOut < minX || xOut > maxX || yOut < minY || yOut > maxY) {
    8787            // It's not in the output image
     
    111111
    112112        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);
    117117
    118118#if 0
Note: See TracChangeset for help on using the changeset viewer.