0
votes

I am using MODIS Land Surface Temperature Data which comes with Latitude and Longitude information which, in its current format, I find less than helpful.

This information stores the coordinate for the centre of each 5x5 pixel window of the whole image, and not the coordinate of each pixel. It is hard to explain but in essence, this information is 5 times smaller than the full MODIS image because there is only one latitude and longitude value per 5 pixels in both the vertical and horizontal direction.

Some sample data can be found here: http://e4ftl01.cr.usgs.gov//MODIS_Dailies_F/MOLT/MOD11_L2.041/2015.08.15/MOD11_L2.A2015227.0215.041.2015228093331.hdf

My question is as follows:

How can I interpolate/fill the gaps between this information to obtain the Lat/Lon of each pixel, rather than the 5x5 window?

If the latitude variable from the MODIS data looks like this (simplified of course):

[[1.0  2.0  3.0  4.0  5.0]
[ 1.1  2.1  2.1  4.1  5.1]
[ 1.2  2.2  3.2  4.2  5.2]
[ 1.3  2.3  3.3  4.3  5.3]
[ 1.4  2.4  3.4  4.4  5.4]]

How do I make this grid 5 times larger (25 x 25) to interpolate between the values in both horizontal and vertical direction?

1

1 Answers

1
votes

I was having exactly the same problem and came across python-geotiepoints which does exactly what you need, the only dependencies are numpy and scipy. You just do:

from geotiepoints import modis5kmto1km

lons_1km, lats_1km = modis5kmto1km(lon_5km, lat_5km)

And it will interpolate as needed.