title: Why are my X and Y values always out of range of my raster file size?
body: <p>I have converted quite a few WGS84 coordinates, that I know exist within my raster data, to UTM and have plugged them into my program only to have it tell me they are out of range. My raster is 4695x9798 and I'm not sure why my coordinates keep falling outside of that window</p>
  
  <pre><code>import numpy as np
  from osgeo import gdal,ogr
  import struct
  
  
  gdata = gdal.Open('sinusoidal.tif')
  geot = gdata.GetGeoTransform()
  
  
  x = (284905 - geot[0])/geot[1]
  y = (5936117 - geot[3])/(geot[5])
  
  myarray = np.array(gdata.GetRasterBand(1).ReadAsArray())
  
  
  print gdata.RasterXSize
  print gdata.RasterYSize
  
  rb = gdata.GetRasterBand(1)
  intval = rb.ReadAsArray(x,y,1,1)
  print intval
  </code></pre>
  
  <p><strong>Error Message:</strong> 
  Access window out of range in RasterIO(). Requested
  (6126,1437) of size 1x1 on raster of 4695x9798.</p>