IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 27, 2007, 12:23:16 PM (18 years ago)
Author:
Paul Price
Message:

Fixing cut/paste error in mapping input to desired coordinates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/objects/pmModel.c

    r15699 r15700  
    66 *  @author EAM, IfA
    77 *
    8  *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2007-11-27 21:16:45 $
     8 *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2007-11-27 22:23:16 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    236236            myRx = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32);
    237237            myRy = psImageAlloc (image->numCols, image->numRows, PS_TYPE_F32);
    238             dx = (int)(inRx->numCols / 2) - (xPos - image->col0);
    239             dy = (int)(inRx->numCols / 2) - (xPos - image->col0);
     238            // Difference between input and desired centres
     239            int xDiff = (int)(inRx->numCols / 2) - (xPos - image->col0);
     240            int yDiff = (int)(inRy->numRows / 2) - (yPos - image->row0);
    240241            for (int iy = 0; iy < myRo->numRows; iy++) {
    241                 int jy = iy + dy;
     242                int jy = iy + yDiff;
    242243                if ((jy < 0) || (jy >= inRo->numRows)) {
    243244                    for (int ix = 0; ix < myRo->numCols; ix++) {
     
    249250                }
    250251                for (int ix = 0; ix < myRo->numCols; ix++) {
    251                     int jx = ix + dx;
     252                    int jx = ix + xDiff;
    252253                    if ((jx < 0) || (jx >= inRo->numCols)) {
    253254                        myRo->data.F32[iy][ix] = 0.0;
Note: See TracChangeset for help on using the changeset viewer.