Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raster image API is not implemented #12

Open
jefflapierre6 opened this issue Feb 13, 2018 · 1 comment
Open

Raster image API is not implemented #12

jefflapierre6 opened this issue Feb 13, 2018 · 1 comment

Comments

@jefflapierre6
Copy link

jefflapierre6 commented Feb 13, 2018

TRMM_LIS_SC.04.3_2015.001.zip
I will start by saying that this is my first github post, so I apologize for my naivety, especially if this is not the right place for this post.

I am writing to see if anyone can possibly provide some insight on a problem I am having with loading some HDF4 data using python. I thought I had installed the python-hdf4 library as well as all the dependencies correctly (I didn’t get any errors). I followed the install instruction on the python-hdf4 page, namely:

apt-get install python-dev python-numpy libhdf4-dev -y
pip install python-hdf4

Seemed fairly straightforward. However, when I load in the data, using

from pyhdf.SD import SD, SDC
Hdf = SD(FileName, SDC.READ)

, the dataset is empty. I have checked in Matlab that there is actually data in the files.

I assume it has something to do with the dependencies, but since I am not getting any errors, it may be difficult to diagnose. I have tried uninstalling and reinstalling all of the above libraries. I hope I am missing something.

I have attached an example file so that you can test it yourself.

Thank you in advance for your help.

@fhs
Copy link
Owner

fhs commented Mar 21, 2018

The file contains a raster image, not scientific data (SD). It doesn't look like pyhdf provides the raster image API from the C library. See https://support.hdfgroup.org/release4/examples/ug-examples.html#gr

$ unzip TRMM_LIS_SC.04.3_2015.001.zip 
Archive:  TRMM_LIS_SC.04.3_2015.001.zip
  inflating: TRMM_LIS_SC.04.3_2015.001.97563  
$ file TRMM_LIS_SC.04.3_2015.001.97563
TRMM_LIS_SC.04.3_2015.001.97563: Hierarchical Data Format (version 4) data
$ hdp dumpsds -h TRMM_LIS_SC.04.3_2015.001.97563
File name: TRMM_LIS_SC.04.3_2015.001.97563 
$ hdp dumpgr -h TRMM_LIS_SC.04.3_2015.001.97563
File name: TRMM_LIS_SC.04.3_2015.001.97563 

	 Image  Name = Raster Image #0
	 Index = 0
	 Type= 8-bit unsigned char
	 width=720; height=500
	 Ref. = 509
	 ncomps = 1
	 Interlace mode= PIXEL
	 Palette: 3 components; 256 entries
	 Compression method = RLE
	 Number of attributes = 0
$

@fhs fhs changed the title pyhdf not loading HDF4 data correctly Raster image API is not implemented Mar 21, 2018
@fhs fhs added the enhancement label Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants