cas3ymau3 / netcdf4-python

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

netCDF ID error #195

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected output? What do you see instead?
One month of data will process fine.  When enumerating to the next month, there 
is a "netCDF ID" error:

Traceback (most recent call last):
  File "/var/spool/uge/the_zcluster/compute-14-17/job_scripts/3840381", line 74, in <module>
    in_file = "WRFPRS_d01." + str(yr).rjust(4,'0') + str(mn).rjust(2,'0') + str(dy).rjust(2,'0') + "." + str(hr).rjust(2,'0') + "." + str(count).rjust(4,'0') + ".grb"
  File "netCDF4.pyx", line 2394, in netCDF4.Variable.__str__ (netCDF4.c:29335)
  File "netCDF4.pyx", line 2398, in netCDF4.Variable.__unicode__ (netCDF4.c:29441)
  File "netCDF4.pyx", line 2478, in netCDF4.Variable.dimensions.__get__ (netCDF4.c:30750)
  File "netCDF4.pyx", line 2433, in netCDF4.Variable._getdims (netCDF4.c:30102)
RuntimeError: NetCDF: Not a valid ID

What version of the product are you using? On what operating system?
Python 2.7.2
GCC 4.1.2 20080704 (Red Hat 4.1.2-51
x86_64 x86_64 x86_64 GNU/Linux

Please provide any additional information below.

Original issue reported on code.google.com by vgens...@gmail.com on 23 Aug 2013 at 12:44

GoogleCodeExporter commented 8 years ago
Looks like you're trying to open a GRIB file? (.grb extension).  That won't 
work.

Original comment by whitaker.jeffrey@gmail.com on 23 Aug 2013 at 1:02

GoogleCodeExporter commented 8 years ago
I am trying to open the file with pyNIO.  The first loop through the code works 
fine.  The second run through the loop gives an error. 

Original comment by vgens...@gmail.com on 23 Aug 2013 at 1:16

GoogleCodeExporter commented 8 years ago
pyNIO is distributed by NCAR.  This is the issue tracker for netcdf4-python.

Original comment by whitaker.jeffrey@gmail.com on 23 Aug 2013 at 1:44

GoogleCodeExporter commented 8 years ago
The code appears to be bringing an error due to netCDF4 (it is also being used 
in this program; see code).

Original comment by vgens...@gmail.com on 23 Aug 2013 at 1:45

GoogleCodeExporter commented 8 years ago
Are you trying to open a grib file with netcdf4-python?  pyNIO can open both 
netcdf and GRIB. netcdf4-python can only read netcdf.

Original comment by whitaker.jeffrey@gmail.com on 23 Aug 2013 at 1:48

GoogleCodeExporter commented 8 years ago
pyNIO reads in the file, and I am using netCDF4 to write out a netCDF file.  
There appears to be a memory leak somewhere.  I have cross-posted to pyNIO 
group. 

Original comment by vgens...@gmail.com on 23 Aug 2013 at 1:50

GoogleCodeExporter commented 8 years ago
I was able to solve the problem by omitting the use of netCDF4 and using pyNIO 
to write out the netCDF file.  There was an issue with using both programs at 
the same time. 

Original comment by vgens...@gmail.com on 23 Aug 2013 at 11:40

GoogleCodeExporter commented 8 years ago
Thanks for letting me know.  That's unfortunate, and shouldn't happen (I can't 
think of why it would.  Just out of curiosity, what happens if you reverse the 
order of the imports (import netCDF4 first)?

Original comment by whitaker.jeffrey@gmail.com on 23 Aug 2013 at 12:00

GoogleCodeExporter commented 8 years ago
Reversing the order of the imports still gives the same error. 

Original comment by vgens...@gmail.com on 23 Aug 2013 at 11:11

GoogleCodeExporter commented 8 years ago

Original comment by whitaker.jeffrey@gmail.com on 26 Feb 2014 at 2:04