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

Home » Public Forums » archive » Re: do SMOOTH not on all data
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: do SMOOTH not on all data [message #32690 is a reply to message #32685] Wed, 30 October 2002 08:10 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Oesch (oesch@giub.unibe.ch) writes:

> I just want to use SMOOTH on a 2D array. But some data are bad (-9999)
> and should not be considered in the smoothing process. Well trying to
> assign those bad data like this
> novalid=WHERE(array NE -9999)
> result=SMOOTH(array(novalid),5)
>
> DOES not work.
>
> I think the solution is using 'NaN' option, but how to I assign -9999 as
> NaN as the !VALUES.F_NAN is write protected?

You want something like this:

arrayCopy = array
bad = Where(arrayCopy EQ -9999, count)
IF count GT 0 THEN arrayCopy[bad] = !Values.F_NAN
smoothedArray = Smooth(arrayCopy, /NAN, 5)

Cheers,

David
--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 5.6 Where?
Next Topic: How to transfer variables between files

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

Current Time: Fri Oct 10 01:36:11 PDT 2025

Total time taken to generate the page: 0.16410 seconds