UVa ITC Research Computing Support Fall, 2002 Presented by the Research Computing Support Group Davi - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

UVa ITC Research Computing Support Fall, 2002 Presented by the Research Computing Support Group Davi

Description:

Command Line Journaling. Command line entries can be saved to a journal file. ... To stop journaling, enter: JOURNAL. Batch Commands ... – PowerPoint PPT presentation

Number of Views:60
Avg rating:3.0/5.0
Slides: 32
Provided by: timfjos
Category:

less

Transcript and Presenter's Notes

Title: UVa ITC Research Computing Support Fall, 2002 Presented by the Research Computing Support Group Davi


1
UVa ITC Research Computing SupportFall,
2002Presented by theResearch Computing Support
GroupDavid Drake, Kathy Gerber, Ed Hall,
Tim F. Jost Tolson
  • Overview of Research Hardware, Software, Support
    Storage Tuesday, September 10, 330 PM
  • Statistical Software Thursday, September 12,
    330 PM
  • Mathematical Visualization Software Tuesday,
    September 17, 330 PM
  • High Performance Computing Thursday, September
    19, 330 PM
  • FEMLAB Seminar Multiphysics Modeling Friday,
    Sept. 27 at 1000 AM
  • Introduction to IDL Wednesday, October 9 at
    Noon
  • Databases and the Web Wednesday, October 23 at
    3 pm
  • Maple 8 Wednesday, November 20 at 3 pm

2
Introduction to IDL
  • By David Drake
  • Research Computing Support Center
  • Phone 243-8800 Fax 243-8765
  • E-Mail Res-Consult_at_Virginia.EDU
  • http//www.itc.Virginia.edu/researchers

3
Outline
  • Introduction (What is IDL?)
  • The IDL Development Environment (IDLDE)
  • Documentation
  • Programming
  • Advanced Topics
  • Examples Other Resources

4
I. Introduction
  • IDL Interactive Data Language
  • Got started as a language for handling and
    processing images
  • UVas IDL webpage (http//www.itc.virginia.edu/res
    earch/idl/)

5
Key Features Highlights
  • Rapid application development with GUI
    development environment
  • Support for numerous file formats
  • Image BMP, GEO TIFF, Interfile, JPEG, NRIF,
    PICT, PNG, PPM, SRF, TIFF, X11 Bitmap, XWD
  • Scientific CDF, HDF, HDF-EOS, netCDF
  • Other ASCII, Binary, DICOM, DXF, WAV, XDR

6
More Features Highlights
  • Plotting data visualization
  • 2D, 3D, volume, surface, contour, mapping
  • Irregular grids
  • Animation
  • Signal image processing
  • GUIBuilder application interface development tool

7
Still More Features
  • Multithreading with multiple CPU support
  • Inter-language communication (Fortran C)
  • External calls from IDL
  • Extending IDL with built-in routines
  • Calling IDL from external applications
  • Talk to IMSL libraries

8
II. The IDLDE
  • Starting the IDLDE
  • Windows Start Programs IDL 5.5 IDL
  • Macintosh (currently requires a HASP)
  • Unix
  • idlde (or idl to invoke only the command line
    interface)
  • For IDL files, look in /common/rsi/idl_5.5

9
The IDLDE Window
Menu bar
Tool bars
Multiple Document Panel
Project Window
Output Log
Variable watch window
Command line
Status bar
10
Setting Preferences
  • Graphics To make the graphics output work
    correctly on most systems, first thing to do is
    to enter
  • DEVICE, RETAIN2, DECOMPOSED0
  • at the beginning of each session. This is the
    best option for cross-platform work. The
    RETAIN2 option forces IDL to buffer IDL windows
    that become covered. The DECOMPOSED0 setting
    allows users with DirectColor and TrueColor
    displays to use IDL programs written for
    standard, PseudoColor (8 bit 256 color)
    displays without modification.

11
More Preferences
  • The Startup file (startup.pro) DEVICE statement
    above can be included in an IDL startup file
    called startup.pro and run each time IDL is
    started. Set this option in File Preferences
    Startup.
  • Path For ease of use, add your working directory
    to your IDL path. Set this option in File
    Preferences Path

12
III. Documentation
  • RSI Online Manuals (pdf) located in
  • Windows (C\Program Files\RSI)\IDL 5.5\docs
  • Unix /common/rsi/idl_5.5/docs
  • Macintosh RSIIDL 5.5docs
  • Start with Getting Started
  • Note that documents (both pdfs help menu) are
    really for version 5.4, so
  • Take a look at Whats New in IDL 5.5 Whats New
    in IDL 5.4

13
Be Aware of
  • Using IDL
  • Building IDL Applications
  • IDL Reference Guide
  • External Development Guide
  • Scientific Data Formats
  • IDL Wavelet Toolkit Users Guide
  • IDL Quick Reference

14
IV. Programming
  • IDL syntax is case-insensitive (except for unix
    filenames directory structures, etc.)
  • Special characters (Help Contents Contents
    IDL Reference Special Characters)
  • begin comment (to end of line)
  • line continuation
  • separate two commands on same line
  • _at_ execute (following) batch file
  • end label identifiers

15
Statements
  • Normal assortment (Help Contents Contents
    IDL Reference Functional List of Routines
    Statements)
  • begin end
  • if then case endcase switch
  • for repeat until while do
  • break continue goto
  • pro function see below
  • common

