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

Home » Public Forums » archive » Re: How to spot maximum x value AND corresponding y value?
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: How to spot maximum x value AND corresponding y value? [message #69826 is a reply to message #69824] Thu, 18 February 2010 04:19 Go to previous messageGo to previous message
M. is currently offline  M.
Messages: 2
Registered: February 2010
Junior Member
On Feb 16, 4:26 pm, pp <pp.pente...@gmail.com> wrote:
> On Feb 16, 10:23 am, "M." <markus_men...@yahoo.de> wrote:
>
>> I have an input file (ascii) containing coordinate data (three
>> columns; x, y, z).
>> I want to compute a vector from one point to another. I know the
>> vector should go from the maximum x value to the minimum y value (or
>> vice versa). I took the FLOAT function to find out the min and max
>> values. But how can I find out the corresponding x and y values for my
>> y_min and x_max values?
>
> Your question is not very clear, but I am guessing that what you want
> is to find out which points have the maximum/minimum x and y values.
> Which would be something like:
>
> x_max_val=max(x,x_max_ind,min=x_min_val,subscript_min=x_min_ ind)
> y_max_val=max(y,y_max_ind,min=y_min_val,subscript_min=y_min_ ind)
>
> Which would give you the maximum value of x in x_max_val and the index
> where that occurs in x_max_ind. That is,
> x_max_val==x[x_max_ind]==max(x).


Uh, that's true. The question was really not clear. I'm not yet firm
with scientific terms and IDL language...
But you guessed right and helped me a lot. What I need are two points
in a coordinate system, one point has the the maximum x value and one
point has the minimum y value. With your suggestion I now know where
the min or max values are located in my array. Good.
But:
My data (ascii) is build like a table (3 columns - 1st col = x
coordinates; 2nd col = y coordinates; 3rd col = z values and about 1.5
Million rows each column). So I know, with your suggestion, that my
x_max_val let's say is located in the 7th row in the 1st col. BUT, how
can I find out which y value (2nd col) is in the 7th row. Since these
are coordinates I need both the maximun x value and where it occurs on
the y axis - that is what I mean with corresponding value. Is there an
order like: "result = (y) value in the 2nd col which is located where
x_max_val occurs" OR "result = value in the 2nd col which is located
at 'x_max_ind'" -->see above .
I tried to find it out by myself, but I just don't know the right
command I think.
Can anybody understand what I mean and help me? Thanks.
Markus

P.S. here is how my array looks:

array = FLTARR(3, n)
array[0,*] = 1st col with x values from ascii text file
array[1,*] = 2nd col with y values from ascii text file
array[2,*] = 3rd col with z values from ascii text file
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Open URL in external browser
Next Topic: Re: Coyote Cojones

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

Current Time: Wed Oct 08 17:51:21 PDT 2025

Total time taken to generate the page: 0.00224 seconds