comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Using MIN on arrays : Exorcising loops?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Using MIN on arrays : Exorcising loops? [message #27017] Mon, 08 October 2001 12:58 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
andrew cool <andrew.cool@dsto.defence.gov.au> writes:

> Martin Downing wrote:
>> For a simple case like this, why not just use:
>> Min_array = data_array[*,*,0] < data_array[*,*,1] < data_array[*,*,2]
>>
>> Martin
>
> G'day Martin,
>
> Now that I'm back at work, I regret to advise that your approach
> doesn't work. Craig's, however, does :-
>
>> data_array = Fltarr(640,500,NZ)
>> Min_array = data_array(*,*,0)
>>
>> for i = 1, NZ-1 do $
>> min_array = min_array < data_array(*,*,i)
>
>
> It seems that you need to have an initial test condition before you
> start applying those < operators. Not being a math-head, that might
> not be the right jargon to describe it.

I would have thought both approaches would have worked, and been about
the same speed. That is curious. The advantage to my approach is
that NZ, the size of the third dimension, can be variable; and the
advantage of Martin's is that it all fits one one line (but the number
is hardcoded).

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: CURSOR question
Next Topic: Re: Possibly O/T: printing IDL code in colour -> CAN DO!!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:08:11 PDT 2025

Total time taken to generate the page: 0.00409 seconds