IDL Tutorials Day 2 Henry (Trae) Winter

Slides:



Advertisements
Similar presentations
Introduction to R Brody Sandel. Topics Approaching your analysis Basic structure of R Basic programming Plotting Spatial data.
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.
 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
Online Search Mehdi Osooli M.S.C in Epidemiology Department of Epidemiology & Biostatistics School of Public Health Tehran University of Medical Sciences.
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.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Preparation for working in the CSIL Basic LINUX operations.
By Hrishikesh Gadre Session II Department of Mechanical Engineering Louisiana State University Engineering Equation Solver Tutorials.
IDL Tutorials : Day 3 Angela Des Jardins Goals: 1) Learn to display images 2) Understand the basics of procedures and.
The Internet. Telnet Telnet means using your computer as a terminal. All commands you type are sent to the host computer you are connected to and executed.
Programming For Nuclear Engineers Lecture 12 MATLAB (3) 1.
EPSII 59:006 Spring Topics Using TextPad If Statements Relational Operators Nested If Statements Else and Elseif Clauses Logical Functions For Loops.
IDL Tutorial: Day 2 Michael Hahn
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
by Chris Brown under Prof. Susan Rodger Duke University June 2012
BRIAN D. HAHN AND DANIEL T. VALENTINE THIRD EDITION Essential MATLAB® for Engineers and Scientists.
Support.ebsco.com EBSCOhost Basic Searching for Academic Libraries Tutorial.
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
Millennium Cataloging Rich Edwards Program Manager, Technical Services Washington State Library.
MEGN 536 – Computational Biomechanics MATLAB: Getting Started Prof. Anthony J. Petrella Computational Biomechanics Group.
Support.ebsco.com EBSCOhost Basic Searching for Academic Libraries Tutorial.
Part 1 – PubMed Interface, Display options, Saving, Printing, and ing results. Instructions This part of the course is a PowerPoint demonstration.
Introduction to Engineering MATLAB – 1 Introduction to MATLAB Agenda Introduction Arithmetic Operations MATLAB Windows Command Window Defining Variables.
1 Day 5 Additional Unix Commands. 2 Important vs. Not Often in Unix there are multiple ways to do something. –In this class, we will learn the important.
A Brief introduction to MatLAB ($50 - $99 for students)
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
Education Full Text Searching. To search Education Full Text, I will need to start at the Rod Library Homepage.
Python – May 11 Briefing Course overview Introduction to the language Lab.
Tutorial 51 Programming Structures Sequence - program instructions are processed, one after another, in the order in which they appear in the program Selection.
Next Unix Topics Tuesday, 2/11 & 18/2014. Change Password (by 2/14/14) ssh to account on – faclinux.cse.ohio-state.edu – stdlinux.cse.ohio-state.edu passwd.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
Basic Computer and Word Functions, part 1 Read the information and use to answer the questions in the Basic Computer and Word Functions Study Guide.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
IDL Tutorial Day 1 Goals: 1) Introduce IDL basics 2) Describe fundamental IDL structures Angela Des Jardins
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
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.
Basic & Advanced Reporting in TIMSNT ** Part Three **
An Introduction to Forms. The Major Steps of a MicroSoft Access Database  Tables  Queries  Forms  Macros  Reports  Modules On our road map, we are.
IDL Tutorial Day 1 Goals: 1) Introduce IDL basics 2) Describe fundamental IDL structures Maria Kazachenko
BIT 115: Introduction To Programming Professor: Dr. Baba Kofi Weusijana (say Doc-tor Way-oo-see-jah-nah, Doc-tor, or Bah-bah)
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.
IDL Tutorials Day 1 Henry (Trae) Winter Room 235
General Computer Science for Engineers CISC 106 Lecture 03 James Atlas Computer and Information Sciences 6/15/2009.
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
 Prepared by: Eng. Maryam Adel Abdel-Hady
Development Environment
Chapter 5: Enhancing Your Output with ODS
Appendix B MathScript Basics
Example of a search on DialogWeb
Using a set-up file to read ASCII data into SPSS
Shell Script Assignment 1.
Basic operations in Matlab
Intro to UNIX System and Homework 1
I/O in C Lecture 6 Winter Quarter Engineering H192 Winter 2005
PuTTY Download Putty from:
BSc in Digital Media, PSUIC
8 6 MySQL Special Topics A Guide to MySQL.
IDL Tutorials Day 4 Henry (Trae) Winter
CSCI N207 Data Analysis Using Spreadsheet
Beginning Python Programming
Presentation transcript:

IDL Tutorials Day 2 Henry (Trae) Winter

Today’s Topics If you didn’t get everything from yesterday, DON’T PANIC! Refer to notes, use help screens, ask me (That’s what I’m here for!) Review journal procedure Using Functions and Procedures Review xdoc Macros or Scripts Plotting to screen and to files Using the Save & Restore procedures Review structures

Journal Procedure The journal procedure allows you to record everything you entered in the command line, into a text file Syntax: IDL>journal, “text_filename.ext” ; opens the file and starts recording IDL >stuff ; command line statement IDL >more stuff ; “ “ IDL >journal ; closes the file and stops recording Remember: IDL is not case sensitive but unix is: IDL > help, var = IDL > Help, Var = IDL > HELP,VAR IDL > journal, “text_filename.ext”  IDL > journal, “Text_Filename.EXT” The journal file can be opened with a text editor such as emacs or nedit: computer_name> emacs text_filename.ext computer_name> nedit text_filename.ext

Functions and Procedures IDL is based on two types of basic program: Functions and Procedures Function syntax result=function_name(parameter, KEYWORD=SET, …) Examples: size, n_elements, sin, cos, reverse, where Procedure Syntax procedure_name, param1, param2, KEYWORD=SET, … Examples: help, print, open, printf, plot, set_plot, device, save,restore The exact syntax for procedures or functions can be found using either the help menu, xdoc, or the doc_library procedure Functions can be placed anywhere that you put a value or variable

xdoc xdoc allows you to graphically browse the library of Solarsoft routines Just type in xdoc at the IDL command prompt. If you know the name of the procedure/function you can type it in the field Usually you don’t know the name of a particular procedure so ssw makes it “easy” for you to search xdoc example

Commonly used Procedures print,x,y,”printing stuff” ; Prints variables, the results of functions >print, sin(x) plot ; Plot variables to the current graphics device (usually the screen) >plot, x, sin(x), TITLE=“Sine Plot”, XTITLE=“ X ”,$ YTITLE=“Sine of X” set_plot; Tells idl where to send plots to. Screen (Xdisplay) is the default >set_plot, “x” ;sends the output to the x display >set_plot, “ps” ;sends the output to a postscript file with default name of idl.ps. Postscript files can be read with ghostview. unix_prompt> gv idl.ps device ; Changes the properties of the device currently enabled by set_plot. For an example see example.pro or the help menu

Commonly used Functions You have already seen functions to create arrays (intarr, dblarr, fltarr, etc.) Many math operators are functions IDL>y=sin(x) IDL>y=cos(x) IDL> y=exp(x) ;Natural exponent where allows you to pick out the index of an array that meets some criterion. IDL>index=where(new_array eq 15.) More on Boolean operators later replicate makes copies of variables, arrays, structures and so on… IDL>stars=replicate(stars,15) dialog_pickfile allows you to interactively pick out file names IDL>file_name=dialog_pickfile()

Macros (Scripts) Simplest form of program In the editor window write commands just like you would at the command prompt At the very end type END so that IDL knows when the program is over Save the program with some unique name At the command prompt type either: >.run program_name >.rnew program_name See example.pro for an example

Save & Restore Save 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”