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

Home » Public Forums » archive » Initialize new variable array with nan or -9999 values
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: Initialize new variable array with nan or -9999 values [message #87645 is a reply to message #87638] Thu, 20 February 2014 13:33 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 02/20/14 13:36, John Correira wrote:
> On 02/20/2014 01:31 PM, Morgan Silverman wrote:
>> Hello,
>>
>> This seems like it should be so simple but I can't figure out how to
>> do it. I am creating a new array, distance=fltarr(304,336,500) and I
>> want it to be initially filled with either nan or -9999. My results
>> could possibly be 0.0 so I need to know where those are calculated
>> values and not just part of the original array. Thank you.
>>
>> Sincerely, Morgan
>>
>
> Either
>
> distance = fltarr(304,336,500,/NOZERO)
> distance[*] = !values.f_nan
>
> or
>
> distance = make_array(304,336,500,/FLOAT,VALUE=!values.f_nan)

+1 on the MAKE_ARRAY for this purpose.

It's more self-documenty (IMO).
[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: Problem with cgcmdwindow__define
Next Topic: Position, normal coordinates, and multiple images

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

Current Time: Wed Oct 08 17:32:36 PDT 2025

Total time taken to generate the page: 0.00402 seconds