I have a set of GeoTIFF files which I have generated from the MODIS LST Product and have used the coordinate information present within the file to work out the index of my 'pixel of interest'/study site. My aim is to extract the data value at this index and so far have been using this code within python:
myfile = band.ReadAsArray(0, 0, cols, rows) value = myfile[y_index, x_index]
which works just fine. This generates the result I want but I am having to read in the whole data file first, before obtaining the result I require. Is it possible to read just my 'pixel of interest' or a subset of the data without having to read the whole file into memory beforehand?
I am using Python and the gdal module within it.