Due to the current gap in continued funding from the U.S. National Science Foundation (NSF), the NSF Unidata Program Center has temporarily paused most operations. See NSF Unidata Pause in Most Operations for details.
Hello netcdf-experts, currently i am working on a data analysis program which requires reading different netcdf files (version 3 and 4). To keep the installation requirements slim (the python script should run on various machines) it would be desirable to use as few libraries as possible. If the Scientific.IO.NetCDF library is used everything works fine. With the netCDF4 python library (version 1.1.5), the following error occurs: Traceback (most recent call last): File "advection.py", line 157, in <module> profile = wp_advect("wpl_20150602_002408.nc") File "advection.py", line 143, in __init__ self.u_vel = self.f.variables["WP_U"][:] File "netCDF4.pyx", line 3097, in netCDF4.Variable.__getitem__ (netCDF4.c:42713) File "netCDF4.pyx", line 3118, in netCDF4.Variable._toma (netCDF4.c:43134) ValueError: invalid literal for float(): 3.402823466e+38F The relevant code snippet: def __init__(self, filename): """ """ self.filename = filename #self.f = netCDF4.Dataset(filename, 'r', format='NETCDF4_CLASSIC') self.f = NetCDF.NetCDFFile(filename, 'r') self.time_list = self.f.variables["Timestamp"][:] self.height = self.f.variables["WP_Height"][:] self.u_vel = self.f.variables["WP_U"][:] self.v_vel = self.f.variables["WP_V"][:] Thank you for your help. Kind regards Martin Radenz -- View this message in context: http://netcdf-group.1586084.n2.nabble.com/reading-netcdf-file-problem-with-float-conversion-tp7575845.html Sent from the NetCDF Group mailing list archive at Nabble.com.
netcdfgroup
archives: