idl presentation

21
I D L INTERACTIVE DATA LANGUAGE Ionuț Jula [email protected] Jan 08, 2013 IDL 101 1

Upload: ionut-jula

Post on 24-Oct-2015

53 views

Category:

Documents


1 download

DESCRIPTION

Interactive Data LanguageShort IDL Overview

TRANSCRIPT

Page 1: IDL Presentation

I D L

INTERACTIVE DATA LANGUAGE

Ionuț Jula

[email protected]

Jan 08, 2013 IDL 101 1

Page 2: IDL Presentation

========== Short IDL Overview ==========

Special Powers

Numerical

Vectorized

Interactive (hence the name)

Displays Graphics

Very fast w/ vector operations

Jan 08, 2013 IDL 101 2

Page 3: IDL Presentation

========== Short IDL Overview ==========

Special Powers

Dynamically typed

Single namespace

Compiles to an interpreted, stack-based intermediate p-code

However, IDL is not Java

Jan 08, 2013 IDL 101 3

Page 4: IDL Presentation

========== Short IDL Overview ==========

Special Powers

Multi-threaded procedures

All arguments passed by reference

Keywords (named parameters)

No nested arrays

Jan 08, 2013 IDL 101 4

Page 5: IDL Presentation

========== Short IDL Overview ==========

No predeclared variables IDL does not require for variables to be declared before they are used

COMMON declarations block for system-wide variables

Sharing globally accessible values among different routines

Simple and efficient index slice syntax Convenient way of extracting data from any array

Jan 08, 2013 IDL 101 5

Page 6: IDL Presentation

========== Short IDL Overview ==========

Downside

Due to its single namespace, large programs and libraries are prone to become very difficult to debug and maintain, as a result of conflicts between newly defined subroutines or language extensions and local variable names.

Jan 08, 2013 IDL 101 6

Page 7: IDL Presentation

========== Short IDL Overview ==========

Example of possible ambiguity

Array indexing and subroutine entries can both be carried out w/ exactly the same syntax, that is

arguments surrounded by parentheses.

Which if used extensively can lead to serious obfuscation.

Jan 08, 2013 IDL 101 7

Page 8: IDL Presentation

========== Short IDL Overview ==========

Example of possible ambiguity (cont’d)

Like this:

POSITION(0.15, 0.420, 0.50, 0.60)

SHIFT(200, 2)

Open question: guess the routine!

Jan 08, 2013 IDL 101 8

Page 9: IDL Presentation

========== Short IDL Overview ==========

Example of possible ambiguity (cont’d)

However, this situation can be easily avoided by setting up a writing convention, like using square brackets

for array indexing, and round brackets for subroutine calls, thereby avoiding conflicts w/ function names

which used parentheses.

Jan 08, 2013 IDL 101 9

Page 10: IDL Presentation

========== Short IDL Overview ==========

Example of possible ambiguity (cont’d)

Like this:

POSITION[0.15, 0.420, 0.50, 0.60]

SHIFT(200, 2)

SHIFT() might as well could’ve been an array too.

Jan 08, 2013 IDL 101 10

Page 11: IDL Presentation

========== Short IDL Overview ==========

Superior agility in array operations

Quite as efficient as well constructed C or FORTRAN programs providing an equivalent functionality.

Jan 08, 2013 IDL 101 11

Page 12: IDL Presentation

========== Short IDL Overview ==========

IDL can read lots of different file formats

And I mean LOTS

There are IDL library routines that are readily available for use in reading almost any image format

Jan 08, 2013 IDL 101 12

Page 13: IDL Presentation

========== Short IDL Overview ==========

File Format

BMP

GIF

Interfile

JPEG

PICT

PGM/PPM

Sun Rasterfiles

SYLK

TIFF

Wavefront

X11-Bitmap

XWD

CDF

Routine

READ_BMP

READ_GIF

READ_INTERFILE

READ_JPEG

READ_PICT

READ_PPM

READ_SRF

READ_SYLK

TIFF_READ

READ_WAVE

READ_X11_BITMAP

READ_XWD

See CDF Library

Write Routine

WRITE_BMP

WRITE_GIF

N/A

WRITE_JPEG

WRITE_PICT

WRITE_PPM

WRITE_SRF

WRITE_SYLK

TIFF_WRITE

WRITE_WAVE

N/A

N/A

See CDF Library

Jan 08, 2013 IDL 101 13

Page 14: IDL Presentation

========== Short IDL Overview ==========

Interactive, Numerical Language

Commonly used for interactive processing of large amounts of data.

Particularly popular amongst astronomers.

Its syntax includes many constructs from Fortran and some from C.

Jan 08, 2013 IDL 101 14

Page 15: IDL Presentation

========== Short IDL Overview ==========

Vectorized construction

The sin() operation is also applied in a vectorized manner to the whole 100-elem array x, previously

created.

y = sin(x) / x

Jan 08, 2013 IDL 101 15

Page 16: IDL Presentation

========== Short IDL Overview ==========

Vectorized construction

F’n findgen() below returns an array

of floating point numbers:

x = findgen(100) / 10

Jan 08, 2013 IDL 101 16

Page 17: IDL Presentation

========== Short IDL Overview ==========

Vectorized construction

However, executing y = sin(x) / x we will eventually encounter a divide by zero.

IDL will report an arithmetic overflow and store a NaN value in the corresponding element of the y array.

…if only every language would behave like this.

Jan 08, 2013 IDL 101 17

Page 18: IDL Presentation

========== Short IDL Overview ==========

Vectorized construction

Plotting the visual representation of x vs y

using the plot() command,

the stored NaN value will be excluded.

plot, x, y

Jan 08, 2013 IDL 101 18

Page 19: IDL Presentation

========== Short IDL Overview ==========

Who uses IDL?

Goddard Space Flight Center (GSFC)

European Space Agency (ESA)

Hubble Space Telescope

National Center for Atmospheric Research (NCAR)

Naval Research Laboratory (NRL)

University of Michigan

University of Colorado

Jan 08, 2013 IDL 101 19

Page 20: IDL Presentation

========== Short IDL Overview ==========

Who owns IDL?

1977 –2004

Research Systems Inc. (RSI)

2006 – 2011

RSI & ITT Visual Information Solutions

2011 – present

Exelis Visual Information Solutions

Jan 08, 2013 IDL 101 20

Page 21: IDL Presentation

Jan 08, 2013 IDL 101 21