Re: Crazy use of MAX function. [message #15929] |
Sun, 27 June 1999 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Grady Daub (gadZOOKS8371@garnet.acns.fsuMMER.edu) writes:
> I have data to be plotted. I want to create YRANGE based on max/min of
> the data. The problem is that the maximum is always lower than "9999",
> which is used to indicate "bad" data.
>
> Without having to replace all 9999's with, say, zero , using MAX to find
> the true maximum and then putting the 9999's back where they were...
>
> How do I find a maximum/minumum value less/greater than a certain value?
>
> MAX(data lt 9999) doesn't work. :-(
>
> Ugh, I just thought of a way:
>
> MAX(data(WHERE(data LT 9999)))
>
> Is this the only way, or, does IDL already have something that does this
> task?
How about this:
index = Where(data EQ 9999, count)
IF count GT 0 THEN data[index] = !Values.F_NAN
Plot, data
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|