IDL Tutorials : Day 3 - PowerPoint PPT Presentation

About This Presentation
Title:

IDL Tutorials : Day 3

Description:

Displaying images on the screen. Colour tables and xloadct. Making Functions and Procedures ... tv, data ; images data on screen - tvscl, data ; this method ... – PowerPoint PPT presentation

Number of Views:135
Avg rating:3.0/5.0
Slides: 8
Provided by: solarPhys
Category:
Tags: idl | day | onscreen | tutorials

less

Transcript and Presenter's Notes

Title: IDL Tutorials : Day 3


1
IDL Tutorials Day 3
  • Michael Hahn
  • (hahn_at_solar.physics.montana.edu)

2
Todays Topics
  • Displaying images on the screen
  • Colour tables and xloadct
  • Making Functions and Procedures
  • Variable handling
  • !P.multi

3
Displaying Images
  • Image data is often stored in collumn-major
    2-arrays
  • Two-D image data can be displayed using
  • - tv, data images data on screen
  • - tvscl, data this method scales data for
    display
  • Two-D image data are just arrays of numbers
  • Many Image arrays are of Byte type ( integer in
    0,255)
  • Colours arbitrarily asssigned to each number
    depending on colour table
  • routines
  • - loadct, number
  • - tvlct, vectors defining each colour to be
    used
  • - xloadct
  • Many routines to read and write images.
    (read_gif, write_gif, etc)
  • For more advanced routines see /ssw/gen/idl/ and
    look through imaging and display folders.

4
Procedures and Functions
  • Similar to macros
  • Procedures start with the line
  • Pro pro_name, param, , KEY_NAMEKEY_NAME,
  • Functions Start with the line
  • function func_name, param, , KEY_NAMEKEY_NAME
  • Functions have the statement
  • return, output_variable before the final END
  • Must be compiled after every saved change
  • (.run .rnew .r pro_textfile_name)

5
Keywords
  • The lines KEY_NAME on the previous slide are
    Keywords
  • They are usually options for when you run the
    program
  • To select one you can use either
  • pro_name, p1, pn, /Keyword or
  • pro_name, p1, pn, Keyword1
  • To incorporate your own keywords you can
    incorporate the
  • Keyword_set function, which returns 1 if set,
    and 0 if not
  • (more on If statements later)
  • See the help files for more information on
    keywords and optional parameters.

6
Variable Handling
  • Whenever you use Procedures or Functions the
    variables used in them are put in a box.
  • The variables in that box are not accessible when
    the procedures and functions are finished running
  • Variables can be accessible to the main level if
  • - Output parameters or keywords are used
  • - Common blocks are used
  • - System variables (defsysv, !var_name, value)

7
!p.multi System Variable
  • !p is a system variable (structure type) that
    tells IDL how to handle plots
  • !p. multi is used to control how many plots are
    put on a page
  • !p.multia,b,c,d
  • a controls when the plot is erased. Usually
    left set to 0
  • b number of columns
  • c number of rows
  • d number stacked in the z direction (3-D
    plotting)
  • Examples
  • - !p.multi0,2 2 columns, 1 row
  • - !p.multi0,2,2 2 columns, 2 rows
  • - !p.multi0,1,1 resets the variable
Write a Comment
User Comments (0)
About PowerShow.com