<span style="font-weight: bold;">Hello all,</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">I&#39;ve already posted this questions on open-ev list but i think they are better adressed to this list, so here they go!
</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">I&#39;ve a huge modis dataset to process in batch mode, or at least, it is what i&#39;m trying to do!</span><br style="font-weight: bold;">
<br style="font-weight: bold;"><span style="font-weight: bold;">My first problem is that i can only extract different bands if i use gdal_translate -sds command. Well, i donīt need them all and so i have tried gdal_translate HDF4_EOS:EOS_GRID:&quot;
MOD13Q1.A2007.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI! Unfortunately i get error message saying the file size is zero and that it has no bands. Any suggestions?</span><br style="font-weight: bold;">
<br style="font-weight: bold;"><span style="font-weight: bold;">The original file info is (from gdalinfo):<br><br></span>Driver: HDF4/Hierarchical Data Format Release 4<br>Files: MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
<br>Size is 512, 512<br>Coordinate System is `&#39;<br>Metadata: ...<br>&nbsp; HDFEOSVersion=HDFEOS_V2.9<br>&nbsp; LOCALGRANULEID=MOD13Q1.A2007177.h17v04.005.2007204181956.hdf<br>&nbsp; ...<br>&nbsp;NORTHBOUNDINGCOORDINATE=49.9999999955098<br>
&nbsp; SOUTHBOUNDINGCOORDINATE=39.9999999964079<br>&nbsp; EASTBOUNDINGCOORDINATE=0.0129643652214683<br>&nbsp; WESTBOUNDINGCOORDINATE=-15.5572382657541<br>&nbsp; ...<br>Subdatasets:<br>&nbsp;SUBDATASET_1_NAME=HDF4_EOS:EOS_GRID:&quot;MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days NDVI<br>&nbsp; SUBDATASET_1_DESC=[4800x4800] 250m 16 days NDVI MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)&nbsp; SUBDATASET_2_NAME=HDF4_EOS:EOS_GRID:&quot;MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days EVI<br>&nbsp; SUBDATASET_2_DESC=[4800x4800] 250m 16 days EVI MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)<br>&nbsp;SUBDATASET_3_NAME=HDF4_EOS:EOS_GRID:&quot;MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days VI Quality<br>&nbsp; SUBDATASET_3_DESC=[4800x4800] 250m 16 days VI Quality MODIS_Grid_16DAY_250m_500m_VI (16-bit unsigned integer)&nbsp; SUBDATASET_4_NAME=HDF4_EOS:EOS_GRID:&quot;MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days red reflectance<br>&nbsp; SUBDATASET_4_DESC=[4800x4800] 250m 16 days red reflectance MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)<br>&nbsp;SUBDATASET_5_NAME=HDF4_EOS:EOS_GRID:&quot;
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days NIR reflectance<br>&nbsp; SUBDATASET_5_DESC=[4800x4800] 250m 16 days NIR reflectance MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)&nbsp; SUBDATASET_6_NAME=HDF4_EOS:EOS_GRID:&quot;
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days blue reflectance<br>&nbsp; SUBDATASET_6_DESC=[4800x4800] 250m 16 days blue reflectance MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)
<br>&nbsp;SUBDATASET_7_NAME=HDF4_EOS:EOS_GRID:&quot;MOD13Q1.A2007177.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days MIR reflectance<br>&nbsp; SUBDATASET_7_DESC=[4800x4800] 250m 16 days MIR reflectance MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)&nbsp; SUBDATASET_8_NAME=HDF4_EOS:EOS_GRID:&quot;
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days view zenith angle<br>&nbsp; SUBDATASET_8_DESC=[4800x4800] 250m 16 days view zenith angle MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)
<br>&nbsp;SUBDATASET_9_NAME=HDF4_EOS:EOS_GRID:&quot;MOD13Q1.A2007177.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days sun zenith angle<br>&nbsp; SUBDATASET_9_DESC=[4800x4800] 250m 16 days sun zenith angle MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)&nbsp; SUBDATASET_10_NAME=HDF4_EOS:EOS_GRID:&quot;
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days relative azimuth angle<br>&nbsp; SUBDATASET_10_DESC=[4800x4800] 250m 16 days relative azimuth angle MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)
<br>&nbsp;SUBDATASET_11_NAME=HDF4_EOS:EOS_GRID:&quot;MOD13Q1.A2007177.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days composite day of the year<br>&nbsp; SUBDATASET_11_DESC=[4800x4800] 250m 16 days composite day of the year MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)&nbsp; SUBDATASET_12_NAME=HDF4_EOS:EOS_GRID:&quot;
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf&quot;:MODIS_Grid_16DAY_250m_500m_VI:250m 16 days pixel reliability<br>&nbsp; SUBDATASET_12_DESC=[4800x4800] 250m 16 days pixel reliability MODIS_Grid_16DAY_250m_500m_VI (8-bit integer)
<br>Corner Coordinates:<br>Upper Left&nbsp; (&nbsp;&nbsp;&nbsp; 0.0,&nbsp;&nbsp;&nbsp; 0.0)<br>Lower Left&nbsp; (&nbsp;&nbsp;&nbsp; 0.0,&nbsp; 512.0)<br>Upper Right (&nbsp; 512.0,&nbsp;&nbsp;&nbsp; 0.0)<br>Lower Right (&nbsp; 512.0,&nbsp; 512.0)<br>Center&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (&nbsp; 256.0,&nbsp; 256.0)<br><br><span style="font-weight: bold;">
The second problem: after extracting all bands without reprojecting, the coordinates come with shifts when compared to extracted bands from mrt tools</span><br><br><span style="font-weight: bold;">gdalinfo from extracted bands with mrt tools is:
<br><br></span>Driver: GTiff/GeoTIFF<br>Files: testemrt.tif<br>Size is 4800, 4800<br>Coordinate System is:<br>PROJCS[&quot;SINUSOIDAL Unspecified Datum. Semi-major axis: 6371007.181000, Semi-minor axis: 0.000000&quot;,<br>
&nbsp;&nbsp;&nbsp; GEOGCS[&quot;unnamed&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DATUM[&quot;unknown&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPHEROID[&quot;unnamed&quot;,6371007.181,0]],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PRIMEM[&quot;Greenwich&quot;,0],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UNIT[&quot;degree&quot;,0.0174532925199433
]],<br>&nbsp;&nbsp;&nbsp; PROJECTION[&quot;Sinusoidal&quot;],<br>&nbsp;&nbsp;&nbsp; PARAMETER[&quot;longitude_of_center&quot;,0],<br>&nbsp;&nbsp;&nbsp; PARAMETER[&quot;false_easting&quot;,0],<br>&nbsp;&nbsp;&nbsp; PARAMETER[&quot;false_northing&quot;,0],<br>&nbsp;&nbsp;&nbsp; UNIT[&quot;metre&quot;,1,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]]]<br>Origin = (-1111834.691493776600000,5559636.770208701500000)<br>Pixel Size = (231.656358263750060,-231.656358263750060)<br>Metadata:<br>&nbsp; AREA_OR_POINT=Point<br>
&nbsp; TIFFTAG_SOFTWARE=MODIS Reprojection Tool&nbsp; v3.3a January 2006<br>Corner Coordinates:<br>Upper Left&nbsp; (-1111834.691, 5559636.770) ( 15d33&#39;19.01&quot;W, 49d59&#39;56.25&quot;N)<br>Lower Left&nbsp; (-1111834.691, 4447686.251) ( 13d 3&#39;
9.05&quot;W, 39d59&#39;56.25&quot;N)<br>Upper Right (&nbsp;&nbsp;&nbsp;&nbsp; 115.828, 5559636.770) (&nbsp; 0d 0&#39;5.83&quot;E, 49d59&#39;56.25&quot;N)<br>Lower Right (&nbsp;&nbsp;&nbsp;&nbsp; 115.828, 4447686.251) (&nbsp; 0d 0&#39;4.90&quot;E, 39d59&#39;56.25&quot;N)<br>
Center&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( -555859.432, 5003661.510) (&nbsp; 7d 4&#39;10.08&quot;W, 44d59&#39;56.25&quot;N)<br>Band 1 Block=4800x1 Type=Int16, ColorInterp=Gray<br><br><span style="font-weight: bold;">gdalinfo from extracted bands with gdal_translate is:
</span><br><br>Driver: GTiff/GeoTIFF<br>Files: teste.tif<br>Size is 4800, 4800<br>Coordinate System is:<br>PROJCS[&quot;unnamed&quot;,<br>&nbsp;&nbsp;&nbsp; GEOGCS[&quot;Unknown datum based upon the custom spheroid&quot;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DATUM[&quot;unknown&quot;,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPHEROID[&quot;unnamed&quot;,6371007.181,0]],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PRIMEM[&quot;Greenwich&quot;,0],<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UNIT[&quot;degree&quot;,0.0174532925199433]],<br>&nbsp;&nbsp;&nbsp; PROJECTION[&quot;Sinusoidal&quot;],<br>&nbsp;&nbsp;&nbsp; PARAMETER[&quot;longitude_of_center&quot;,0],
<br>&nbsp;&nbsp;&nbsp; PARAMETER[&quot;false_easting&quot;,0],<br>&nbsp;&nbsp;&nbsp; PARAMETER[&quot;false_northing&quot;,0],<br>&nbsp;&nbsp;&nbsp; UNIT[&quot;metre&quot;,1,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; AUTHORITY[&quot;EPSG&quot;,&quot;9001&quot;]]]<br>Origin = (-1111950.519667000000000
,5559752.598333000200000)<br>Pixel Size = (231.656358263958340,-231.656358263750060)<br>Metadata:<br>&nbsp; AREA_OR_POINT=Area<br>&nbsp; HDFEOSVersion=HDFEOS_V2.9<br>&nbsp; LOCALGRANULEID=MOD13Q1.A2007177.h17v04.005.2007204181956.hdf<br>
...<br>&nbsp; NORTHBOUNDINGCOORDINATE=49.9999999955098<br>&nbsp; SOUTHBOUNDINGCOORDINATE=39.9999999964079<br>&nbsp; EASTBOUNDINGCOORDINATE=0.0129643652214683<br>&nbsp; WESTBOUNDINGCOORDINATE=-15.5572382657541<br>&nbsp;...<br>Corner Coordinates:<br>
Upper Left&nbsp; (-1111950.520, 5559752.598) ( 15d33&#39;26.06&quot;W, 50d 0&#39;0.00&quot;N)<br>Lower Left&nbsp; (-1111950.520, 4447802.079) ( 13d 3&#39;14.66&quot;W, 40d 0&#39;0.00&quot;N)<br>Upper Right (&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.000, 5559752.598
) (&nbsp; 0d 0&#39;0.01&quot;E, 50d 0&#39;0.00&quot;N)<br>Lower Right (&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.000, 4447802.079) (&nbsp; 0d 0&#39;0.01&quot;E, 40d 0&#39;0.00&quot;N)<br>Center&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( -555975.260, 5003777.339) (&nbsp; 7d 4&#39;15.84&quot;W, 45d 0&#39;0.00
&quot;N)<br>Band 1 Block=4800x1 Type=Int16, ColorInterp=Gray<br><br><span style="font-weight: bold;">The third problem is with gdalwarp but i suppose it is originated by the shifts occurred when extracting the bands (made previously). I want to reproject images to WGS84 and so picked up esri prj files for sinusoidal and wgs84 projections. Then i&#39;ve changed the sinusoidal file by changing the semimajor axis from 6371000 to 
6371007.181 and by changing the degree. After applied gdalwarp and shifts are maintained.</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">Can you please help me, as i said before i have a lot of imagery to process and doing it one by one is completely absurd! So i really need some help so that i can make it in batch mode!
</span><br style="font-weight: bold;"><span style="font-weight: bold;">Thanks in advance,</span><br><br>Hugo<br><br>