WHat I meant by strange is that I only get one band to have a significant value... all other bands have 'Undefined value' ...<br><br>I tried renaming the file from <span class="q">AMOD021KM20061229043102.hdf to </span>
<span class="q">MOD021KM20061229043102.hdf, ie : removing the A in front which, I guess, as been used for convention to indicate an image from Terra satellite as opposed to the Aqua satellite..<br><br>I also tried, some days ago with HEG tools but when I try to open the image I get an error popup statin "cannot open load
</span><span class="q">AMOD021KM20061229043102.hdf, unknown error"<br><br>I'm having problem installing MRT in Linux (Ubuntu) .. I will keep trying :(<br><br>How do I know if I have a good image? gdalinfo??<br><br>
This is what I get with <span style="font-weight: bold;">gdalinfo -nomd</span><br><br style="font-weight: bold;"><span style="font-weight: bold;">rasdaman@mattia-desktop:/opt/HEG/iHEG$ gdalinfo -nomd MOD021KM20061229043102.hdf
</span><br style="font-weight: bold;"><span style="font-weight: bold;">Driver: HDF4/Hierarchical Data Format Release 4</span><br style="font-weight: bold;"><span style="font-weight: bold;">Size is 512, 512</span><br style="font-weight: bold;">
<span style="font-weight: bold;">Coordinate System is `'</span><br style="font-weight: bold;"><span style="font-weight: bold;">Subdatasets:</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:"
MOD021KM20061229043102.hdf":0</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_1_DESC=[15x3630x1354] EV_1KM_RefSB (16-bit unsigned integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
SUBDATASET_2_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":1</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_2_DESC=[15x3630x1354] EV_1KM_RefSB_Uncert_Indexes (8-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_3_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":2</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_3_DESC=[2x3630x1354] EV_250_Aggr1km_RefSB (16-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_4_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":3</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_4_DESC=[2x3630x1354] EV_250_Aggr1km_RefSB_Uncert_Indexes (8-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_5_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":4</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_5_DESC=[2x3630x1354] EV_250_Aggr1km_RefSB_Samples_Used (8-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_6_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":5</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_6_DESC=[5x3630x1354] EV_500_Aggr1km_RefSB (16-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_7_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":6</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_7_DESC=[5x3630x1354] EV_500_Aggr1km_RefSB_Uncert_Indexes (8-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_8_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":7</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_8_DESC=[5x3630x1354] EV_500_Aggr1km_RefSB_Samples_Used (8-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_9_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":8</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_9_DESC=[16x3630x1354] EV_1KM_Emissive (16-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_10_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":9</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_10_DESC=[16x3630x1354] EV_1KM_Emissive_Uncert_Indexes (8-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_11_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":10</span><br style="font-weight: bold;"><span style="font-weight: bold;">
SUBDATASET_11_DESC=[726x271] Latitude (32-bit floating-point)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_12_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":11</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> SUBDATASET_12_DESC=[726x271] Longitude (32-bit floating-point)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_13_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf
":12</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_13_DESC=[726x271] Height (16-bit integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_14_NAME=HDF4_SDS:UNKNOWN:"
MOD021KM20061229043102.hdf":13</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_14_DESC=[726x271] SensorZenith (16-bit integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
SUBDATASET_15_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":14</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_15_DESC=[726x271] SensorAzimuth (16-bit integer)</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> SUBDATASET_16_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":15</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_16_DESC=[726x271] Range (16-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_17_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":16</span><br style="font-weight: bold;"><span style="font-weight: bold;">
SUBDATASET_17_DESC=[726x271] SolarZenith (16-bit integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_18_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":17</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> SUBDATASET_18_DESC=[726x271] SolarAzimuth (16-bit integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_19_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf
":18</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_19_DESC=[726x271] gflags (8-bit unsigned integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_20_NAME=HDF4_SDS:UNKNOWN:"
MOD021KM20061229043102.hdf":19</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_20_DESC=[3630x1354] EV_Band26 (16-bit unsigned integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
SUBDATASET_21_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":20</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_21_DESC=[3630x1354] EV_Band26_Uncert_Indexes (8-bit unsigned integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_22_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":21</span><br style="font-weight: bold;"><span style="font-weight: bold;">
SUBDATASET_22_DESC=[16x10] Noise in Thermal Detectors (8-bit unsigned integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_23_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf
":22</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_23_DESC=[16x10] Change in relative responses of thermal detectors (8-bit unsigned integer)</span><br style="font-weight: bold;">
<span style="font-weight: bold;"> SUBDATASET_24_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":23</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_24_DESC=[363x16x10] DC Restore Change for Thermal Bands (8-bit integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_25_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":24</span><br style="font-weight: bold;"><span style="font-weight: bold;">
SUBDATASET_25_DESC=[363x2x40] DC Restore Change for Reflective 250m Bands (8-bit integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_26_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf
":25</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_26_DESC=[363x5x20] DC Restore Change for Reflective 500m Bands (8-bit integer)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
SUBDATASET_27_NAME=HDF4_SDS:UNKNOWN:"MOD021KM20061229043102.hdf":26</span><br style="font-weight: bold;"><span style="font-weight: bold;"> SUBDATASET_27_DESC=[363x15x10] DC Restore Change for Reflective 1km Bands (8-bit integer)
</span><br style="font-weight: bold;"><span style="font-weight: bold;">Corner Coordinates:</span><br style="font-weight: bold;"><span style="font-weight: bold;">Upper Left ( 0.0, 0.0)</span><br style="font-weight: bold;">
<span style="font-weight: bold;">Lower Left ( 0.0, 512.0)</span><br style="font-weight: bold;"><span style="font-weight: bold;">Upper Right ( 512.0, 0.0)</span><br style="font-weight: bold;"><span style="font-weight: bold;">
Lower Right ( 512.0, 512.0)</span><br style="font-weight: bold;"><span style="font-weight: bold;">Center ( 256.0, 256.0)</span><br style="font-weight: bold;"><span style="font-weight: bold;">rasdaman@mattia-desktop
:/opt/HEG/iHEG$</span><br style="font-weight: bold;"><br><span style="font-weight: bold;"></span><br style="font-weight: bold;">You had sent me the following command some days ago to convert to tiff using gdal_translate<br>
<span style="font-weight: bold;">gdal_translate HDF4_SDS:UNKNOWN:"AMOD021KM20061229043102.hdf":9 test_b9.tif<br><br></span>WOuld I need to do the analogous thing with the <span style="font-weight: bold;">gdalwarp
<span style="font-weight: bold;"> </span></span>utility?? So as to consider GCP??<br><br>One last thing... At the end of day I will need to process all images in the same way and to get out of them RGB images (The images cover the whole national territory of China)... For this, I'm I looking at
<span style="font-style: italic;">all</span> the bands in the HDF File?? Or does it only concern a certain number of them (in this case <span style="font-style: italic;">all</span> means the 26 bands displayed with gdalinfo)
<br><br>Thanks for your patience and help, Its only that I have some deadlines coming for a big project and really need to sort these data conversions ASAP.<br><br>Thanks<br><br>Mattia<span style="font-weight: bold;"><span style="font-weight: bold;">
</span><br></span><br><br></span><br><div><span class="gmail_quote">On 4/19/07, <b class="gmail_sendername">guillaume huby</b> <<a href="mailto:guillaume.huby.lists@gmail.com">guillaume.huby.lists@gmail.com</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br><br><div><span class="q"><span class="gmail_quote">On 4/19/07, <b class="gmail_sendername">
Guillaume HUBY</b> <<a href="mailto:ghuby@geosys.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">ghuby@geosys.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hey all,<br><br>I ran the following command on an HDF format:<br><br>$ gdal_translate HDF4_SDS:UNKNOWN:"AMOD021KM20061229043102.hdf":9<br>test_b9.tif</blockquote></span><div><br>First of all, your modis file does not look like like the HDF-EOS MOD21KM file I know (but I downloaded subseted data). Are you sure you get a good one ?
<br>Second point, each dataset of MOD21KM hdf is made of raw data with GCP within meta data. So, AFAIK, if you use gdal_translate you do not apply GCP to image. You should use gdalwarp instead.<br> </div><div><span class="q" id="q_1120a9d672c98ffa_3">
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I hence get a geotiff file called test_b9.tif<br>I actually ran the command on all my 26 channels and got 26 different<br>TIF files.<br>I think that this should be the most important channel though, namely,<br>it is the :
<br><br> SUBDATASET_9_NAME=HDF4_SDS:UNKNOWN:"AMOD021KM20061229043102.hdf":8<br> SUBDATASET_9_DESC=[16x3630x1354] EV_1KM_Emissive (16-bit unsigned<br>integer)<br><br><br>If I now run gdalinfo I get:<br><br>rasdaman@mattia-desktop
:~/FTPCHINA$ gdalinfo -nomd test_b8.tif<br>Driver: GTiff/GeoTIFF<br>Size is 1354, 3630<br>Coordinate System is `'<br>Corner Coordinates:<br>Upper Left ( 0.0, 0.0)<br>Lower Left ( 0.0, 3630.0)<br>Upper Right (
1354.0, 0.0)<br>Lower Right ( 1354.0, 3630.0)<br>Center ( 677.0, 1815.0)<br>Band 1 Block=1354x3 Type=UInt16, ColorInterp=Gray<br>Band 2 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 3 Block=1354x3 Type=UInt16, ColorInterp=Undefined
<br>Band 4 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 5 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 6 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 7 Block=1354x3 Type=UInt16, ColorInterp=Undefined
<br>Band 8 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 9 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 10 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 11 Block=1354x3 Type=UInt16, ColorInterp=Undefined
<br>Band 12 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 13 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 14 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>Band 15 Block=1354x3 Type=UInt16, ColorInterp=Undefined
<br>Band 16 Block=1354x3 Type=UInt16, ColorInterp=Undefined<br>rasdaman@mattia-desktop:~/FTPCHINA$</blockquote><div> </div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Isnt this a strange result?</blockquote></span></div><div><br>No, a hdf file is made of datasets. Each dataset can contain rasters (or other data). In your case, the ninth dataset of your hdf file contains a raster with 16 bands (see the 16 of SUBDATASET_9_DESC=[16x3630x1354]). So when you extract the ninth dataset, you get a raster with 16 bands.
<br> </div><span class="q"><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">What about the coordinate system?</blockquote></span><div><br>
see before.<br></div><span class="q"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I tried to merge all the tifs with gdalwarp, but had no success so far..<br><br>I'm pretty new to this field and in very high waters..
<br><br>Any suggestions?</blockquote></span><div><br>If you don't want to use batch mode or have a uniform process for all images, you should use HEG-Tools or MRT which EOS made tools with simple GUI very easy to use to extract data from HDF-EOS files.
<br><br>Good luck,<br>Guillaume.<br></div></div>
<br>_______________________________________________<br>Gdal-dev mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Gdal-dev@lists.maptools.org">Gdal-dev@lists.maptools.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.maptools.org/mailman/listinfo/gdal-dev" target="_blank">
http://lists.maptools.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Mattia