Jump to content

 
Photo

Convert HDF to TIF

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Vassilis

Vassilis

    Contributor

  • New Member
  • PipPip
  • 15 posts
  • Greece

I m trying to extract a layer from hdf file (with Extract Subdataset) and converting to TIF. I cant find how to import, to Model Builder, a variable for multiple images for input and output. I need it because I will do this for 4000+ HDF MODIS images.
I m including an export of my model in python language.

Posted Image


# ---------------------------------------------------------------------------

# Convert HDF to GIF.py

# Created on: Παρ Σεπ 17 2010 02:11:05 μμ

#   (generated by ArcGIS/ModelBuilder)

# ---------------------------------------------------------------------------



# Import system modules

import sys, string, os, arcgisscripting



# Create the Geoprocessor object

gp = arcgisscripting.create()



# Load required toolboxes...

gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx")





# Local variables...

MOD04_L2_A2002001_0840_051_2010120212242_tif = "C:\\Download_modis\\ladsweb.nascom.nasa.gov\\orders\\500494291\\TIF\\MOD04_L2.A2002001.0840.051.2010120212242.tif"

MOD04_L2_A2002001_0840_051_2010120212242_hdf = "C:\\Download_modis\\ladsweb.nascom.nasa.gov\\orders\\500494291\\MOD04_L2.A2002001.0840.051.2010120212242.hdf"



# Process: Extract Subdataset...

gp.ExtractSubDataset_management(MOD04_L2_A2002001_0840_051_2010120212242_hdf, MOD04_L2_A2002001_0840_051_2010120212242_tif, "21")


#2
Melita Kennedy

Melita Kennedy

    Key Contributor

  • Validated Member
  • PipPipPip
  • 69 posts
  • Gender:Not Telling
  • Location:Redlands, CA
  • United States

I m trying to extract a layer from hdf file (with Extract Subdataset) and converting to TIF. I cant find how to import, to Model Builder, a variable for multiple images for input and output. I need it because I will do this for 4000+ HDF MODIS images.
I m including an export of my model in python language.

...graphic and python omitted...


I haven't used models for years, but have you seen this help topic:

Iteration using Lists

There's a similar one for using iteration when scripting as opposed to models.

Melita

#3
vhramos

vhramos

    Contributor

  • Validated Member
  • PipPip
  • 12 posts
  • Guatemala

You can try HEG that will allow you to convert HDF files to tiff in batch mode. Here´s the site

http://hdfeos.org/software/heg.php

VHR

#4
Vassilis

Vassilis

    Contributor

  • New Member
  • PipPip
  • 15 posts
  • Greece

I haven't used models for years, but have you seen this help topic:

Iteration using Lists

There's a similar one for using iteration when scripting as opposed to models.

Melita

Thanks Melita it works.

You can try HEG that will allow you to convert HDF files to tiff in batch mode. Here´s the site

http://hdfeos.org/software/heg.php

VHR


I tried hard with Hegtools and with scripting in Windows and Linux but it turned out to be a waste of time. That would be the best solution, but it didn't work.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->