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

Home » Public Forums » archive » Re: manipulating structures
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: manipulating structures [message #53373 is a reply to message #53372] Fri, 06 April 2007 19:59 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <1175911428.077370.279650@n59g2000hsh.googlegroups.com>,
"metachronist" <rkombiyil@gmail.com> wrote:

> a=fltarr(dim) ;dim is dimension, i.e., #days * #data/day

The preceding line is unnecessary, as the following line will create
the array "a" automatically.

> a=float(data[*].mydat) ;data[dim].mydat is data variable

> a[where(a[*] eq 999999.)]=!values.f_nan

The line above is not a great idea, though, as it will crash when there are no
missing data. Plus, the [*] is unnecessary. You should do something like
this instead

i = WHERE(a EQ 999999.0, count)
IF (count GT 0) THEN a[i] = !VALUES.F_NAN

Other than that, the concept seems fine. You have to create a
FLOAT variable in order to use NaNs, which I heartily endorse.

The only alternative is to create the original data structure using a
FLOAT instead of a LONG (presumably when you read the data). I prefer to replace
missing data codes with NaNs at the point I read the data. That way I
don't use them inadvertently.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: map_proj_init
Next Topic: Re: counting rows

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

Current Time: Wed Oct 08 17:40:37 PDT 2025

Total time taken to generate the page: 0.00489 seconds