<span style="font-weight: bold;">Hello all,</span><br style="font-weight: bold;"><br style="font-weight: bold;"><span style="font-weight: bold;">I'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've a huge modis dataset to process in batch mode, or at least, it is what i'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:"
MOD13Q1.A2007.h17v04.005.2007204181956.hdf":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 `'<br>Metadata: ...<br> HDFEOSVersion=HDFEOS_V2.9<br> LOCALGRANULEID=MOD13Q1.A2007177.h17v04.005.2007204181956.hdf<br> ...<br> NORTHBOUNDINGCOORDINATE=49.9999999955098<br>
SOUTHBOUNDINGCOORDINATE=39.9999999964079<br> EASTBOUNDINGCOORDINATE=0.0129643652214683<br> WESTBOUNDINGCOORDINATE=-15.5572382657541<br> ...<br>Subdatasets:<br> SUBDATASET_1_NAME=HDF4_EOS:EOS_GRID:"MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days NDVI<br> SUBDATASET_1_DESC=[4800x4800] 250m 16 days NDVI MODIS_Grid_16DAY_250m_500m_VI (16-bit integer) SUBDATASET_2_NAME=HDF4_EOS:EOS_GRID:"MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days EVI<br> SUBDATASET_2_DESC=[4800x4800] 250m 16 days EVI MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)<br> SUBDATASET_3_NAME=HDF4_EOS:EOS_GRID:"MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days VI Quality<br> SUBDATASET_3_DESC=[4800x4800] 250m 16 days VI Quality MODIS_Grid_16DAY_250m_500m_VI (16-bit unsigned integer) SUBDATASET_4_NAME=HDF4_EOS:EOS_GRID:"MOD13Q1.A2007177.h17v04.005.2007204181956.hdf
":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days red reflectance<br> SUBDATASET_4_DESC=[4800x4800] 250m 16 days red reflectance MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)<br> SUBDATASET_5_NAME=HDF4_EOS:EOS_GRID:"
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days NIR reflectance<br> SUBDATASET_5_DESC=[4800x4800] 250m 16 days NIR reflectance MODIS_Grid_16DAY_250m_500m_VI (16-bit integer) SUBDATASET_6_NAME=HDF4_EOS:EOS_GRID:"
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days blue reflectance<br> SUBDATASET_6_DESC=[4800x4800] 250m 16 days blue reflectance MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)
<br> SUBDATASET_7_NAME=HDF4_EOS:EOS_GRID:"MOD13Q1.A2007177.h17v04.005.2007204181956.hdf":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days MIR reflectance<br> SUBDATASET_7_DESC=[4800x4800] 250m 16 days MIR reflectance MODIS_Grid_16DAY_250m_500m_VI (16-bit integer) SUBDATASET_8_NAME=HDF4_EOS:EOS_GRID:"
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days view zenith angle<br> SUBDATASET_8_DESC=[4800x4800] 250m 16 days view zenith angle MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)
<br> SUBDATASET_9_NAME=HDF4_EOS:EOS_GRID:"MOD13Q1.A2007177.h17v04.005.2007204181956.hdf":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days sun zenith angle<br> SUBDATASET_9_DESC=[4800x4800] 250m 16 days sun zenith angle MODIS_Grid_16DAY_250m_500m_VI (16-bit integer) SUBDATASET_10_NAME=HDF4_EOS:EOS_GRID:"
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days relative azimuth angle<br> SUBDATASET_10_DESC=[4800x4800] 250m 16 days relative azimuth angle MODIS_Grid_16DAY_250m_500m_VI (16-bit integer)
<br> SUBDATASET_11_NAME=HDF4_EOS:EOS_GRID:"MOD13Q1.A2007177.h17v04.005.2007204181956.hdf":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days composite day of the year<br> SUBDATASET_11_DESC=[4800x4800] 250m 16 days composite day of the year MODIS_Grid_16DAY_250m_500m_VI (16-bit integer) SUBDATASET_12_NAME=HDF4_EOS:EOS_GRID:"
MOD13Q1.A2007177.h17v04.005.2007204181956.hdf":MODIS_Grid_16DAY_250m_500m_VI:250m 16 days pixel reliability<br> SUBDATASET_12_DESC=[4800x4800] 250m 16 days pixel reliability MODIS_Grid_16DAY_250m_500m_VI (8-bit integer)
<br>Corner Coordinates:<br>Upper Left ( 0.0, 0.0)<br>Lower Left ( 0.0, 512.0)<br>Upper Right ( 512.0, 0.0)<br>Lower Right ( 512.0, 512.0)<br>Center ( 256.0, 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["SINUSOIDAL Unspecified Datum. Semi-major axis: 6371007.181000, Semi-minor axis: 0.000000",<br>
GEOGCS["unnamed",<br> DATUM["unknown",<br> SPHEROID["unnamed",6371007.181,0]],<br> PRIMEM["Greenwich",0],<br> UNIT["degree",0.0174532925199433
]],<br> PROJECTION["Sinusoidal"],<br> PARAMETER["longitude_of_center",0],<br> PARAMETER["false_easting",0],<br> PARAMETER["false_northing",0],<br> UNIT["metre",1,
<br> AUTHORITY["EPSG","9001"]]]<br>Origin = (-1111834.691493776600000,5559636.770208701500000)<br>Pixel Size = (231.656358263750060,-231.656358263750060)<br>Metadata:<br> AREA_OR_POINT=Point<br>
TIFFTAG_SOFTWARE=MODIS Reprojection Tool v3.3a January 2006<br>Corner Coordinates:<br>Upper Left (-1111834.691, 5559636.770) ( 15d33'19.01"W, 49d59'56.25"N)<br>Lower Left (-1111834.691, 4447686.251) ( 13d 3'
9.05"W, 39d59'56.25"N)<br>Upper Right ( 115.828, 5559636.770) ( 0d 0'5.83"E, 49d59'56.25"N)<br>Lower Right ( 115.828, 4447686.251) ( 0d 0'4.90"E, 39d59'56.25"N)<br>
Center ( -555859.432, 5003661.510) ( 7d 4'10.08"W, 44d59'56.25"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["unnamed",<br> GEOGCS["Unknown datum based upon the custom spheroid",<br> DATUM["unknown",
<br> SPHEROID["unnamed",6371007.181,0]],<br> PRIMEM["Greenwich",0],<br> UNIT["degree",0.0174532925199433]],<br> PROJECTION["Sinusoidal"],<br> PARAMETER["longitude_of_center",0],
<br> PARAMETER["false_easting",0],<br> PARAMETER["false_northing",0],<br> UNIT["metre",1,<br> AUTHORITY["EPSG","9001"]]]<br>Origin = (-1111950.519667000000000
,5559752.598333000200000)<br>Pixel Size = (231.656358263958340,-231.656358263750060)<br>Metadata:<br> AREA_OR_POINT=Area<br> HDFEOSVersion=HDFEOS_V2.9<br> LOCALGRANULEID=MOD13Q1.A2007177.h17v04.005.2007204181956.hdf<br>
...<br> NORTHBOUNDINGCOORDINATE=49.9999999955098<br> SOUTHBOUNDINGCOORDINATE=39.9999999964079<br> EASTBOUNDINGCOORDINATE=0.0129643652214683<br> WESTBOUNDINGCOORDINATE=-15.5572382657541<br> ...<br>Corner Coordinates:<br>
Upper Left (-1111950.520, 5559752.598) ( 15d33'26.06"W, 50d 0'0.00"N)<br>Lower Left (-1111950.520, 4447802.079) ( 13d 3'14.66"W, 40d 0'0.00"N)<br>Upper Right ( 0.000, 5559752.598
) ( 0d 0'0.01"E, 50d 0'0.00"N)<br>Lower Right ( 0.000, 4447802.079) ( 0d 0'0.01"E, 40d 0'0.00"N)<br>Center ( -555975.260, 5003777.339) ( 7d 4'15.84"W, 45d 0'0.00
"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'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>