Introduction to IDL - PowerPoint by 0A65RW0U

VIEWS: 22 PAGES: 16

									Introduction to IDL

      Lecture 2
          ITT: solutions for data
     visualization and image analysis


   http://www.ittvis.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-oriented language
   One dimension array (or vector):
       array=[1.0, 2.0, 4.0, 8.0] or array (4)
   Two dimension array (or matrices, one band image):
       Array=[[1,2,3], [5,7,8]] or (Array (3,2))
   Three dimension array (multiple bands image)
       Array=findgen(500,300,6) or an image of 500 columns, 300 rows, and 6 bands
   Any operation on an array is performed on all elements of the array,
    without the need for the user to write an explicit loop. The resulting
    code is easier to read and understand, and executes more efficiently.
   For example, you have a landsat image of (500, 300, 6) (i.e. column,
    row, bands) and you wish to divide each pixel (or element) by 2 or
    do other calculations:
       Image=image/2
       Print, total(image) / n_elements(image)
       Print, mean(image) ;the same as above

                              (c, r, b): BSQ;     (b, c, r): BIP;   (c, b, r): BIL
   Compact syntax without using loops. This makes
    simpler coding and the processing much faster than
    loops
                                   Randomu: Return a array of
                                   uniformly distributed random
npts=1000000L                      numbers (0,1) of the specified
data=randomu(0L, npts)             dimensions


sum=total(data)          Needs 0.11 second

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

   Zeroed array ( *arr() )
        bytarr(), intarr(), uintarr(), ulonarr(), ulong64arr(), fltarr(), dblarr(), complexarr(),
         strarr()

   Index array
        bindgen(): byte index array
        indgen(): integer index array
        ul64indgen(): unsigned integer array
        ulindgen(): unsigned long integer array
        lindgen(): long integer index array
        l64indgen(): 64-bit integer array
        findgen(): Floating-point index array
        dcindgen(): double precision floating-point index array
        cindgen(): complex index array
        dcindgen(): complex, double-precision index array
        sindgen(): spring array
                 Array indexing

   array dimension myarr(),
   array indexing myarr[index]   Arr = indgen(4,4)*4
                                  Print, arr
   Two dimension can be              0 4 8 12
                                      16 20 24 28
       1-d linear indexing           32 36 40 44
           Arr[14]=56                48 52 56 60
                                  Print, arr[3,2]
       2-d indexing                  44
                                  Print, arr[11]
           Arr[2,3]=56               44
                                  Print, arr(*,2), arr(2,*)
                                    ?
     Array properties-build in functions



   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(),
Other build-in functions and procedures
   FFT(image, -1), forward fast Fourier transfer
   FFT(image, 1), inverse FFT
   ROT(image, angle, scale, /sampling methods)
   interpolate, bilinear, cubic,
   map_image
   read_binary
   correlate
   ….
   plot
   tv, tvscl
   contour
   ….
   Command Line and
Development Environment
                         iTools
   Allow you to more quickly and easily open, analyze
    and visualize your data than even before.
       http://www.ittvis.com/idl/itools_tutorials.asp
   iPlot (plot)
   iSurface (surface)
   iContour (contour)
   iImage (tv, tvscl)
   iVolume (volume)
   iMap
   iVector
         IDL Virtual Machine



   Simple, no-cost method of distribution
   Run IDL6.0+ .sav file programs without
    license requirements
   Commercial and non-commercial applications
       IDL/ENVI programming

   Combine the ENVI/IDL together, extending
    the ENVI interface in IDL in order to
    implement new methods and algorithms of
    arbitrary sophistication is both easy and fun
    (M. Canty, 2007)
   See an example and will give more examples
    as the class moving forward

                                     DEMO!

								
To top