1 / 7

IDL Tutorials : Day 3

IDL Tutorials : Day 3. Michael Hahn (hahn@solar.physics.montana.edu). Today’s Topics. Displaying images on the screen Colour tables and xloadct Making Functions and Procedures Variable handling !P.multi. Displaying Images. Image data is often stored in collumn-major 2-arrays

konala
Download Presentation

IDL Tutorials : Day 3

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IDL Tutorials : Day 3 Michael Hahn (hahn@solar.physics.montana.edu)

  2. Today’s 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_NAME=KEY_NAME, … • Functions Start with the line function func_name, param, …, KEY_NAME=KEY_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, Keyword=1 • 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.multi=[a,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.multi=[0,2] ; 2 columns, 1 row - !p.multi=[0,2,2] ; 2 columns, 2 rows - !p.multi=[0,1,1] ; resets the variable

More Related