IDL Tutorials Day 1 Henry (Trae) Winter Room 235

Slides:



Advertisements
Similar presentations
IT 325 OPERATING SYSTEM C programming language. Why use C instead of Java Intermediate-level language:  Low-level features like bit operations  High-level.
Advertisements

ARDUINO CLUB Session 1: C & An Introduction to Linux.
Intro to Python Welcome to the Wonderful world of GIS programing!
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?
CS31: Introduction to Computer Science I Discussion 1A 4/2/2010 Sungwon Yang
Guide To UNIX Using Linux Third Edition
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Guide To UNIX Using Linux Third Edition
JavaScript, Third Edition
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.
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
CSC 9010: Natural Language Processing
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
IDL Tutorial: Day 2 Michael Hahn
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
A First Program Using C#
1 Introduction to PHP. 2 What is this “PHP” thing? Official description: “PHP, which stands for "PHP: Hypertext Preprocessor" is a widely-used Open Source.
Game Programming © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line L.
IDL Tutorials: Day 1 Michael Hahn
Geog Basic Skills in Scientific Programming Syllabus, Introduction, Fundamentals of IDL Syntax.
Fortran 1- Basics Chapters 1-2 in your Fortran book.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Chapter 1: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
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
National Diploma Unit 4 Introduction to Software Development Data types, variables and constants.
1 © 2000 John Urrutia. All rights reserved. Qbasic Constructing Qbasic Programs.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Input, Output, and Processing
Computer Science 101 Introduction to Programming.
1 System Administration Introduction to Scripting, Perl Session 3 – Sat 10 Nov 2007 References:  chapter 1, The Unix Programming Environment, Kernighan.
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
I Power Int 2 Computing Software Development High Level Language Constructs.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
IDL Tutorials Day 2 Henry (Trae) Winter
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
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 Computer Programming
I Power Higher Computing Software Development High Level Language Constructs.
Introduction to Perl NICOLE VECERE. Background General Purpose Language ◦ Procedural, Functional, and Object-oriented Developed for text manipulation.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
CSC 1010 Programming for All Lecture 3 Useful Python Elements for Designing Programs Some material based on material from Marty Stepp, Instructor, University.
IDL Tutorial Day 1 Goals: 1) Introduce IDL basics 2) Describe fundamental IDL structures Maria Kazachenko
Python Let’s get started!.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter One An Introduction to Visual Basic 2008.
Agenda Comments Identifiers Keywords Syntax and Symentics Indentation Variables Datatype Operator.
Arrays. Topics to be Covered... Arrays ◦ Declaration ◦ Assigning values ◦ Array manipulation using loops Multi-dimensional arrays ◦ 2D arrays ◦ Declaration.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Introduction to Programming Python Lab 7: if Statement 19 February PythonLab7 lecture slides.ppt Ping Brennan
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Fundamentals of Programming I Overview of Programming
Development Environment
CST 1101 Problem Solving Using Computers
Topics Designing a Program Input, Processing, and Output
CSC201: Computer Programming
Python Let’s get started!.
BASIC ELEMENTS OF A COMPUTER PROGRAM
WORKSHOP 6 USING THE ASCII CONDUIT
Variables, Expressions, and IO
Introduction to Python
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
CHAPTER FOUR VARIABLES AND CONSTANTS
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Selection Statements Chapter 3.
Presentation transcript:

IDL Tutorials Day 1 Henry (Trae) Winter Room 235

What is IDL? Interactive Data Language that allows for “easy” manipulation of large datasets Many functions and abilities are already defined in a large library. Used by NASA Lockheed-Martin Medical imaging (IDL only)

General Strategies for Mastering IDL Know the problem before you start programming Do searches to see if anyone else has already solved a similar problem (See help menu in IDL (> ? ) and xdoc in sswidl) DON’T MEMORIZE!!!!! Use help screen (Question mark at the command prompt) Keep notes on your work Test logic in small steps Learn by doing

Using sswidlde and the Help Screens SSW stands for Solar Software and allows you access to many data analysis routines that are particular useful to solar physicists Calling sswidl or sswidlde from the unix prompt calls IDL with predefined paths to look for programs. To manually set paths talk to Alisdair or myself about editing your.idl_startup file or your.cshrc file By calling sswidlde you access the IDL developer. This is an “easy” to use graphical interface for writing IDL code. It is not necessary to write IDL code in the developer. Any text editor can be used to write IDL programs Help screens are the best feature of IDL (IMHO)

Quick IDL tour Show ssw command interface Show sswidlde –Command line –Variable watch –Editor window Show help menu example using the HELP procedure Use beginning and end with journal

Basic Variable Types Strings Text Must be contained within “ ” or ‘ ‘ Cannot perform numerical operations Integers You should know these by now Often used for indexing Only ranges from –32,768 to 32,767 Longword integers 64 bit integer X=53l or X=long(53) Floats Most variables used for mathematical operations are of this type Double A float with more memory assigned for accuracy

Assigning a variable a value Variable assignment: –variable_name=value Will automatically select variable type –variable_name=function_name(argument) –variable_name=string(value) –variable_name=long(value) –variable_name=fix(value) –variable_name=double(value)

Naming Variables Variable names have to start with a letter –6a=“gamma” a6=“gamma” Variables cannot have the same name as IDL functions or procedures (Actually, now they can but it’s poor form) –plot=16d Variable names cannot have spaces in them –A 6=5A_6=5 Some characters are illegal or have special meanings. (This is for structures) A+=5

Arrays Arrays are variables of any type that contain multiple values Array Indexing: IDL arrays start with an index of zero Ex. 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 these up using the IDL help Array Operations See help menu

Structures Structures are variables that contain multiple variables (Scalars, arrays, or even other structures) Each variable contained within a structure is called a tag Syntax: struct={[struct_type],Tag_Name1: Tag_Value1, ….} Example: Stars={star_struc,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: I never name my structure type. I prefer to remain anonymous.

Last minute items ? At the command prompt gives you a help menu ; Starts a comment line and is ignored by IDL $ Tells IDL to treat the next line as if it is part of the current line Help gives you information about variables IDL is case and space insensitive. Unix is not! Most math operators work just the way you think they do X=5*3-16 Print,x Remember to journal and show class what it did Show them WILMA