Translante IDL script to python

IDL programming language

IDL, short for Interactive Data Language, is a programming language used for data analysis. It is popular in particular areas of science, such as astronomy, atmospheric physics and medical imaging. (

IDL to python (numpy) document

  • (IDL to Numeric/numarray Mapping)[]
  • (NumPy for IDL users)[]

idlwrap API

idlwrap helps you port IDL code to python by providing an IDL-like interface to numpy and scipy.

  • (API)[]


  • Array
    • IDL a[i, *] is the same with Python a[:,i]
      There are two different ways of storing a matrix/array in memory: column-major and row-major.
    • IDL array index include the last element:
      IDL> (FLTARR(10))[3:5]
       0.00000      0.00000      0.00000 ; -> three elements
      >>> np.zeros(10)[3:5]
      array([0., 0.]) # -> two elements