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

Home » Public Forums » archive » Minimum/Maximum over a certain dimension
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
Minimum/Maximum over a certain dimension [message #4015] Thu, 20 April 1995 00:00 Go to next message
smd is currently offline  smd
Messages: 4
Registered: April 1995
Junior Member
Hi,


I use IDL v3.6.1a on a PC. I would like to find out if there is
a vectorized (fast) way of computing the minimum/maximum of an
array along a given dimension.

To explain, if A is a bytarr of size (2,30,40) and I wish
to compute the minimum along the first dimension, the result
should be a bytarr of size (30,40) in which each element is
the pointwise minimum of A(0,*,*) and A(1,*,*).

Such a feature is available for the TOTAL() function, but
is not available for MIN() or MAX(). Does anyone know how
to do this operation without using a FOR loop that goes
over all the elements. In the above example, the FOR loop
would have to extend over 30*40 = 1200 elements. I have
to deal with images that are of size 720 x 480 and this
takes enough computation time.


Thanks

Sandeep Dalal

------------------------------------------------------------
Philips Laboratories
345, Scarborough Road,
Briarcliff Manor, NY 10510

Email: smd@philabs.philips.com
------------------------------------------------------------
Re:Minimum/Maximum over a certain dimension [message #4073 is a reply to message #4015] Tue, 25 April 1995 00:00 Go to previous message
dudley is currently offline  dudley
Messages: 8
Registered: August 1993
Junior Member
smd@philabs.philips.com writes:

> To explain, if A is a bytarr of size (2,30,40) and I wish
> to compute the minimum along the first dimension, the result
> should be a bytarr of size (30,40) in which each element is
> the pointwise minimum of A(0,*,*) and A(1,*,*).

The above can be done by:
c=A(0,*,*)<A(1,*,*)

--
John Wesley Dudley II,Ph.D. dudley@shell.com
Sr. Research Physicist !{uupsi}!shell!dudley
Shell Exploration & Production Co. (713)245-7927
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Arrows in IDL
Next Topic: Some benchmarks

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

Current Time: Wed Oct 08 15:23:13 PDT 2025

Total time taken to generate the page: 0.00476 seconds