Re: Problem with PyNIO

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 26 2012 - 12:15:39 MDT

Hi Mathieu,
Actually thanks for pointing out that the INSTALL file and the online documentation have not been updated properly. We will try to correct this as soon as possible. In fact, HDF4 is now also optional: NetCDF is now the only required format for PyNIO. As of 1.4.1 you can see what what optional formats your PyNIO instance supports using:

>>> import Nio
>>> Nio.__version__
'1.4.1'
>>> Nio.__formats__
{'hdfeos5': 1, 'netcdf4': 1, 'hdf4': 1, 'hdf5': 1, 'shapefile': 1, 'grib2': 1, 'hdfeos': 1, 'opendap': 1}

In order to build in HDF4 support you must set the environment variable HAS_HDF4. If your installed HDF4 library is in a different location from other formats that your PyNIO version already supports, then you also need to set HDF4_PREFIX to the location. Look at the comments at the top of setup.py for a more complete explanation of the build process.
Sorry for the misleading documentation.
 -dave

On Oct 25, 2012, at 8:28 AM, Mathieu Dutour wrote:

> Dear all,
>
> I am trying to access to hdf4 files by using PyNIO
> and unfortunately it does not work.
>
> What I did was install Python2.7.3 in my home directory
> and compile everything together.
>
> The error that I get is
> -----------------------------------
> >>> Nio.open_file('data.h4')
> fatal:An internal error has occurred. The file format requested does not appear to be supported, could not open (data.h4)
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "/home/dutour/opt/Python-2.7.3/lib/python2.7/site-packages/PyNIO/Nio.py", line 607, in open_file
> file = _Nio.open_file(filename,mode,options,history,format)
> NIOError: Unable to open file
> >>> print Nio.__version__
> 1.4.1
> >>>
> ---------------------------------------
> But if the format hdf4 is not supported then there should be some error appearing during
> the compilation because the INSTALL file and the web site are adamant that HDF4 is
> not an option.
> And the file appears to be hdf4:
> --------------------
> dutour@dutour-Satellite-L655:~$ file data.h4
> data.h4: Hierarchical Data Format (version 4) data
> -------------------
>
> Best,
>
> Mathieu
>
> _______________________________________________
> pyngl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Fri Oct 26 12:15:51 2012

This archive was generated by hypermail 2.1.8 : Thu Nov 01 2012 - 09:04:53 MDT