<br><font size=2 face="sans-serif">Andrey:</font>
<br>
<br><font size=2 face="sans-serif">I have done all the right things (I think) and yet I get no error message to the console and no output file with the following command:</font>
<br>
<br><font size=2 face="sans-serif">Z:\modis>X:\downloads\gdal\openev_fw\bin\gdal_translate.exe -b 1 HDF4_SDS:MODIS_L1B:"MOD021KM.A2003169.1845.004.2003170123719.hdf":2 out.tif</font>
<br><font size=2 face="sans-serif"><br>
I am in the directory of the HDF file. The executable is in another directory. I want to extract the first band from the MODIS file. The output from gdalinfo is attached.</font>
<br>
<br><font size=2 face="sans-serif">Till later.</font>
<br><font size=2 face="sans-serif">-----------------------------------------------<br>
David V. Hildebrand<br>
Conservation and Development Branch<br>
Alberta Agriculture, Food and Rural Development<br>
(780) 427-3558<br>
<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td>
<td><font size=1 face="sans-serif"><b>Andrey Kiselev <dron@ak4719.spb.edu></b></font>
<br><font size=1 face="sans-serif">Sent by: gdal-dev-admin@remotesensing.org</font>
<p><font size=1 face="sans-serif">10/22/2003 11:51 PM</font>
<br><font size=1 face="sans-serif">Please respond to gdal-dev</font>
<br>
<td><font size=1 face="Arial"> </font>
<br><font size=1 face="sans-serif"> To: gdal-dev@remotesensing.org</font>
<br><font size=1 face="sans-serif"> cc: </font>
<br><font size=1 face="sans-serif"> Subject: Re: [Gdal-dev] gdal_translate</font></table>
<br>
<br>
<br><font size=2 face="Courier New">On Wed, Oct 22, 2003 at 02:44:29PM -0600, David.Hildebrand@gov.ab.ca wrote:<br>
> I have been trying to use gdal_translate with an HDF MODIS file. How do I <br>
> specify a specific SDS from the file? Do I specify it with the band <br>
> parameter or as part of the filename? In the example below I want to <br>
> extract the first band from the "EV_1KM_RefSB" SDS and create aTIF file.<br>
> <br>
> gdal_translate -ot UInt16 -b 2:1 <br>
> Z:\modis\MOD021KM.A2003169.1845.004.2003170123719.hdf test<br>
> Input file contains subdatasets. Please, select one of them for reading.<br>
<br>
HDF files may contain several differently sized subdatasets. So you<br>
should select one of them to proceed. First, use gdalinfo to get a list<br>
of subdatasets with names and properties:<br>
<br>
$ gdalinfo MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf <br>
Driver: HDF4/Hierarchical Data Format Release 4<br>
Size is 512, 512<br>
Coordinate System is `'<br>
Metadata:<br>
HDFEOSVersion=HDFEOS_V2.6<br>
LOCALGRANULEID=MOD021KM.A2001140.0715.002.2001144040827.hdf<br>
PRODUCTIONDATETIME=2001-05-24T04:08:27.000Z<br>
DAYNIGHTFLAG=Day<br>
<br>
... skipped ...<br>
<br>
Subdatasets:<br>
SUBDATASET_1_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":2<br>
SUBDATASET_1_DESC=[15x408x271] EV_1KM_RefSB (16-bit unsigned integer)<br>
SUBDATASET_2_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":3<br>
SUBDATASET_2_DESC=[15x408x271] EV_1KM_RefSB_Uncert_Indexes (8-bit unsigned integer)<br>
SUBDATASET_3_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":4<br>
SUBDATASET_3_DESC=[16x408x271] EV_1KM_Emissive (16-bit unsigned integer)<br>
SUBDATASET_4_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":5<br>
SUBDATASET_4_DESC=[16x408x271] EV_1KM_Emissive_Uncert_Indexes (8-bit unsigned integer)<br>
SUBDATASET_5_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":6<br>
SUBDATASET_5_DESC=[2x408x271] EV_250_Aggr1km_RefSB (16-bit unsigned integer)<br>
SUBDATASET_6_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":7<br>
SUBDATASET_6_DESC=[2x408x271] EV_250_Aggr1km_RefSB_Uncert_Indexes (8-bit unsigned integer)<br>
SUBDATASET_7_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":8<br>
SUBDATASET_7_DESC=[2x408x271] EV_250_Aggr1km_RefSB_Samples_Used (8-bit integer)<br>
SUBDATASET_8_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":9<br>
SUBDATASET_8_DESC=[5x408x271] EV_500_Aggr1km_RefSB (16-bit unsigned integer)<br>
SUBDATASET_9_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":10<br>
SUBDATASET_9_DESC=[5x408x271] EV_500_Aggr1km_RefSB_Uncert_Indexes (8-bit unsigned integer)<br>
SUBDATASET_10_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":11<br>
SUBDATASET_10_DESC=[5x408x271] EV_500_Aggr1km_RefSB_Samples_Used (8-bit integer)<br>
SUBDATASET_11_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":19<br>
SUBDATASET_11_DESC=[408x271] EV_Band26 (16-bit unsigned integer)<br>
SUBDATASET_12_NAME=HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":20<br>
SUBDATASET_12_DESC=[408x271] EV_Band26_Uncert_Indexes (8-bit unsigned 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>
Corner coordinates are just a placeholders, don't pay attention on them.<br>
Now you see how much GDAL supported subdatasets could be extracted from<br>
the file and you can select the one. For example, take the first one,<br>
described as "[15x408x271] EV_1KM_RefSB (16-bit unsigned integer)":<br>
<br>
$ gdal_translate HDF4_SDS:MODIS_L1B:"MOD021KM.A2001140.0715.002.2001144040827.mimic.hdf":2 out.tif<br>
<br>
Note, that resulting TIFF will have 15 bands and size 271x408.<br>
Slightly complicated, but it is the only way to use non-interactive<br>
tools.<br>
<br>
Regards,<br>
Andrey<br>
<br>
-- <br>
Andrey V. Kiselev<br>
Home phone: +7 812 5274898 ICQ# 26871517<br>
_______________________________________________<br>
Gdal-dev mailing list<br>
Gdal-dev@remotesensing.org<br>
http://remotesensing.org/mailman/listinfo/gdal-dev<br>
</font>
<br>
<br>