Re: Returning ARRAYs from functions? [message #29783] |
Wed, 13 March 2002 16:15  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
"R.A" <roa@aber.ac.uk> writes:
> I have been rewriting some software in IDL5.4 passed onto me
> by a former colleague.
> Essentially the function is required to correct an array of values
> by applying a polynomial and then return the corrected array.
>
> I have noted this doesnt work as I have stated although I
> had the idea IDL could pass any dimension array to a
> function and return the array from the function.
>
> What seems to have been done is to create a structure from
> the array passed and return the structure.
>
> Is what I have said correct? ... that you need to pass data arrays
> from IDL functions as data structures as arrays cannot be
> passed??
Yes, arrays can be passed to and from IDL functions. You said it
"doesn't work" but that is not enough to really make a good diagnosis.
In addition to the other suggestions so far, I would offer another
possibility. There are some cases where an array can get truncated,
especially when multiplying quantities of different dimensions (as
might be the case with a polynomial multiplication). My suggestion is
to trace through your procedure and make sure the dimensions remain
what you think they should be.
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|