Array assignment issue

From: Zach DuFran <zdufran_at_nyahnyahspammersnyahnyah>
Date: Wed, 10 Sep 2008 16:47:15 -0500

I am trying to assign values from a 2-d array of floats to a netcdf variable of the same dimensions and dimension size. Whenever I try to do the assignment in one line, I get the following error:
NIOError: type or dimensional mismatch writing to variable (foo_bar)
Traceback (most recent call last):
  File "reassign.py", line 33, in <module>
    var_NC[:,:] = foo[:,:]
SystemError: error return without exception set

However, if I assign the data inside 2 loops, it works (albeit very slowly for large arrays). The attached script illustrates the problem, as well as the alternative method which works. Why won't the quicker method of one line assignment work?

I am running Python v. 2.5.2 and PyNgl v. 1.2.0 on Linux i686.

Thanks for the help-
Zach DuFran

_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

Received on Wed Sep 10 2008 - 15:47:15 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 01 2008 - 09:47:33 MDT