I have a compressed HDF file (HDF.Z) and would like to open it like that:
from subprocess import Popen, PIPE
f = Popen(['zcat', 'myfile.HDF.Z'], stdout=PIPE).stdout
In order to get the data I need to use pyhdf:
from pyhdf.SD import SD, SDC
mydata = SD(f, SDC.READ)
However, this results in an error message:
*** TypeError: coercing to Unicode: need string or buffer, file found
Is there a way to open this file as a buffer to read it in? Btw: what is a buffer?