Re: IDL Astronomy Library: Some procedures doesn't work? [message #82513] |
Wed, 19 December 2012 10:05  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Wednesday, December 19, 2012 8:50:47 AM UTC-5, BlueSky wrote:
> IDL> psf_gaussian
> % Compiled module: PSF_GAUSSIAN.
> % Attempt to call undefined procedure/function: 'PSF_GAUSSIAN'.
> % Execution halted at: $MAIN$
For a long time I've felt that IDL gives a very confusing error message here. One sees the function compiled successfully, and then an immediate error message of "undefined procedure/function". I realize that one can have two distinct modules with the same name -- one a procedure and one a function. But it would be nice if the compilation message could say whether a procedure or function was compiled, e.g.
% Compiled function: PSF_GAUSSIAN.
and if the error message said whether it was a procedure or function call, e.g.
> % Attempt to call undefined procedure: 'PSF_GAUSSIAN'.
--Wayne
|
|
|
Re: IDL Astronomy Library: Some procedures doesn't work? [message #82514 is a reply to message #82513] |
Wed, 19 December 2012 06:03   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Nothingness writes:
> I have IDL and IDL Astronomy Library installed on server of my
> institute. Some procedures can be executed, like hastrom, ad2xy,
> correl_optimize, etc. However some others can't, like convolve,
> psf_gaussian, etc. Even though their locations are in the IDL paths
> and some of them (convolve and correl_optimize) are in the same
> directory. And they have the same permissions.
>
> Do you have any idea how to fix this?
Yes, call the procedures as procedures:
IDL> Junk
And call the functions as functions:
IDL> var = Junker()
Functions in IDL always return a value. You have to
provide a receptacle (variable) for the value of the
function to be returned in.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|
Re: IDL Astronomy Library: Some procedures doesn't work? [message #82693 is a reply to message #82514] |
Tue, 08 January 2013 06:18  |
Nothingness
Messages: 2 Registered: December 2012
|
Junior Member |
|
|
On Wednesday, December 19, 2012 10:03:29 PM UTC+8, David Fanning wrote:
> Nothingness writes:
>
>
>
>> I have IDL and IDL Astronomy Library installed on server of my
>
>> institute. Some procedures can be executed, like hastrom, ad2xy,
>
>> correl_optimize, etc. However some others can't, like convolve,
>
>> psf_gaussian, etc. Even though their locations are in the IDL paths
>
>> and some of them (convolve and correl_optimize) are in the same
>
>> directory. And they have the same permissions.
>
>>
>
>> Do you have any idea how to fix this?
>
>
>
> Yes, call the procedures as procedures:
>
>
>
> IDL> Junk
>
>
>
> And call the functions as functions:
>
>
>
> IDL> var = Junker()
>
>
>
> Functions in IDL always return a value. You have to
>
> provide a receptacle (variable) for the value of the
>
> function to be returned in.
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Hi David,
Thanks for the tips. The function psf_gaussian works properly when I input variables in, e.g. psf = psf_gaussian([12,23,19.2],npixel=50).
D
|
|
|