IDL Tutorial: Day 2 Michael Hahn

Slides:



Advertisements
Similar presentations
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Advertisements

COMPUTER PROGRAMMING Task 1 LEVEL 6 PROGRAMMING: Be able to use a text based language like Python and JavaScript & correctly use procedures and functions.
Write a program step by step. Step 1: Problem definition. Given the coordinate of two points in 2-D space, compute and print their straight distance.
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
 An operating system (OS) is a set of computer programs that allow the user to perform basic tasks like copying, moving, saving and printing files. 
IDL Tutorials : Day 5 Michael Hahn
Tutorial 12: Enhancing Excel with Visual Basic for Applications
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.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
Introduction to Matlab By: Dr. Maher O. EL-Ghossain.
IDL Tutorials : Day 3 Angela Des Jardins Goals: 1) Learn to display images 2) Understand the basics of procedures and.
A Visual Introduction to PC SAS. Start SAS by double-clicking on the SAS icon...
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
UNIX command line. In this module you will learn: What is the computer shell What is the command line interface (or Terminal) What is the filesystem tree.
IDL Tutorials: Day 1 Michael Hahn
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
1 CA201 Word Application Increasing Efficiency Week # 13 By Tariq Ibn Aziz Dammam Community college.
Introduction to Matlab 1. Outline: What is Matlab? Matlab Screen Variables, array, matrix, indexing Operators Plotting Flow Control Using of M-File Writing.
8 Shell Programming Mauro Jaskelioff. Introduction Environment variables –How to use and assign them –Your PATH variable Introduction to shell programming.
CIM6400 CTNW (04/05) 1 CIM6400 CTNW Lesson 6 – More on Windows 2000.
Lecture 4 MATLAB Windows Arithmetic Operators Maintenance Functions
© Copyright 2000, Julia Hartman 1 Next An Interactive Tutorial for SPSS 10.0 for Windows © by Julia Hartman Using Command Syntax.
Social Science Research Design and Statistics, 2/e Alfred P. Rovai, Jason D. Baker, and Michael K. Ponton Modifying Syntax PowerPoint Prepared by Alfred.
Introduction to Programming Workshop 1 PHYS1101 Discovery Skills in Physics Dr. Nigel Dipper Room 125d
Introduction to Computational Linguistics Programming I.
MEGN 536 – Computational Biomechanics MATLAB: Getting Started Prof. Anthony J. Petrella Computational Biomechanics Group.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB is a powerful program for numerical computations, plotting and programming.
Introduction to MATLAB ENGR 1181 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
Introduction to Engineering MATLAB – 6 Script Files - 1 Agenda Script files.
COMP 116: Introduction to Scientific Programming Lecture 6: Scripts and publishing, Creating matrices.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
A Brief introduction to MatLAB ($50 - $99 for students)
Introduction to Matlab’s Graphical User Interface (GUI) Type “guide” “Guide” creates interface on a Figure window and code in an M-file. Some hidden code.
IDL Tutorials Day 2 Henry (Trae) Winter
Using Visual Basic for Applications in Microsoft Project Sean Vogel.
Tutorial 51 Programming Structures Sequence - program instructions are processed, one after another, in the order in which they appear in the program Selection.
Histo-Labels Easy to use and fun to setup. Create and edit all label menus to fulfill your slide labeling requirements. Print to any printer installed.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 5 Editing Text Files. Basic Concept A text editor works on a file buffer that is a memory copy of a disk file The disk file is not updated until.
Tutorial on PC1D Mohit Mehta. Program Description PC1D solves the fully coupled non-linear equations for the quasi-1-d transport of electrons & holes.
IDL Tutorials: Day 4 Goal: Learn some programming techniques: Relational operators, conditional statements, boolean operators, loops Maria Kazachenko
Programming for GCSE 1.0 Beginning with Python T eaching L ondon C omputing Margaret Derrington KCL Easter 2014.
IDLE An IDE for Python bundled with the program release Click on IDLE (Python GUI) in the Start menu under the Python program group  Get the IDLE Python.
Perl Tutorial. Why PERL ??? Practical extraction and report language Similar to shell script but lot easier and more powerful Easy availablity All details.
Lecture 20: Choosing the Right Tool for the Job. What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation.
Introduction to Matlab  Matlab is a software package for technical computation.  Matlab allows you to solve many numerical problems including - arrays.
Introduction to Matlab
An Introduction to Forms. The Major Steps of a MicroSoft Access Database  Tables  Queries  Forms  Macros  Reports  Modules On our road map, we are.
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.
Printing in Python. Printing Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external.
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
ENG College of Engineering Engineering Education Innovation Center 1 Functions 1 in MATLAB Topics Covered: 1.Uses of Functions Organizational Tool.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. A Concise Introduction to MATLAB ® William J. Palm III.
Introduction to Programming on MATLAB Ecological Modeling Course Sep 11th, 2006.
IDL Tutorials Day 1 Henry (Trae) Winter Room 235
MATLAB (Matrix Algebra laboratory), distributed by The MathWorks, is a technical computing environment for high performance numeric computation and.
Getting Started With Python Brendan Routledge
An Interactive Tutorial for SPSS 10.0 for Windows©
Development Environment
Chapter 5: Enhancing Your Output with ODS
Appendix B MathScript Basics
Using a set-up file to read ASCII data into SPSS
Shell Script Assignment 1.
Basic operations in Matlab
Task 1 Computer Programming LEVEL 6 PROGRAMMING:
8 6 MySQL Special Topics A Guide to MySQL.
Presentation transcript:

