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

Home » Public Forums » archive » Finding the index of the median
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 the index of the median [message #7345 is a reply to message #7268] Wed, 30 October 1996 00:00 Go to previous messageGo to previous message
meron is currently offline  meron
Messages: 51
Registered: July 1995
Member
In article <32769981.73B9@cassini.lpl.arizona.edu>, Dean Schulze <schulze@cassini.lpl.arizona.edu> writes:
> Joseph M. Zawodny wrote:
>>
>> Let's try this again: There may be more than one value which
>> equals the median value. Therefore the question you ask here
>> makes no sense at all without some additional information by
>> which to prioritize or otherwise sort those values which are
>> equal to the median. Having said that, you should use the
>> where function to find pointers to the median values and then
>> perform some other task or assessment on those values.
>>
>> Maybe we would all understand your question better if you tell
>> us which element in the following arrays is your "median element"
>>
>> [1,2,2,3]
>>
>> [1,2,2,2,3]
>>
>> One of the above arrays must have at least two "median elements"
>> by your definition. How will you choose?
>>
>> Or am I just dense?
>
> No, but a part of my original question has been left out. I
> said that there are two arrays, one containing data and another
> containing noise (noise is not just dependant on N in this case).
> I can let MEDIAN() return any of the equivalent median values
> in the data array it chooses, but I need to know the location of
> the one it chooses so I can get the corresponding value out of
> the noise array.
>
> Consider a CCD with a temperature gradient that is known or
> can be modeled. There may be several pixels that have the median
> value from different points on the CCD, and each of those points
> would have a different dark current value due to the T gradient.
> In order to determine the S/N ratio of the value returned by MEDIAN()
> I need to know the location of that pixel to get the right value
> from a noise array (or get the right value of T from a T array).

I'm afraid you still don't quite understand the way median works. For
the case mentioned above (by Zavodny) of the array [1,2,2,2,3], MEDIAN
will return 2, but this value doesn't correspond to a specific
location. You cannot ask "which of the three 2s was returned?", this
is meaningless. The most you can ask is "at which location the value
equals the median value?" This you'll get with

WHERE(array eq MEDIAN(array))

Mati Meron | "When you argue with a fool,
meron@cars.uchicago.edu | chances are he is doing just the same"
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A Nice (undocumented?) feature for PS plotting
Next Topic: Slicer & Colors

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

Current Time: Fri Oct 10 11:31:37 PDT 2025

Total time taken to generate the page: 0.56214 seconds