It specifies the multiplicative offset between adjacent elements. If /LOG is set, this must be a number greater than one. If /LOG is not set, this must be a positive number, and specifies the additive offset between adjacent elements.
![idl findgen idl findgen](https://0.academia-photos.com/attachment_thumbnails/30827623/mini_magick20190426-27943-1h0jv6.png)
In other words, either the last element will have the value "last", or the last two elements will bracket the value "last." step: The difference between adjacent array elements. If there are not an integer number of elements between first and last, then one extra element will be added.
![idl findgen idl findgen](http://www.met.reading.ac.uk/~swsheaps/python/pictures/ex38.png)
The data type of the result will be the same as first last: The (approximate) last element in the array. CATEGORY: Utilities CALLING SEQUENCE: result = ARRGEN(first, max, ) INPUTS: first: The first element in the array.
![idl findgen idl findgen](https://www.cis.rit.edu/class/simg211/ex4fig1.gif)
It can create arrays which increase/decrease by constant amounts at each element, or that increase/decrease by constant factors at each element. It creates an array given the first element, last element, and step size. + PURPOSE: This function is similar to (and an extension of) built-in functions like indgen, findgen, etc. 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. The values stored in the !CPU system variable control whether IDL uses the thread pool for a given computation. This routine is written to make use of IDL’s thread pool, which can increase execution speed on systems with multiple CPUs. 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. Set this keyword to a double-precision number giving the value of the first element in the array. Setting this keyword is equivalent to multiplying each array element by this value and then converting to the result type. Set this keyword to a double-precision number giving the spacing between values in the array. If the dimension arguments are not integer values, IDL will convert them to integer values before creating the new array. If multiple arguments are specified, they must all be scalar expressions. If a single argument is specified, it can be either a scalar expression or an array of up to eight elements.
#Idl findgen series#
ArgumentsĮither an array or a series of scalar expressions specifying the dimensions of the result. Returns an array of the specified dimensions where each element of the array is set to the value of its one-dimensional subscript. first = FINDGEN( 100) second = FINDGEN( 100, START= 1) final = first/second PRINT, final See the data plotted.
#Idl findgen code#
ExampleĬopy and paste the following code at the IDL command line to see an example of using FINDGEN. In this case, you should consider using DINDGEN to return double-precision values. If you create a FINDGEN with values larger than 16777215, your array will contain duplicates and discontinuities beyond this value. Note: Values greater than 16777215 cannot be accurately represented using single-precision floating-point arithmetic. For example, F=FINDGEN(100) will create a 100-element, single-precision, floating-point array with the values 0.0, 1.0. Each element of the array is set to the value of its one-dimensional subscript.
![idl findgen idl findgen](http://home.ustc.edu.cn/~rdx1017/main/idl/class/fig14.png)
The FINDGEN function creates a floating-point array of the specified dimensions.