Introduction to IDL Lecture 2 January 28, 2005 Research System Inc.    http://www.rsinc.com/ IDL, programming language ENVI, image processing based on IDL.

Download Report

Transcript Introduction to IDL Lecture 2 January 28, 2005 Research System Inc.    http://www.rsinc.com/ IDL, programming language ENVI, image processing based on IDL.

Introduction to IDL

Lecture 2 January 28, 2005

Research System Inc.

 http://www.rsinc.com/  IDL, programming language  ENVI, image processing based on IDL

IDL  Data visualization and image analysis  IDL has both numeric and nonnumeric data types  IDL is an array-oriented language  Build-in functions  Command Line and Development Environment

Array in IDL  Compact syntax without using loops. This makes simpler coding loops and the processing much faster than npts=1000000L data=randomu(-L, npts) sum=total(data) Needs 0.11 second sum=0.0

for i=0L, (npts-1L) do sum=sum+data[i] Needs 2.64s

Functions for array creation  Zeroed array ( *arr() ) and  Index array ( *indgen() )

Array indexing  array dimension myarr(),  array indexing myarr[index] or (myarr*10)[index] Arr = indgen(4,4)*4 Print, arr 0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 Print, arr[3,2] 44 Print, arr[11] 44 Print, arr(*,2), arr(2,*) ?

Array properties  n_elements(), size(), min(), max(), mean(), variance(), stddev(), moment(), total()

Other operations for an array  Locating values within an array Arr = indgen(9)*10 Index = where (arr gt 35) Print, arr[index] ?

  Array reordering:  reform(), reverse(), rotate(), transpose(), shift(), sort(), uniq() Array resizing:  rebin(), congrid(), interpolate(),