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

Home » Public Forums » archive » Using MIN on arrays : Exorcising loops?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Using MIN on arrays : Exorcising loops? [message #27061] Fri, 05 October 2001 04:18
A. D. & J.C. Cool is currently offline  A. D. & J.C. Cool
Messages: 16
Registered: February 2000
Junior Member
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.

At the moment my code loops something like this :-

data_array = Fltarr(640,500,3)
Min_array = Fltarr(640,500)

For x = 0,639 Do Begin
For y = 0,249 Do Begin
Min_array(x,y) = MIN(data_array(x,y,*))
End
End

There's gotta be a better way, surely? Some syntax variant on MIN?
Histogram even? ;-)

TIA,

Andrew Cool
Defence Science & Technology Organisation
Adelaide, Oz.
andrew.cool@dsto.defence.gov.au
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: the precision of PRINT and HELP statements
Next Topic: Intermittent plotting problem

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

Current Time: Wed Oct 08 11:45:25 PDT 2025

Total time taken to generate the page: 0.00412 seconds