What is IDL or slapping you around with facts - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

What is IDL or slapping you around with facts

Description:

What is IDL?!?! (or slapping you around with facts) IDL Tutorial Day 1. Nick Hill ... IDL cd, /disk/data/bastille/' IDL pwd. To exit IDL, just 'exit' IDL ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 10
Provided by: solarPhys
Category:
Tags: idl | around | facts | slapping

less

Transcript and Presenter's Notes

Title: What is IDL or slapping you around with facts


1
What is IDL?!?!(or slapping you around with
facts)
  • IDL Tutorial Day 1
  • Nick Hill
  • hillnich_at_grinnell.edu

2
Main IDL Points
  • IDL is just another programming language
  • Much akin to FORTRAN
  • We compute with it in a UNIX OS (UNIX and IDL are
    independent things, and IDL is just a program in
    UNIX)

3
UNIX Commands
  • gtpwd gtshows the directory youre currently
    in
  • gtcd path directory gt changes the directory
    location
  • (ex
    cd /disk/drive/nhill)
  • gtcp filename path gt copies files
  • gtls gt lists files
    in a folder
  • gtls sav gt lists files in folder
    ending with .sav
  • gtssh -Y log-in gt secure shell log-in w/
    graphics
  • gtmkdir folder gt makes a folder
  • gtnedit gt opens nedit text editor
  • gtnedit filename gt opens an already
    saved text file, other editors are
    emacs, vi, and pico

4
Starting IDL
  • Any of the following prompts work
  • gt idl
  • gt sswidl
  • - sswidl is loaded with path directories with
    useful solar software (ssw) programs and youll
    consequently use most often
  • gt sswidlde
  • - IDL is loaded with a GUI
  • To enter UNIX command in IDL, use
  • IDLgt ls sav
  • Exceptions are cd and pwd
  • IDLgt cd, /disk/data/bastille/
  • IDLgt pwd
  • To exit IDL, just exit
  • IDLgt exit

5
Notes on Syntax
  • UNIX is case sensitive, IDL is not
  • Up arrow recalls recent IDL commands (down lets
    you subsequently cycle through them)
  • Ctrla and ctrle take you to the beginning and
    end of command lines, respectively
  • allows you to type multiple commands on one
    line
  • IDLgt x fltarr(5) print, x
  • Commas separate arguments in IDL!
  • IDLgt plot, x, y, xtitle x, ytitle y
  • Ctrl-c interrupts a running operation
  • Use when your program is clearly taking longer
    than it should (ie infinite loop)
  • continues a command line (useful in program
    code when commands get long)
  • IDLgt for i 0,4 do
  • IDLgt print, x(i)
  • comments out everything the proceeds after it

6
Variables
  • Types
  • Integer, used mainly for loops or array indices
    (1, 3, 100, etc.)
  • Floating, different from integer by decimal point
    (2.71, 3.14159)
  • String, text stored as a variable
  • Variables are assigned by equating some value on
    the right to text acting as a variable on the
    right
  • IDLgt a 10000.
  • IDLgt b 5.271
  • IDLgt c I study fysics (note any text not a
    variable or command requires quote
    marks)
  • Variations on variables
  • Arrays, a bit like a matrix
  • IDLgt z fltarr(5, 5) creates a 5x5
    matrix-array with 0. in all spots
  • Structures, kind of unique to IDL (at least in my
    experience)
  • Stores text, values, anything as one thing
  • Often get these as a result of data from
    satellites

7
Variables, contd
  • Variable names must begin with a letter
  • Ie 8b is not an allowed variable name
  • Variables cant have a space in them
  • use underscores
  • keeping spaces out of any names is just a good
    idea in UNIX world
  • Dont name variables after IDL functions
  • Ie print 7 is not a good idea
  • All array, vector, and structure indices begin
    with zero
  • multiplication
  • / division
  • addition
  • - subtraction
  • exponentiation

8
Help
  • IDL help, ?
  • IDLgt ?
  • xdoc, opens a widget with solar software program
    code -EXTREMELY USEFUL. If a program crashes
    while youre in IDL, this wont function. You
    have to log out and back in
  • IDLgt xdoc
  • Whats the variable?
  • IDLgt help, x
  • IDLgt help, x, /str
  • Wheres the program?
  • IDLgt which, do_stuff.pro
  • /disk/data/nhill/practice/do_stuff.pro
  • Google
  • Make mistakes and ask for help

9
Practice
Write a Comment
User Comments (0)
About PowerShow.com