Re: difficulty using "linterp" command - need help making loop to exclude a value yet average others [message #77301 is a reply to message #77160] |
Wed, 17 August 2011 09:35   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 8/17/11 10:17 AM, David Fanning wrote:
> Emily Anne Moravec writes:
>
>> We are trying to remove some values of our spectra that are equal to
>> 0, but by using the remove command it literally removes the values
>> where the flux is equal to 0 which is what it is supposed to do, but
>> the problem with that is that when those values are remove the whole
>> graph then moves which will mess up our final result. Is there a
>> command that will take out the values equal to zero, but leave the
>> graph where it is?
>
> Are you looking for something like this, where there
> are gaps in the plot where the data goes to zero:
>
> IDL> data = randomu(-3L, 100)*10
> IDL> zeros = Long(randomu(-2L, 5)*100)
> IDL> data[zeros] = 0
> IDL> plot, data, min_value=0.1
Setting invalid values to !values.f_nan also works nicely for regular
line plots (though it can make related computations a bit more
complicated, with extra NAN keywords and the FINITE routine coming in
handy).
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
|
|
|