Re: atan in IDL 5.5 [message #31049] |
Tue, 04 June 2002 09:13  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
Zoe Dent <zoe@aurora.york.ac.uk> writes:
> --------------1F130981AB8092C521F2309C
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> I'm having problems with the 'atan' function in IDL 5.5. I have a
> program which reads in an array of complex numbers, so an array of
> single numbers should be produced, but in fact another complex array os
> produced. At the command-line the atan of a set of complex numbers
> produces a single number. I have disabled the multi-threading option
> with no effect. I'd appreciate any advice on this matter.
Right, I used to rely on this too, but RSI made this change pretty
obvious in their release notes, as the others have pointed out. It's
a pity since the original ATAN behavior will be faster than the new
way to do it. That's why I use the following utility function,
ZCOMPARG. I set it and forget it.
Craig
function zcomparg, z
forward_function atan, real_part, imaginary
common zcomparg_common, atanver
if n_elements(atanver) EQ 0 then begin
if !version.release LT '5.5' then atanver = 1 $
else atanver = 2
endif
if atanver EQ 1 then return, atan(z) $
else return, atan(imaginary(z), real_part(z))
end
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|