IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 13, 2009, 4:53:03 PM (17 years ago)
Author:
eugene
Message:

adjust models to use pixel coords instead of pixel index

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/20090715/psModules/src/objects/pmModel.c

    r23187 r25355  
    5656
    5757    tmp->type = type;
    58     tmp->chisq = 0.0;
    59     tmp->chisqNorm = 0.0;
     58    tmp->mag = NAN;
     59    tmp->chisq = NAN;
     60    tmp->chisqNorm = NAN;
    6061    tmp->nDOF  = 0;
    6162    tmp->nPix  = 0;
     
    189190    psVector *params = model->params;
    190191
    191     psS32 imageCol;
    192     psS32 imageRow;
    193     psF32 pixelValue;
     192    float imageCol;
     193    float imageRow;
     194    float pixelValue;
    194195
    195196    // save original values; restore before returning
     
    255256                continue;
    256257
    257             // XXX should we use using 0.5 pixel offset?
    258258            // Convert to coordinate in parent image, with offset (dx,dy)
    259             imageCol = ix + image->col0 - dx;
    260             imageRow = iy + image->row0 - dy;
    261 
    262             x->data.F32[0] = (float) imageCol;
    263             x->data.F32[1] = (float) imageRow;
     259            // 0.5 PIX: the model take pixel coordinates so convert the pixel index here
     260            imageCol = ix + 0.5 + image->col0 - dx;
     261            imageRow = iy + 0.5 + image->row0 - dy;
     262
     263            x->data.F32[0] = imageCol;
     264            x->data.F32[1] = imageRow;
    264265
    265266            pixelValue = 0.0;
Note: See TracChangeset for help on using the changeset viewer.