IDL Tutorials : Day 3 Angela Des Jardins Goals: 1) Learn to display images 2) Understand the basics of procedures and.

Slides:



Advertisements
Similar presentations
Question Bank. Explain the syntax of if else statement? Define Union Define global and local variables with example Concept of recursion with example.
Advertisements

Programming and Data Structure
CSI 3120, Implementing subprograms, page 1 Implementing subprograms The environment in block-structured languages The structure of the activation stack.
What is a pointer? First of all, it is a variable, just like other variables you studied So it has type, storage etc. Difference: it can only store the.
Genesis Presentation 3 Running Reports and Advance Features.
SW388R7 Data Analysis & Computers II Slide 1 Solving Problems in SPSS The data sets Options for variable lists in statistical procedures Options for variable.
Principles of programming languages 4: Parameter passing, Scope rules Department of Information Science and Engineering Isao Sasano.
More on PHP Coding Lab no. 6 Advance Database Management System.
Alford Academy Business Education and Computing1 Advanced Higher Computing Based on Heriot-Watt University Scholar Materials File Handling.
IDL Tutorial: Day 2 Angela Des Jardins Goals: 1) Introduce functions and procedures 2) Describe writing the simplest kind.
IDL Tutorials: Day 4 Goal: Learn some programming techniques: Relational operators, conditional statements, boolean operators, loops Angela Des Jardins.
Program Design and Development
1 CS 177 Week 15 Recitation Slides Review. Announcements Final Exam on Sat. May 8th  PHY 112 from 8-10 AM Complete your online review of your classes.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
SIMULINK Dr. Samir Al-Amer. SIMULINK SIMULINK is a power simulation program that comes with MATLAB Used to simulate wide range of dynamical systems To.
Basic And Advanced SAS Programming
Today’s Lecture Process model –initial & always statements Assignments –Continuous & procedural assignments Timing Control System tasks.
Assembler Compiler Interpreter ASSEMBLER To convert the assembly language into machine code. Translate mnemonic operation codes to their machine language.
IDL Tutorial: Day 2 Michael Hahn
G.T.R. Data Inc. Welcome to our EDI Overview. G.T.R. Data Inc. EDI Demonstration This demonstration will take you on a guided tour of our software. After.
Java Programming, 3e Concepts and Techniques Chapter 2 - Part 2 Creating a Java Application and Applet.
Agenda Control Flow Statements Purpose test statement if / elif / else Statements for loops while vs. until statements case statement break vs. continue.
MODULE 1.3 VERILOG BASICS UNIT 1 : INTRODUCTION TO VERILOG TOPIC : System Tasks and Compiler directive.
1 Agenda Administration Background Our first C program Working environment Exercise Memory and Variables.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
MA/CS 3751 Fall 2002 Lecture 24. MA/CS 3752 ginput ginput is a Matlab function which takes one argument input: number of points to select in the image.
Chapter 6 Sub Procedures
IDL Tutorials Day 2 Henry (Trae) Winter
20 Oct - Overview Homework #1 Group-Id rule Notes on Java text file input/output –Scanner class –Printf (like C)
GTR Data Inc. Welcome to our EDI Demonstration G.T.R. Data Inc. August 1997.
Chapter 10: BASH Shell Scripting Fun with fi. In this chapter … Control structures File descriptors Variables.
SAFARI ODBC INSTALLATION Go to the TRECA home WEB page.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
11/25/2015Slide 1 Scripts are short programs that repeat sequences of SPSS commands. SPSS includes a computer language called Sax Basic for the creation.
PhotoStory 3 Tutorial Created 1/5/10. When you open PhotoStory3 to can begin a new project, edit a project already started or just view creations. Click.
Chapter 9: Advanced SQL and PL/SQL Guide to Oracle 10g.
Advanced Web 2012 Lecture 6 Sean Costain Files Sean Costain 2012 Php allows for the : Creation Reading Appending Deleting Uploading And Closing.
Using Text Files in Excel File I/O Methods. Working With Text Files A file can be accessed in any of three ways: –Sequential access: By far the most common.
1. FINISHING FUNCTIONS 2. INTRODUCING PLOTTING 1.
Matlab tutorial course Lesson 4: Writing your own functions: programming constructs
Arrays Chapter 13 How to do the following with a one dimensional array: Declare it, use an index.
1 Chapter 5: Defining Classes. 2 Basics of Classes An object is a member of a class type What is a class? Fields & Methods Types of variables: –Instance:
Sequencing The most simple type of program uses sequencing, a set of instructions carried out one after another. Start End Display “Computer” Display “Science”
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Introduction to Perl. What is Perl Perl is an interpreted language. This means you run it through an interpreter, not a compiler. Similar to shell script.
Agenda Perform Quiz #1 (20 minutes) Loops –Introduction / Purpose –while loops Structure / Examples involving a while loop –do/while loops Structure /
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Craps Game Application Introducing Random-Number Generation and Enum.
1 Class 1 Lecture Topic Concepts, Definitions and Examples.
Introduction to MATLAB 1.Basic functions 2.Vectors, matrices, and arithmetic 3.Flow Constructs (Loops, If, etc) 4.Create M-files 5.Plotting.
Copy of the from the secure website - click on the AccoridaLife.zip link.
Coding Time This is a starter activity and should take about 10 minutes [ slide 1 ] 1.Log in to your computer 2.Open IDLE 3.Start a script session (Select.
Designing a Relational Database 13.4 Page A database should be created based on a design  Three steps Determine what information should be stored.
1 ENGI 2420 Structured Programming (Lab Tutorial 7) Memorial University of Newfoundland.
Variables  A piece of memory set aside to store data  When declared, the memory is given a name  by using the name, we can access the data that sits.
Java: Variables and Methods By Joshua Li Created for the allAboutJavaClasses wikispace.
Control Statements I: Loop. Control Statements Used to specify the order in which computations will be carried out Three types Branch: if, case, switch.
CPSC 233 Tutorial 5 February 9 th /10 th, Java Classes Each Java class contains a set of instance variables and methods Instance Variables: Type.
Digigital Fundamentals! Week 2,. Adobe Photoshop CS3 Photoshop Tools.
An Introduction to Programming with C++1 Void Functions Tutorial 5.
XP New Perspectives on Creating Web Pages With Word Tutorial 1 1 Creating Web Pages With Word Tutorial 1.
How To Create a Function in MATLAB English 393 Professor Harris May 10, 2011 Ava-Dawn Hammond Byung Kang Imelda Kwakye-Ackah Evelyn Ojo Adam Page.
Introduction to Programming
Variables A piece of memory set aside to store data
Chapter 6 Sub Procedures
Click ‘browse’ to search your device for
Introduction to Programming
IDL Tutorials Day 4 Henry (Trae) Winter
How to Submit Google Docs to the Homework Drop Box
Running a Java Program using Blue Jay.
Introduction to Programming
Presentation transcript:

IDL Tutorials : Day 3 Angela Des Jardins Goals: 1) Learn to display images 2) Understand the basics of procedures and functions

