I'm looking for a way to convert MODIS LST data from HDF to Tiff format, and reproject from sinusoidal to WGS84 - all using Python GDAL.
An example file is here (I only care about band 0) : http://e4ftl01.cr.usgs.gov/MOLT/MOD11A1.005/2004.03.31/MOD11A1.A2004091.h34v10.005.2007261231833.hdf
After converting all the tiles for one date, I want to use gdalmerge to merge all them into a Tiff file for the entire globe.
I've tried various combinations of gdalwarp and gdal_translate, but I think I'm not specifying the parameters properly.
Here is something I tried.
gdal_translate -of GTiff {inputfile} {outputfile}
Together with one of the following (neither worked):
gdalwarp -of GTIFF -s_srs '+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs' -r cubic -t_srs '+proj=longlat +datum=WGS84 +no_defs' {inputfile} {outputfile}
gdalwarp -s_srs '+proj=sinu +wktext' -t_srs EPSG:32719 -r cubic {inputfile} {outputfile}
I'm new to GIS, though, and have been trying to figure it out from other stackexchange examples.
For anyone familiar with ArcGIS, here is a script that achieves what I'm hoping to do, but using ArcPy. It was written for MODIS ET data. Example here: ftp://ftp.ntsg.umt.edu/pub/MODIS/NTSG_Products/MOD16/MOD16A2.105_MERRAGMAO/Y2000/D193/MOD16A2.A2000193.h08v05.105.2013121202542.hdf
I want to replicate this using GDAL.
In the end I used the solution of Loïc Dutrieux for tiles away from the dateline, and for those near the dateline, I use the clipping solution of AndreJ.