IDL Notebook: Arrays
As simple as you think it might be, I always need to look up the correct function necessary to create the type of array that I need in IDL.
Here is a good reference: http://www.cis.rit.edu/class/simg211/Vectors_and_Arrays.html
BINDGEN Return a byte array with each element set to its subscript.
IDL> print, bindgen(10)
0 1 2 3 4 5 6 7 8 9
BYTARR Create a byte vector or array.
FINDGEN Return a floating-point array with each element set to its subscript.
FLTARR Return a floating-point vector or array.
INDGEN Return an integer array with each element set to its subscript.
INTARR Return an integer vector or array.
LINDGEN Return a longword integer array with each element set to its subscript.
LONARR Return a longword integer vector or array.
DINDGEN Return a double integer array wit each element set to its subscript
IDL> print,dindgen(10)
0.00000000 1.0000000 2.0000000 3.0000000 4.0000000 5.0000000 6.0000000 7.0000000 8.0000000 9.0000000
DBLARR Return a double integer vector or array
IDL> print,dblarr(10)
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
IDENTITY Return an identity array.
0.000000 1.00000 0.000000
0.000000 0.000000 1.00000
MAKE_ARRAY General purpose array creation.
REPLICATE Form array of given dimensions filled with a value.
1 1 1 1
1 1 1 1
STRARR Return and array of srings
(http://www.exelisvis.com/docs/STRARR.html)
As simple as you think it might be, I always need to look up the correct function necessary to create the type of array that I need in IDL.
Here is a good reference: http://www.cis.rit.edu/class/simg211/Vectors_and_Arrays.html
BINDGEN Return a byte array with each element set to its subscript.
IDL> print, bindgen(10)
0 1 2 3 4 5 6 7 8 9
BYTARR Create a byte vector or array.
IDL> print, bytarr(10)
0 0 0 0 0 0 0 0 0 0
FINDGEN Return a floating-point array with each element set to its subscript.
IDL> print, findgen(10)
0.000000 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000 7.00000 8.00000 9.00000
FLTARR Return a floating-point vector or array.
IDL> print, fltarr(10)
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
INDGEN Return an integer array with each element set to its subscript.
IDL> print, indgen(10)
0 1 2 3 4 5 6 7 8 9
INTARR Return an integer vector or array.
IDL> print, intarr(10)
0 0 0 0 0 0 0 0 0 0
LINDGEN Return a longword integer array with each element set to its subscript.
IDL> print, lindgen(10)
0 1 2 3 4 5 6 7 8 9
LONARR Return a longword integer vector or array.
IDL> print, lonarr(10)
0 0 0 0 0 0 0 0 0 0
DINDGEN Return a double integer array wit each element set to its subscript
IDL> print,dindgen(10)
0.00000000 1.0000000 2.0000000 3.0000000 4.0000000 5.0000000 6.0000000 7.0000000 8.0000000 9.0000000
DBLARR Return a double integer vector or array
IDL> print,dblarr(10)
0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000 0.00000000
IDENTITY Return an identity array.
IDL> print, identity(3)
1.00000 0.000000 0.0000000.000000 1.00000 0.000000
0.000000 0.000000 1.00000
MAKE_ARRAY General purpose array creation.
REPLICATE Form array of given dimensions filled with a value.
IDL> print, replicate(1,4,3)
1 1 1 11 1 1 1
1 1 1 1
STRARR Return and array of srings
(http://www.exelisvis.com/docs/STRARR.html)