Re: Using MIN on arrays : Exorcising loops? [message #27054 is a reply to message #27052] |
Fri, 05 October 2001 09:01   |
Liam E. Gumley
Messages: 378 Registered: January 2000
|
Senior Member |
|
|
Dick Jackson wrote:
>
> "Andrew Cool" <cooladjc@chariot.net.au> wrote in message
> news:3BBD96E8.B1329549@chariot.net.au...
>> Hi all,
>>
>> I have three slabs of data [640,500] held as an array [640,500,3].
>>
>> I need to populate another 2D array [640,500] with the minimum
>> value for every x,y coordinate found in the first 3 arrays.
>>
>> [...]
>>
>> There's gotta be a better way, surely? Some syntax variant on MIN?
>
> It sure would be nice if MIN and MAX had a Dimension parameter, just like
> TOTAL has. It would be even nicer if it were coming in 5.5, to be released
> Any Day Now, wouldn't it? Too bad that anyone who would know about this
> would be bound by a non-disclosure agreement. ;-|
In other words, it sure would be nice if IDL could do something like
this:
IDL> a = indgen(2, 5)
IDL> print, a
0 1
2 3
4 5
6 7
8 9
IDL> print, min(a, dim=2)
0 1
IDL> print, min(a, dim=1)
0 2 4 6 8
where the DIM keyword is the dimension number, starting at dimension 1.
Maybe this will be supported by MIN and MAX in the not too distant
future ;-)
While we're on the topic of future releases, here's a bit more
information about multi-threading in IDL 5.5:
http://www.rsinc.com/pr/detail.cfm?PressReleaseID=55
Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
|
|
|