[Numpy-discussion] Problems with Numeric

Ali Santacruz amsd2013@yahoo....
Sun Jun 17 11:57:04 CDT 2007


Thank you very much Chuck for your help.

Regards,

Ali S.


----- Mensaje original ----
De: Charles R Harris <charlesr.harris@gmail.com>
Para: Discussion of Numerical Python <numpy-discussion@scipy.org>
Enviado: domingo, 17 de junio, 2007 10:25:01
Asunto: Re: [Numpy-discussion] Problems with Numeric



On 6/16/07, Ali Santacruz <amsd2013@yahoo.com> wrote:


Hi dear
list, 



I am designing an application that uses GDAL (which seems to bind to Numeric) to
read an image and convert it to an array. The code runs without problem in the
console, then I compile it (apparently without problems), but when I try to
launch the application, it fails and the next error appears in the .log:


 


Traceback
(most recent call last):


  File "ViewGdal_0.0-1.py", line 10,
in ?


  File "gdal\__init__.pyc", line 11,
in ?


  File "gdal\gdalnumeric.pyc", line
85, in ?                     #from Numeric import *


  File "Numeric.pyc", line 93, in ?                                 #from
Precision import *


  File "Precision.pyc", line 26, in ?                                #_code_table
= _fill_table(typecodes)


  File "Precision.pyc", line 23, in
_fill_table                   #table[key] = _get_precisions(value)


  File "Precision.pyc", line 18, in
_get_precisions          


TypeError:
data type not understood


 


This refers
to the next in Precision.py in Numeric:


 


typecodes =
{'Character':'c', 'Integer':'1sil', 'UnsignedInteger':'bwu', 'Float':'fd',
'Complex':'FD'}


def
_get_precisions(typecodes):


    lst = []


    for t in typecodes:


        lst.append( (zeros( (1,), t
).itemsize()*8, t) )                    #this is line 18


    return lst 


 


As far as I
understand (I've been working with Python for just a couple of months), there
is a problem with the typecodes. What can I do to solve this problem?


 


I've not
found a version of GDAL that binds to Numpy. I am using GDAL from hobutools (v.
1.75), Numeric v. 24.2, Python 2.4.3 on WinXP.




Looks like GDAL supports numpy

These facilities have evolved somewhat over time. In the past the
package was known as "Numeric" and imported using "import Numeric". A
new generation is imported using "import numpy".
Currently the old generation bindings only support the older Numeric
package, and the new generatio bindings only support the new generation
numpy package.  They are mostly compatible, and by importing gdalnumeric you will get whichever is appropriate to the current bindings type. 




I would look for a package with a more recent version of GDAL that supports numpy. Apart from that, I can't help you.

Chuck





_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion






__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
Regístrate ya - http://correo.espanol.yahoo.com/ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20070617/f83d0bc3/attachment-0001.html 


More information about the Numpy-discussion mailing list