IDL Tutorial: Day 2 Michael Hahn

Today’s Topics Using Functions and Procedures already written - e.g. plotting Xdoc Writing Scripts (Macros) Save and Restore Structures

Functions and Procedures Two basic types of programs Functions: result=function_name(parameter, Keyword=Set, …) Examples: size, n_elements, sin, cos, reverse, where - Functions can be placed anywhere you can put a value Procedures: procedure_name, param1, param2, Keyword=Set… Examples: help, print, open, printf, plot, set_plot, device, save - Procedures do stuff, but don’t need to return a value Exact syntax for particular Procedures or Functions can be found using the help menu, xdoc, or the doc_library procedure

xdoc Xdoc allows you to graphically brose the lbirary of Solarsoft routines Type in xdoc at IDL command prompt Can search for the name of a procedure/function Usually you don’t know the name, xdoc makes it ‘easy’ for you to search for it

Commonly Used Procedures print: for printing stuff (to screen) e.g. > print, sin(x) plot: plot variables to the current graphics device (usually screen) > plot, x, sin(x), Title=“sin Plot”, xtitle=“x”, $ ytitle=“sine of x” set_plot: tells idl where to send plots to. Screen (Xdisplay) is default - set_plot,”x” ;sends output to the x display - set_plot, “ps”; sends the output to a postscript file with default name idl.ps. Read ps files with ghostview unix_prompt> gv idl.ps device: changes properties of the device currently enabled by set_plot. See help menu.

Commonly Used Functions Many math operators are functions > y=sin(x) > y=cos(x) >y=exp(x); exponential function Where allows you to pick out the index of an array that meets some criterion > index=where(new_array eq 15) (more on boolean operators later) Replicate makes copies of variables, arrays, structures, etc... > stars=replicate(stars,15) dialog_pickfile allows you to graphically pick out file names > file_name=dialog_pickfile()

Macros (Scripts) Simplest form of Program In the editor window write commands just like you would at command prompt At the end type END so IDL knows when program is over Save the program with a unique name (I.e. save the text file) At the command prompt type either: >.run program_name >.rnew program_name

Save and Restore Programs are saved by saving the text file you write them in Save, the procedure, allows you to save variables to a file Example: save, variable1, variable1, file=‘file.sav’ Restore allows you to restore saved variables to a session Example: restore, ‘file.sav’