Displaying Images  Image data is often stored in column-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])  Colors arbitrarily assigned to each number depending on color table - loadct, number - tvlct, [vectors defining each color to be used] - xloadct  Many routines to read and write images. (read_gif, write_gif,..)  For more advanced routines see /ssw/gen/idl/ and look through imaging and display folders.

Procedures and Functions  All procedures and functions must end with an END statement  Procedures start with the line PRO name, p1, …pn, [KEY_NAME=KEY_NAME,…] And are called: IDL>name,p1,…pn  Functions Start with the line FUNCTION name, p1,…pn, [KEY_NAME=KEY_NAME,…] And are called: IDL>result=name(p1,…pn)  Functions have the statement return, output_variable ; before the final END  Must be compiled after every saved change IDL>.r pro_textfile_name

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 will use either: IDL>pro_name, p1, …pn, /Keyword or IDL>pro_name, p1, … pn, Keyword=something  For functions, it will look like: IDL>result=fn_name(p1,…pn, /Keyword) or IDL>result=fn_name(p1,…pn, Keyword=something) See the help files for more information on keywords and optional parameters.

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) are defined

“Homework”  Display the image, /home/angela/reu/img.sav, on your screen. You will need to restore the file above. Once you have done that, a variable called “img” will be defined. This is what you need to display. You will need to restore the file above. Once you have done that, a variable called “img” will be defined. This is what you need to display. If you want to use the program display.pro, it will need to be copied to the directory you are working in. The program lives at /home/dana/idl/display.pro or /home/angela/reu/display.pro. If you want to use the program display.pro, it will need to be copied to the directory you are working in. The program lives at /home/dana/idl/display.pro or /home/angela/reu/display.pro. You will need to change the scale of the color table (use xloadct) in order to see the image well. You will need to change the scale of the color table (use xloadct) in order to see the image well.  Cont. on next page >>>>>>>

“Homework” cont.  Write a function that returns sin 2 (x), where x is an array. Plot the result.  Write a procedure that plots sin 2 (x), where you input a value to create the array x in the call to the program. Also in your program, save a copy of the plot to a postscript file, where you give the name of the file in the call to the procedure.