Re: ROT is ROTTEN [message #28079] |
Tue, 20 November 2001 22:32  |
Wayne Landsman
Messages: 117 Registered: January 1997
|
Senior Member |
|
|
>
> ROT is bad. Can it be fixed? Is there a (fast) alternative?
The easiest alternative is to use the intrinsic ROTATE function, which is
specifically designed to deal with rotations of multiples of 90 degress.
A more subtle alternative is to add the MISSING keyword when using the ROT()
function, e.g.
print, total(rot(a,270,/interp, MISSING = !VALUES.F_NAN))
and you will find that there are values flagged as "missing". This is
because unless the rotation is exactly a multiple of 90 degrees, then there
will be subpixels in the output array for which there are no corresponding
values to interpolate in the input array. Instead of extrapolating,
these pixels get flagged as "missing" and the values returned by ROT() are
not to be trusted. (Exactly which pixels get flagged as missing depends
on the roundoff error.)
This question has come up before here -- perhaps RSI should modfiy ROT() so
that it calls ROTATE when the user supplies an exact integer mulitple of 90
degrees.
Wayne Landsman landsman@mpb.gsfc.nasa.gov
P.S. I would also like a keyword to ROT() to control the output dimensions
e.g. ftp://idlastro.gsfc.nasa.gov/landsman/idl/rot.pro
|
|
|