Re: Initialize new variable array with nan or -9999 values [message #87648 is a reply to message #87645] |
Thu, 20 February 2014 14:14   |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On Thursday, February 20, 2014 4:33:01 PM UTC-5, Paul van Delst wrote:
> On 02/20/14 13:36, John Correira wrote:
For large arrays, there is a speed advantage to using REPLICATE or MAKE_ARRAY in which the array is initialized with the correct value, as opposed to
fltarr(304,336,500) - 9999
in which the array is first initialized with zeros, and then 9999 is subtracted from each element. Most computers should be able easily handle a 50 Mb array, so in this case the speed difference would be a fraction of a second. But it is something to keep in mind when arrays are large enough that a factor of two speed improvement matters. --Wayne
|
|
|