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

Home » Public Forums » archive » Re: finding array subscripts of minimum value of 3 dim. fltarr
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: finding array subscripts of minimum value of 3 dim. fltarr [message #12786] Thu, 10 September 1998 00:00 Go to previous message
Jonas is currently offline  Jonas
Messages: 23
Registered: May 1998
Junior Member
Jens Redemann skrev i meddelandet <35F6EF28.699D@cisk.atmos.ucla.edu>...
> Hi everybody,
>
> can anybody key me in on the most efficient way of finding
> the subscripts of the minimum value of a three-dimensional float
> array?
> What is the exact numbering convention behind the single-subscript
> that the min(array) function returns?
> Hope this is not too trivial of a question.
>
> Thanks in advance,
>
> Jens

Hi jens
Here's a few rows of code to find out the position of the minimum absolute
value of a complex 3D array called compl_kspace_vol. Hope it helps (and that
it is correct). Note that you have to use data types that can handle numbers
as large as "minpos" everywhere (almost) in order to get the mods and
divisions right.
Sincerely
Jonas


print, 'finding min'
mincompl=min(abs(compl_kspace_vol), minpos)
print, 'minimum value of 3D matrix:', mincompl
print, minpos
XYpos=minpos mod (long(xsize)*long(ysize))
Zpos = minpos/(long(xsize)*long(ysize))
Xpos = xypos mod xsize
Ypos = xypos/xsize
print, 'Position of minimum value:'
print, 'xpos=', xpos
print, 'ypos=', ypos
print, 'slice=', zpos
[Message index]
 
Read Message
Read Message
Previous Topic: Re: [Q] extracting value from a structure ...
Next Topic: Current Idl spec results: for Alpha-NT4

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

Current Time: Fri Oct 10 20:41:21 PDT 2025

Total time taken to generate the page: 0.55934 seconds