EnesYildirim / netcdf4-python

Automatically exported from code.google.com/p/netcdf4-python
Other
0 stars 0 forks source link

Runtime Error: Invalid Argument #143

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Loading the .nc file
2.
3.

What is the expected output? What do you see instead?
Map with daily precip

What version of the product are you using? On what operating system?
1.01 win-32 py 2.7

Please provide any additional information below.

This is the error:

Traceback (most recent call last):
  File "C:/Python27/temp.py", line 10, in <module>
    nc = NetCDFFile('C:\Python27\nws_precip_conus_20120810.nc')
  File "netCDF4.pyx", line 1375, in netCDF4.Dataset.__init__ (netCDF4.c:16454)
RuntimeError: Invalid argument

Original issue reported on code.google.com by KscottW...@gmail.com on 9 Oct 2012 at 12:22

GoogleCodeExporter commented 8 years ago
Can't reproduce this here

>>> from netCDF4 import Dataset
>>> f = Dataset('nws_precip_conus_20120810.nc')

>>> print f
<type 'netCDF4.Dataset'>
root group (NETCDF3_CLASSIC file format):
    dimensions: hrapy, hrapx, latlong, dates
    variables: amountofprecip, lat, lon, true_lat, true_lon, timeofdata, timeofcreation, hrap_xor, hrap_yor
    groups: 

I got the file from http://water.weather.gov/precip/p_download_new/2012/08/10/.

Christoph - would you mind trying this with the py27 windows version?

I wonder if it has to do with the way windows paths are handled - what if you 
try it in the directory that the file is in (so you can simply do nc = 
NetCDFFile('nws_precip_conus_20120810.nc'))?

Original comment by whitaker.jeffrey@gmail.com on 9 Oct 2012 at 2:28

GoogleCodeExporter commented 8 years ago
There's a newline character, '\n', in 
'C:\Python27\nws_precip_conus_20120810.nc'. Try 
r'C:\Python27\nws_precip_conus_20120810.nc' or 
'C:/Python27/nws_precip_conus_20120810.nc'. Works for me.

Original comment by cjgoh...@gmail.com on 9 Oct 2012 at 3:47

GoogleCodeExporter commented 8 years ago
Good catch Christoph - thanks.

Original comment by whitaker.jeffrey@gmail.com on 9 Oct 2012 at 4:02

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 7 Mar 2013 at 11:45