IDL Tutorials: Day 1 Michael Hahn

Slides:



Advertisements
Similar presentations
JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
Advertisements

C Language.
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.
IDL Tutorials : Day 5 Michael Hahn
Intro to Python Welcome to the Wonderful world of GIS programing!
Datalogi A 1: 8/9. Book: Cay Horstmann: Big Java or Java Consepts.
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
A simple C++ program /* * This program prints the phrase "Hello world!" * on the screen */ #include using namespace std; int main () { cout
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Introduction to Perl Software Tools. Slide 2 Introduction to Perl l Perl is a scripting language that makes manipulation of text, files, and processes.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Basic Input/Output and Variables Ethan Cerami New York
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
IDL Tutorial: Day 2 Michael Hahn
Geog Basic Skills in Scientific Programming Syllabus, Introduction, Fundamentals of IDL Syntax.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
Introduction to Python
Munster Programming Training
Nael Alian Introduction to PHP
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
1 © 2000 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Input, Output, and Processing
Computer Science 101 Introduction to Programming.
Instructor - C. BoyleFall Semester
What is MATLAB? MATLAB is one of a number of commercially available, sophisticated mathematical computation tools. Others include Maple Mathematica MathCad.
IDL Tutorials Day 2 Henry (Trae) Winter
1 Programming in C Hello World! Soon I will control the world! Soon I will control the world!
Introduction to PHP Advanced Database System Lab no.1.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
COMP 171: Data Types John Barr. Review - What is Computer Science? Problem Solving  Recognizing Patterns  If you can find a pattern in the way you solve.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room , Chris Hill, Room ,
IDL Tutorial Day 1 Goals: 1) Introduce IDL basics 2) Describe fundamental IDL structures Angela Des Jardins
Introduction to Programming
Introduction to Computer Programming
1 Winter Quarter 2003Rolando V. Raqueño FINAL Project Information One Design Review presentations (10 minutes long) A Final Document of your Project Wiki.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
IDL Tutorial Day 1 Goals: 1) Introduce IDL basics 2) Describe fundamental IDL structures Maria Kazachenko
Python Let’s get started!.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
Introduction to Programming Python Lab 3: Arithmetic 22 January PythonLab3 lecture slides.ppt Ping Brennan
IDL Tutorials Day 1 Henry (Trae) Winter Room 235
13-1 ANSYS, Inc. Proprietary © 2009 ANSYS, Inc. All rights reserved. April 28, 2009 Inventory # Chapter 13 Solver.out File and CCL Introduction to.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Perl & TCL Vijay Subramanian, Modified from : perl_basics_06.ppt.
Introduction to Programming
Fundamentals of Programming I Overview of Programming
Topics Designing a Program Input, Processing, and Output
Department of Computer Engineering
Python Let’s get started!.
Chapter 13 Solver .out File and CCL
Introduction to Programming
Revision Lecture
* Lecture # 7 Instructor: Rida Noor Department of Computer Science
Guide To UNIX Using Linux Third Edition
Variables, Expressions, and IO
Introduction to Programming
Lecture 2 Introduction to MATLAB
PHP.
T. Jumana Abu Shmais – AOU - Riyadh
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Introduction to Perl Learning Objectives:
Presentation transcript:

IDL Tutorials: Day 1 Michael Hahn

What is IDL Interactive Data Language- for easy manipulation of large data sets Many useful functions already in large library Used by - Nasa - Lockheed-Martin - Medical Imaging

General Strategies Know the problem before you start programming Search to see if a similar problem has already been solved -IDL help menu (>?) - xdoc (sswidl) Don’t Memorize Use the help Screen Keep notes on your work Write programs in steps Learn by doing

Using sswidl(de) and Help SSW:= solar software, useful for solar physicists Calling sswidl or sswidlde calls IDL with specified paths - paths with useful programs for solar physics work To manually set paths talk to _______________ Calling sswidlde calls a developer - graphical interface - real time information about your code Any text editor can be used - nedit, emacs, pico, vi >? Calls up help index for information on procedures Help, [variable],[…] for properties of variable or status

Journal Procedure Records everything you enter into a textfile Syntax: IDL> journal, “text_file” ; opens the file & starts record IDL> command line statements IDL> journal ; closes the file IDL is not case sensitive but Unix is IDL> help, var = IDL> HELP, Var but IDL> journal, “text_file”  Journal, “Text_File” Open journal file with any text editor % nedit text_file

Basic Variable Types Strings - Text - Must be contained within “ “ or ‘ ‘ - cannot perform numerical operations Integers - only range from –32,768 to 32,767 Longword Integers - long(#) for 32 bit integers - long64(#) for 62 bit integers Float - floating point number with 32 bit word length Double - a floating point number with 64 bit word length

Assigning a Variable a Value Variable_name = value - will automatically select a variable type variable_name= function_name(argument) Variable_name=string(value) Variable_name = long(value) Variable_name = fix(value) (for integers) Variable_name = double(value)

Naming Variables Assign ‘readable’ variable names that make sense Variable names must start with a letter - NO: 6a=“gamma” OK: a6=“gamma” Variables should not have the same name as IDL functions - NO: plot=6.0 Variable names may not have spaces in them - NO: A 6=5 OK: A_6=5 Some characters are illegal or have special meanings - NO: a.b=5 (used for structures), A+=5, A#=5

Arrays Variables, of any type, that contain multiple values Array Indexing: IDL arrays start at index zero - e.g. A=[1,2,3,4] print, A[0] 1 print, A[1] 2 Multiple ways to create arrays intarr(), fltarr(), dblarr(), strarr() indgen(), findgen(), dindgen() - Look up the above in the IDL help (e.g. >? Intarr) Array operations, see the help menu or experiment

Structures Structures are variables that contain multiple variables (scalars, arrays, or other structures) Each variable contained within a structure is called a tag Syntax: struct={[struct_type], tag_name1: tag_value1,…} e.g. Stars={star_name, Name:”alpha centauri a”, $ spec_type:’g2 V’, coords:[“ ”, “-60 44”],$ Distance:double(1.31)} Stars=replicate(stars,3) stars.name=[”alpha centauri a”, “alpha centauri b”, $ “alpha centauri c”] Print, stars.name Print, stars[0].name Note: you don’t need to name a structure type

Miscellaneous >? Gives you the help menu > ; starts a comment line and is ignored by IDL - often helpful to comment copiously $ tells IDL to treat the next line as if it is part of the current line IDL is case and space insensitive. Unix is not! Most math operators work just the way you’d think they do x=5*3-16 print, x