fhs / pyhdf

Python wrapper around the NCSA HDF version 4 library

Home Page:https://pypi.org/project/pyhdf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-hdf4 ppc64le support

kserradell opened this issue · comments

Hello

I'm trying to use the python-hdf4 in our brand new Power9 cluster. I have a simple script that opens a file and gets a variable which works well under x86_64 but crashes under ppc64le.

[PW9 ~/tests/error_pw9]$ python issue.py 
/esarchive/obs/nasa/myd04-col61/original_files/MYD04_L2/2007/003/MYD04_L2.A2007003.1100.061.2018037015137.hdf
Traceback (most recent call last):
  File "issue.py", line 26, in <module>
    vrbl=sds_obj.get()
  File "/software/rhel/7.5/ppc64le/POWER9/software/python-hdf4/0.9.1-foss-2018b-Python-2.7.15/lib/python2.7/site-packages/python_hdf4-0.9.1-py2.7-linux-ppc64le.egg/pyhdf/SD.py", line 1930, in get
    % (dim_sizes[n], n))
pyhdf.error.HDF4Error: get arguments violate the size (-889192448) of dimension 0

Is this architecture supported?

Thanks!

If it doesn't work in ppc64le, it's probably a bug.

Can you share your issue.py? Maybe print out sds_obj.info() also. It's going to be hard for me to debug this since I don't have access to a ppc64le machine.

Thanks for taking care of this issue @fhs.

from pyhdf.SD import SD,SDC

sds='AOD_550_Dark_Target_Deep_Blue_Combined'
hdffile=SD('/esarchive/obs/nasa/myd04-col61/original_files/MYD04_L2/2007/003/MYD04_L2.A2007003.1100.061.2018037015137.hdf',SDC.READ)

sds_obj=hdffile.select(sds)
add_offset=sds_obj.attributes()['add_offset']
scale_factor=sds_obj.attributes()['scale_factor']
fill_value=sds_obj.attributes()['_FillValue']

vrbl=sds_obj.get()

Here you can download the file.

Thanks!

It looks like a 203x135 image, but the first dimension is -889192448 instead of 203 for some reason.

Did you try accessing the data from the C API, using libhdf4 directly?

I wasn't able to reproduce the issue in qemu/ppc64le/ubuntu 18.04. 🤔

Did you try accessing the data from the C API, using libhdf4 directly?

No, I didn't.

I wasn't able to reproduce the issue in qemu/ppc64le/ubuntu 18.04. 🤔

Don't worry. We are having some issues with this machine. Thanks for taking a look.