Re: Most Common IDL Programming Errors [message #59899 is a reply to message #59761] |
Fri, 11 April 2008 11:37   |
Kenneth P. Bowman
Messages: 585 Registered: May 2000
|
Senior Member |
|
|
In article <fto23e$fk5$1@aioe.org>,
"R.G. Stockwell" <nothanks@noemail.com> wrote:
> "Tom McGlynn" <tam@milkyway.gsfc.nasa.gov> wrote in message
> news:08513f0c-9af3-4613-900c-2449d1306fc5@l42g2000hsc.google groups.com...
>> On Apr 9, 10:18 pm, Tom McGlynn <t...@milkyway.gsfc.nasa.gov> wrote:
>> ...
>>> Another is fogetting the inherently parallel nature of array
>>> operations, e.g., something like expecting
>>>
>>> x=[0,1,1,2,2,2]
>>> y=indgen(3)
>>>
>>> y[x] = y[x]+1
>>>
>>> to give something other than 1,1,1.
>>>
>> And perhaps I should include using the XXXgen functions when one
>> means XXXarr!
>> Tom
>
>
> XXXarr needs a /nan keyword (to fill it with nans).
> I always use it like
>
> a = fltarr(len) + !values.f_nan
>
> -bob
Or
a = REPLICATE(!VALUES.F_NAN, len)
Ken Bowman
|
|
|