Skip to content

Month: February 2024

IDL’s array index special handling, including the colon ( ‘:’ ) and the asterisk ( * )

Note that IDL 2-dimensional arrays are given as Z[A,B] where A is column ref; B is row ref

x[*] means take each element of x (separately), so

x[*] = y[*] means,
x[0] = y[0], x[1] = y[1], … up to all elements of the arrays

x[0:2] is essentially does the same but on a subset of an array; eg
take elements 0 through 2 of the array (and do “whatever”)

I read also that this notation, esp on lhs, is much much faster than
conventional looping etc.