# Varying resolution (scale) when using Google Earth Engine sampleRectangle to convert to numpy array

I am trying to convert my google earth engine image to a numpy array. I have used sampleRectangle but the scale seems to be set to 1 degree, way too large, even though the native resolution of the dataset is much smaller.

``````import numpy as np
import ee

ee.Authenticate()
ee.Initialize()

def get_mod16(date1,date2,geometry):
mod16 = ee.ImageCollection('MODIS/006/MOD16A2')
mod16_img = mod16.filterDate(date1,date2).select('ET').sum().multiply(10)
return(mod16_img)

geom = ee.Geometry.Polygon(
[[[min_lon, max_lat],
[min_lon, min_lat],
[max_lon, min_lat],
[max_lon, max_lat]]])
return(geom)

mod16 = get_mod16('2014-04-01','2014-10-01',geom)
array = mod16.sampleRectangle(region=geom)
nparray = np.array(array.get('ET').getInfo())

print(nparray.shape)
``````

This returns an np array of size (2,5). I thought maybe it's because my region is too large. I modified the code so the region is quite small (0.01 degrees by 0.01 degrees). It then returns an array of size (1,1).

Carrying out reducers (like your `sum()`) on an Image Collection gets rid of the original projection and replaces it with the default projection, which has a scale of 1 degree.

So after doing that reduction you would have to reproject your image back to the original projection.

``````proj = ee.ImageCollection('MODIS/006/MOD16A2').first().projection()
origProj = mod16.reproject(proj)
``````