I'm trying to adapt this example for my needs: https://mygeoblog.com/2017/10/06/from-gee-to-numpy-to-geotiff/
The difference is that I'm using the MODIS NDVI image collection.
# define the image
img = ee.ImageCollection('MODIS/MCD43A4_006_NDVI').filterDate(date_start, date_end)
median_data = img.median()
# get the lat lon and add the ndvi
latlon = ee.Image.pixelLonLat().addBands(median_data)
# apply reducer to list
latlon = latlon.reduceRegion(
reducer=ee.Reducer.toList(),
geometry=area,
scale=10000);
# get data into three different arrays
data = np.array((ee.Array(latlon.get("NDVI")).getInfo()))
lats = np.array((ee.Array(latlon.get("latitude")).getInfo()))
lons = np.array((ee.Array(latlon.get("longitude")).getInfo()))
I thought I understood the example but my data, lats and lons arrays are coming out different sizes which is obviously incorrect.
In [2]: data.shape
Out[2]: (21005,)
In [3]: lats.shape
Out[3]: (21051,)
In [4]: lons.shape
Out[4]: (21051,)
Any ideas what I'm doing wrong?