# HDF5 Package can't open HDF file

**URL:** <https://discourse.julialang.org/t/hdf5-package-cant-open-hdf-file/6519>\
**Category:** New to Julia\
**Created:** [October 18, 2017, 6:37am UTC](https://discourse.julialang.org/t/hdf5-package-cant-open-hdf-file/6519 "2017-10-18T06:37:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nobody](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nobody](https://discourse.julialang.org/u/nobody)\
**Post date:** [October 18, 2017, 6:37am UTC](https://discourse.julialang.org/t/hdf5-package-cant-open-hdf-file/6519/1 "2017-10-18T06:37:39Z")

</div>

Hey

I am new to julia programming. Actually, not just to julia but to programming as a whole. I am currently investigating the MODIS product in a .hdf format. I used HDF5 package but it can’t recognize the file. Here are my commands in the julia REPL with the corresponding output.

julia\> using HDF5

julia\> x=h5open(“MOD16A2.A2002M01.h30v07.105.2013121125445.hdf”)  
ERROR: This does not appear to be an HDF5 file  
Stacktrace:  
[1] #h5open#3(::Bool, ::Function, ::String, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::HDF5.HDF5Properties, ::HDF5.HDF5Properties) at /root/.julia/v0.6/HDF5/src/HDF5.jl:593  
[2] (::HDF5.#kw##h5open)(::Array{Any,1}, ::HDF5.#h5open, ::String, ::Bool, ::Bool, ::Bool, ::Bool, ::Bool, ::HDF5.HDF5Properties, ::HDF5.HDF5Properties) at ./:0  
[3] #h5open#4(::Bool, ::Function, ::String, ::String) at /root/.julia/v0.6/HDF5/src/HDF5.jl:643  
[4] h5open(::String) at /root/.julia/v0.6/HDF5/src/HDF5.jl:625

---

<div class="post-metadata">

**Author:** ![Daneel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/daneel/32/175_2.png) [@Daneel](https://discourse.julialang.org/u/Daneel)\
**Post date:** [October 18, 2017, 6:45am UTC](https://discourse.julialang.org/t/hdf5-package-cant-open-hdf-file/6519/2 "2017-10-18T06:45:12Z")

</div>

> [@nobody](#):
>
> ERROR: This does not appear to be an HDF5 file

Do you know which version of HDF it is? If the data is old enough it might be HDF4. You can check the version by downloading [HDFView](https://hdfgroup.org/downloads/) from the HDF Group and open your file. With the file open look at the root folder. It will have a 4 or 5 for the version of HDF that it uses.

---

<div class="post-metadata">

**Author:** ![slowbrain](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/slowbrain/32/2224_2.png) [@slowbrain](https://discourse.julialang.org/u/slowbrain)\
**Post date:** [October 18, 2017, 11:54am UTC](https://discourse.julialang.org/t/hdf5-package-cant-open-hdf-file/6519/3 "2017-10-18T11:54:59Z")

</div>

If I’m correct it is MODIS data from 2002 and it is indeed HDF4 as @Daneel pointed out as probable cause.  
At following page [HDF-EOS Tools](http://hdfeos.org/software/tool.php) you’ll find some tools to do the HDF4 → HDF5 conversion. Then it should be possible to open it with HDF5.jl.

---

<div class="post-metadata">

**Author:** ![nobody](https://avatars.discourse-cdn.com/v4/letter/n/94ad74/32.png) [@nobody](https://discourse.julialang.org/u/nobody)\
**Post date:** [October 18, 2017, 1:21pm UTC](https://discourse.julialang.org/t/hdf5-package-cant-open-hdf-file/6519/4 "2017-10-18T13:21:50Z")

</div>

Hi Guys

I’ll check that tools out, maybe tomorrow. I’m having problem with low  
internet connection. Thank you so much.

---

<div class="post-metadata">

**Author:** ![Hassan\_Sheidaee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hassan_sheidaee/32/7883_2.png) [@Hassan\_Sheidaee](https://discourse.julialang.org/u/Hassan_Sheidaee)\
**Post date:** [April 9, 2019, 9:25pm UTC](https://discourse.julialang.org/t/hdf5-package-cant-open-hdf-file/6519/5 "2019-04-09T21:25:12Z")

</div>

This video introduces a tool to get data from [MOD16A2 HDF Files](https://youtu.be/QMc3rSFuVCY)
