[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: array dimensions

"Richard G. French" wrote:

> David is the master of keywords - I've used SIZE all these years without
> knowing that there was a /DIMENSIONS keyword. I guess the only way to
> know about these things is to read through the documentation over and
> over again and take notes on potentially useful keywords and options.

True. And repeat that for every new version of IDL.

> Which brings me to my question - does anyone out there have a favorite
> keyword on a routine that we mere mortals might not know about, but
> which
> might make our lives much easier? Any suggestions welcome, except for

MIN() has the MAX keyword so you can compute both values in one step.
And it also allows a second parameter (I wonder why they didn't make
that a keyword) to return the (first) position the the minimum:

IDL> x = sin( findgen( 300 ) / 100 ) ; create array
IDL> print, where( x eq max( x ) )
; another variant
IDL> tmp = max( x, pos ) & print, pos
; and yet another:
IDL> print, !c

  Alex Schuster     Wonko@weird.cologne.de          PGP Key available