[SciPy-user] StandardError: 'NoneType' object has no attribute '_o'

sandric ionut sandricionut at yahoo.com
Wed Sep 5 12:42:47 EDT 2007


Hi: 
I am using Gdal 142 version on Windows XP sp2 with Numeric-24.2, SciPy 0.5.2.1, numpy 1.0.3.1. for Python 2.4. 
I want to use genericfunctions from scipy.ndimage. I have tried with the example provided in numarray users' manual release 1.5: 
>>> def fnc(iline, oline): 
... oline[...] = iline[:-2] + 2 * iline[1:-1] + 3 * iline[2:] 
... 
>>> print generic_filter1d(a, fnc, 3) 
[[ 3 8 14 17] 
[27 32 38 41] 
[51 56 62 65]] 

Everything works OK and I get the proper result, but when I try to use gdalnumeric to save the array to a image format (tif for example, or any other format supported by gdal) I get the following error: 

  File "C:\Python24\Lib\site-packages\gdalnumeric.py", line 123, in SaveArray 
    return driver.CreateCopy( filename, OpenArray(src_array,prototype) ) 
  File "C:\Python24\Lib\site-packages\gdal.py", line 592, in CreateCopy 
    target_ds = _gdal.GDALCreateCopy( self._o, filename, source_ds._o, 
StandardError: 'NoneType' object has no attribute '_o' 

How can I save an array into a image format supported by Gdal
I don't know what I do wrong

Thank you 

Ionut


      ____________________________________________________________________________________
Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20070905/e6c1525c/attachment.html>


More information about the SciPy-User mailing list