Hi,<br>I want to put together a time series of MODIS datasets in VRT, the originals being in HDF EOS format. I do that by defining the SDS for each date and sticking it into a file:<br>HDF4_EOS:EOS_GRID:"../blablah.hdf":blah:blah<br>
HDF4_EOS:EOS_GRID:"../blablah.hdf":blah:blah<br>HDF4_EOS:EOS_GRID:"../blablah.hdf":blah:blah<br>HDF4_EOS:EOS_GRID:"../blablah.hdf":blah:blah<br>[...]<br><br>I then use <br> gdalbuildvrt -separate -input_files_list myfile.txt output_vrt.vrt<br>
<br>which creates the VRT file in output_vrt.vrt. The XML appears sensible, and all things are as they should. <br><br><VRTRasterBand dataType="Int16" band="32"><br> <Metadata><br> <MDI key="STATISTICS_MINIMUM">-310</MDI><br>
<MDI key="STATISTICS_MAXIMUM">32766</MDI><br> <MDI key="STATISTICS_MEAN">321.45436944444</MDI><br> <MDI key="STATISTICS_STDDEV">2990.0525001527</MDI><br>
</Metadata><br> <NoDataValue>3.27670000000000E+04</NoDataValue><br> <ComplexSource><br> <SourceFilename relativeToVRT="1">HDF4_EOS:EOS_GRID:&quot;../XXX&quot;:XXXX:XXX</SourceFilename><br>
<SourceBand>1</SourceBand><br> <SourceProperties RasterXSize="1200" RasterYSize="1200" DataType="Int16" BlockXSize="1200" BlockYSize="1"/><br>
<SrcRect xOff="0" yOff="0" xSize="1200" ySize="1200"/><br> <DstRect xOff="0" yOff="0" xSize="1200" ySize="1200"/><br> <NODATA>32767</NODATA><br>
</ComplexSource><br> </VRTRasterBand><br> <VRTRasterBand dataType="Int16" band="33"><br> <NoDataValue>3.27670000000000E+04</NoDataValue><br> <ComplexSource><br>
<SourceFilename relativeToVRT="1">HDF4_EOS:EOS_GRID:&quot;../XXX&quot;:XXXX:XXX</SourceFilename><br> <SourceBand>1</SourceBand><br> <SourceProperties RasterXSize="1200" RasterYSize="1200" DataType="Int16" BlockXSize="1200" BlockYSize="1"/><br>
<SrcRect xOff="0" yOff="0" xSize="1200" ySize="1200"/><br> <DstRect xOff="0" yOff="0" xSize="1200" ySize="1200"/><br> <NODATA>32767</NODATA><br>
</ComplexSource><br> </VRTRasterBand><br><br><br>If I try to read this into python, using the GDAL bindings, it can deal with individual bands, but using <br><br>g = gdal.Open ( VRT_file )<br>data = g.ReadAsArray()<br>
<br>it fails claiming that it can't find the original HDF datafile. this error pops up with the band that corresponds to band number 33.<br><br>Running gdalinfo -stats on the new filename proceeds reporting the expected information, band by band... slowly but surely, until it reaches band 33 (it's band 33 everytime, even with different datasets):<br>
<br>Band 33 Block=128x128 Type=Int16, ColorInterp=Undefined <br>ERROR 4: `HDF4_EOS:EOS_GRID:"../BlahBlah.hdf":blah:blah' does not exist in the file system,<br>and is not recognised as a supported dataset name. <br>
<br>ERROR 1: IReadBlock failed at X offset 0, Y offset 0<br><br>I can read individual bands OK (although I haven't tried looping through them), including band 33. I have stacks of memory, and data size should not be an issue. <br>
<br>Any clues?<br><br>Thanks!<br>Jose<br><br><br>