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 #27043 is a reply to message #27036] Sun, 07 October 2001 16:25 Go to previous messageGo to previous message
Andrew Cool is currently offline  Andrew Cool
Messages: 219
Registered: January 1996
Senior Member
Martin Downing wrote:
>
> "Craig Markwardt" <craigmnet@cow.physics.wisc.edu> wrote in message
> news:on3d4yw86j.fsf@cow.physics.wisc.edu...
>>
>> Andrew Cool <cooladjc@chariot.net.au> writes:
>>
> .....
>
> Hi Andrew & Craig
>
> 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.

The use of the < operator has cut the time taken from about 1.03
seconds
for the double x,y loop to about 0.008 seconds using <, including the
initialisation statement Min_array = data_array(*,*,0).

I'm happy!

Cheers,

Andrew
[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 18:55:37 PDT 2025

Total time taken to generate the page: 0.00418 seconds