comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Slither with matplotlib.mlab.PCA makes IDL crash
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Slither with matplotlib.mlab.PCA makes IDL crash [message #88851] Wed, 25 June 2014 07:18 Go to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi all,

I am using the Slither dlm (python3.3, linux_x64). I know this is not
precisely an IDL question, but does anyone have an idea how to solve the
following problem?

The matplotlib.mlab.PCA function
(http://matplotlib.org/api/mlab_api.html#) works fine under my python
distrib.

I wanted to call it from IDL but this makes IDL chrash quite badly.

After several tests I noticed that it is not in the linkage between IDL
and python but rather in python (called from IDL) that the problem comes
from. To come to this conclusion, I made a small script.

The following works fine in python3:


import matplotlib.mlab as mlab
import numpy as np
import random as r
n = 50
a = np.array([r.random() for n in range(n)]).reshape(1,n)
b = np.array([r.random() for n in range(n)]).reshape(1,n)
r = np.concatenate((a,b), 0).transpose()
p = mlab.PCA(r)
[/python code]

But the exact same called called from with IDL with the exec() syntax
crashes:

py = pyimport('__main__')

py->exec, 'print(sys.version)'
; LOOKS OK: 3.3.2+ (default, Feb 28 2014, 00:56:04)

py->exec, 'import matplotlib.mlab as mlab'
py->exec, 'import numpy as np'
py->exec, 'import random as r'
py->exec, 'n = 50'
py->exec, 'a = np.array([r.random() for n in range(n)]).reshape(1,n)'
py->exec, 'b = np.array([r.random() for n in range(n)]).reshape(1,n)'
py->exec, 'r = np.concatenate((a,b), 0).transpose()'
py->exec, 'p = mlab.PCA(r)' ; it crashes here

Any hint on where I should look at first?

Thanks!

Fabien
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CONTOUR keywords PATH_INFO and PATH_XY
Next Topic: question about 'Unable to allocate memory: to make array error' message ( and I think there is enough memory)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 11:33:15 PDT 2025

Total time taken to generate the page: 0.00520 seconds