16
Command Line Entries
  • Statements are (compiled and) executed
    immediately, and in this sense, IDL is an
    interpretive language
  • Multiple statements on a single line must be
    separated by an ampersand ()
  • Each command (e.g. for loops) must be fully
    contained on one effective line
  • Concatenate using or
  • Multi-lined commands must be continued using
    at the end of the line

17
Command Line Examples
  • Command concatenation
  • j 0 for i 1,10 do j j 1
  • Line continuation
  • for i 1,10 do begin j j i k k i
    endfor

18
Command Line Journaling
  • Command line entries can be saved to a journal
    file.
  • To start the journal (which overwrites any
    existing file) enter
  • JOURNAL, filename
  • To stop journaling, enter
  • JOURNAL

19
Batch Commands
  • Batch files are run by entering _at_filename at
    the command line, e.g.
  • _at_C\IDLbatch\mybatch.xyz
  • Can be advantageous for code development in that
    batch variables remain available for manipulation

20
Procedures
  • Self-contained code unit with a unique name that
    is called by other code units to perform a
    desired duty
  • The calling code and procedure communicate via
    passed arguments
  • Must start with PRO procedure name and end with
    an END statement
  • Must be compiled

21
Procedure Example
  • DefinedPRO add, A, B, Boolean Bool END
  • Called
  • Add, 4, 7, /Boolean BA4, B7, Bool1
  • Add, Bo 5 shortest, unambiguous abbreviation
    OK
  • Add, 5 Only A is defined B, T undefined

22
Functions
  • Similar to procedures except that they return a
    value, and so can be used in expressions The
    calling code and procedure communicate via passed
    arguments
  • Must start with FUNCTION function name and end
    with an END statement
  • Must be compiled

23
Function Example
  • DefinedFunction add, A, B, TESTT if
    n_elements(A) eq 0 then A 0 if n_elements(B)
    eq 0 then B 0 if T5 then RETURN AB else
    RETURN A B END
  • Called
  • C Add, 4, 7, TEST 5 C 28
  • D add, 3, TE 5 D 3 B is not defined
  • E add 5 E 5 only A is defined

Allows testingof parameters
24
Vectorization
  • Array processing
  • Much faster than looping
  • Use IDL array operations whenever possible
  • Avoid loops
  • Avoid if statements
  • Example _at_Array_vs_Loop.b

25
Debugging Profiling
  • Standard Debugging Tools
  • Access from the Run menu, from hotkeys, or from
    buttons
  • Step Into Over Out
  • Trace
  • Run to Cursor Return
  • Set Disable Edit Breakpoints
  • Built-in Profiler
  • Profile selected user and/or system modules

26
Graphics Modes
  • Direct
  • Graphics are sent directly to devices (e.g. X for
    X-windows displays, WIN for Windows displays, PS
    for PostScript files, etc.), which are set using
    the SET_PLOT command.
  • Once a direct-mode graphic is drawn to a graphics
    device, it cannot be altered or re-used. To
    re-create a graphic on another device, the IDL
    commands must be re-issued to that device.
  • Graphics added to a device are drawn in front of
    existing graphics.

27
Graphics Modes (cont.)
  • Object
  • Objects are self-contained entities and are
    designed for building interactive
    three-dimensional visualization applications.
    They are not designed (or meant to be designed)
    to interact with system variables or other
    external structures.
  • Objects are persistent and take up more system
    resources including memory. Programmers should
    be especially cognizant of memory issues and
    memory leaks.

28
V. Advanced Topics
  • Object Oriented Programming (Building IDL
    Applications, Part IV Using IDL Objects Help
    Contents Contents Building IDL Applications
    Using IDL Objects)
  • Creating GUIs (Building IDL Applications, Part
    V Creating GUIs Help Contents Contents
    Building IDL Applications Using the IDL GUI
    Builder)
  • Multiprocessor/Multithreading support (Whats New
    in IDL 5.5)
  • External dynamic linking
  • Making use of IMSL libraries
  • Calling IDL from FORTRAN C programs

29
VI. Examples
  • Plots
  • Some batch files enter _at_filename at the command
    line
  • _at_SalmonPlot.b, _at_Plot2axes.b, _at_FilledContour.b,
    _at_CircleColorPlot.b (needs circle.pro),
    _at_SurfaceContour.b _at_GaussContour.b, _at_Bessel.b
  • Printing
  • _at_SalmonPrint.b
  • FileIO, pointers, 3-d visualization
  • _at_HeadImport.b (needs Head Import.tf),
    RandomVolume.b, xplot.pro (needs xplot.zip)

30
More Examples
  • IDL Demo
  • Source code in idl55\examples\demo\demosrc
    directory
  • Other IDL examples
  • Look in idl55\examples\visual
  • IDLs user contribution library
  • Other resources
  • See David Fannings webpages and especially his
    coyote files
  • e.g. texture_surface.pro

31
Other Resources
  • IDL Webinars (web seminars)
  • Available from RSI (login account required)
  • Topics include
  • Introduction to IDL
  • Importing Raw Binary Data Basic Display in IDL
  • IDL HDF5 Support
  • IDL GUI Builder
  • IDL Programming Techniques (1st edition)
  • Available for browsing from the RCSC
Write a Comment
User Comments (0)
About PowerShow.com