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

Home » Public Forums » archive » python bug??
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
python bug?? [message #91694] Thu, 13 August 2015 08:18 Go to next message
Dae-Kyu Shin is currently offline  Dae-Kyu Shin
Messages: 25
Registered: February 2015
Junior Member
pro test1
x = dindgen(3)*3
y = dindgen(3)*2
z = dindgen(3, 3)


python.run, 'from scipy import interpolate'
f = python.interpolate.interp2d(x, y, z)

newx = [1,2,3d]
newy = [4, 5, 6d]
print, f(newx, newy)
end

The test1.pro is not working
The error message is

% Compiled module: TEST1.
% Loaded DLM: PYTHON27.
% Python: Multiple array subscripts are not allowed.
% Execution halted at: TEST1 12 D:\IDL_package\IDLWorkspace85\Default\test1.pro
% $MAIN$


But then code was working when i copy and paste the code in command line.
Re: python bug?? [message #91705 is a reply to message #91694] Thu, 13 August 2015 14:31 Go to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
On Thursday, August 13, 2015 at 9:18:51 AM UTC-6, Dae-Kyu Shin wrote:
> pro test1
> x = dindgen(3)*3
> y = dindgen(3)*2
> z = dindgen(3, 3)
>
>
> python.run, 'from scipy import interpolate'
> f = python.interpolate.interp2d(x, y, z)
>
> newx = [1,2,3d]
> newy = [4, 5, 6d]
> print, f(newx, newy)
> end
>
> The test1.pro is not working
> The error message is
>
> % Compiled module: TEST1.
> % Loaded DLM: PYTHON27.
> % Python: Multiple array subscripts are not allowed.
> % Execution halted at: TEST1 12 D:\IDL_package\IDLWorkspace85\Default\test1.pro
> % $MAIN$
>
>
> But then code was working when i copy and paste the code in command line.

Try adding:
compile_opt idl2
at the top of your test1 procedure.

IDL will automatically add this at the command line if you use a static method, but it won't do that for procedures or functions.

Cheers,
Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: putting .txt files in a structure
Next Topic: multi-core computing in IDL

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

Current Time: Wed Oct 08 07:14:26 PDT 2025

Total time taken to generate the page: 0.00436 seconds