DINDGEN

The DINDGEN function creates a double-precision, floating-point array with the specified dimensions. Each element of the array is set to the value of its one-dimensional subscript. For example, D=DINDGEN(100) will create a 100-element, double-precision, floating-point array with the values 0.0, 1.0, ..., 99.0.

Note: Values greater than 9007199254740992 cannot be accurately represented using double-precision floating-point arithmetic. If you create a DINDGEN with values larger than 9007199254740992 (for example using the START keyword), your array will contain duplicates and discontinuities beyond this value. In this case, you should consider using L64INDGEN to return 64-bit integer values.

Example

We need an array of 300 very small consecutive numbers for amounts of a chemical for a computer-controlled system to release during an experiment. Generate these experimental numbers using DINDGEN.

initialnumbers = DINDGEN(300, START=1)

finalnumbers = initialnumbers / 1000000000

PRINT, finalnumbers

Syntax

Result = DINDGEN(D1 [, ..., D8] [, INCREMENT=value] [, START=value])

Return Value

Returns an array of the specified dimensions where each element of the array is set to the value of its one-dimensional subscript.

Arguments

Di

Either an array or a series of scalar expressions specifying the dimensions of the result. If a single argument is specified, it can be either a scalar expression or an array of up to eight elements. If multiple arguments are specified, they must all be scalar expressions. Up to eight dimensions can be specified. If the dimension arguments are not integer values, IDL will convert them to integer values before creating the new array.

Keywords

INCREMENT

Set this keyword to a double-precision number giving the spacing between values in the array. The default is 1. Setting this keyword is equivalent to multiplying each array element by this value and then converting to the result type.

START

Set this keyword to a double-precision number giving the value of the first element in the array. The default is 0. Setting this keyword is equivalent to adding a constant offset to each element (after first multiplying by INCREMENT if necessary) and then converting to the result type.

Thread Pool Keywords

This routine is written to make use of IDL’s thread pool, which can increase execution speed on systems with multiple CPUs. The values stored in the !CPU system variable control whether IDL uses the thread pool for a given computation. In addition, you can use the thread pool keywords TPOOL_MAX_ELTS, TPOOL_MIN_ELTS, and TPOOL_NOTHREAD to override the defaults established by !CPU for a single invocation of this routine. See Thread Pool Keywords for details.

Version History

Original

Introduced

8.2.1

Added START keyword

8.3

Added INCREMENT keyword

See Also

BINDGEN, CINDGEN, DCINDGEN, DINDGEN, FINDGEN, INDGEN, L64INDGEN, LINDGEN, SINDGEN, UINDGEN, UL64INDGEN, ULINDGEN, MAKE_ARRAY