pysat / pysatCDF

Python reader for NASA CDF file format
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

Error loading the file #3

Closed talesa closed 7 years ago

talesa commented 7 years ago

Hi!

I'm encountering an error when loading a file using pysatCDF.CDF(filename): ValueError: failed to create intent(cache|hide)|optional array-- must have defined dimensions but got (0,256,)

I'm on MacOS, using python 3.5.

It seems like a fortrany error and I have no idea how to debug this, any hints/advice?

Could it be related to the fact that I am using libgfortran.4.dylib instead of libgfortran.3.dylib?

Full traceback:

ValueError                                Traceback (most recent call last)
<ipython-input-24-b7e18e1842cf> in <module>()
----> 1 cdf = pysatCDF.CDF(filename)

/Users/adamg/.virtualenvs/py35/lib/python3.5/site-packages/pysatCDF/_cdf.py in __init__(self, fname)
     71             self.inquire()
     72             # get all attribute info
---> 73             self._read_all_attribute_info()
     74             # get z variable info, basic stats on the variables
     75             self._read_all_z_variable_info()

/Users/adamg/.virtualenvs/py35/lib/python3.5/site-packages/pysatCDF/_cdf.py in _read_all_attribute_info(self)
    343         num = copy.deepcopy(self._num_attrs)
    344         fname = copy.deepcopy(self.fname)
--> 345         out = fortran_cdf.inquire_all_attr(fname, num, len(fname))
    346         status = out[0]
    347         names = out[1].astype('U')

ValueError: failed to create intent(cache|hide)|optional array-- must have defined dimensions but got (0,256,)
rstoneback commented 7 years ago

Thanks for reporting the issue. It could be related to the use of a different fortran library. I'll give the fortran code a once over in coming week.

rstoneback commented 7 years ago

Hi talesa,

So I haven't been able to reproduce your error yet. I've installed the latest gcc with libgfortran.4.dylib but I am still able to load CDF files. Does pysatCDF pass unit tests on your system? Can you try nosetests -vs pysatCDF ? Thanks.

rstoneback commented 7 years ago

A new version was released to pypi that builds on individual systems, reducing any possible leaks of my own build environment.