Introduction To IDL Computer Programming
Instructor: John Johnson (JohnJohn)
Webpage: http://astron.berkeley.edu/~johnjohn
Email: johnjohn (at) astron (dot) berkeley (dot) edu
Very important websites:
David
Fanning’s Tips & Tricks Consider this our textbook
Alphabetical
List of Standard IDL Routines
Astronomy IDL
Libraries (Astro-specific IDL)
IDLWave (Emacs users)
CVS:
Concurrent Versions System for software and project development
Syllabus:
Week 1: Getting To
Know IDL
- Working
from the command line
- Variables
and data types
- Basic
Math and Logical Operators
- Customizing
your IDL session using the .idlenv and .idl_startup files
- Using
journal to keep track of your
session
- Running
your journal file as a batch script
- Loops
and conditionals
- Writing
a main-level IDL program
Reading Assignment 1:
- Floating
Underflow Errors in IDL Ever wonder about the Floating
Underflow error? Even if you haven’t, check this out because you will run
into this eventually.
- The Order of
Things Focus on the chart for now
since the examples in this article use a lot of pointer variable stuff
that we’ll get to later.
Week 2: Digging Into
IDL
- Functions
vs. procedures
- Pseudo
coding and commenting
- Compiling
programs
- Scope
of procedures and functions
- Positional
parameters
- Keyword
parameters, n_params() n_elements(), and keyword_set()
- Keyword
inheritance
- Helping
the user and other initialization issues
- Intro
to vectors (?)
Reading Assignment 2:
HW Assignment 1
Solutions: fib.pro
Additional Material:
- Here is
the finished version of the Casino War game that I was demonstrating in class this week. Take a look at
it and read the comments. You should also download it into your ~/idl/
directory and play the game and think about how to improve the code.
Week 3: IDL As A
Vector-based Language I.
- Vectors
(1-D arrays)
- Accessing
array elements
- Old
School looping example
- New
school one-liners
- Generating
and initializing arrays with indgen()
et al. and intarr() et al.
- The
endless utility of where()
- Other
wonderful little array operators (sort,
uniq, min, max, shift, reverse, etc)
Reading Assignment 3:
HW Assignment 2
Solutions: fillarr.pro,
gaus.pro, mc_pi.pro
Week 4: IDL As A
Vector-based Language II.
- More
on vectors
- Cool
1-D tricks of the trade
- Histogram(), I knew ye not!
Reading Assignment 4:
HW
Assignment 3
Solutions: findel.pro integrate.pro plot_hist.pro
Week 5: Fun With
Strings
- String
variables
- String
operations
- Printing
to the screen
- Formatting
- ASCII
I/O
- Interacting
with Unix from IDL
HW
Assignment 4
Solutions: sigfig.pro
Erik Rosolowski’s version: sigfig.pro
Week 6: FITS Files
- Dealing
with Astronomy’s ubiquitous storage format
- 2D
arrays
- Matrix
operations
- Fanning
a vector
- Avoiding
the first position asterisk
HW
Assignment 5
Solutions: makecirc.pro gauss2d.pro multi_gauss.pro
Week 7: The
All-Important Data Structure
- Intro
to data structures
- Also,
how to use MPFIT
HW
Assignment 6
Solutions: gaussfit2d.pro
Week 8: Pseudo
Object Oriented Programming (POOP)
- This
is where we start doing some serious programming. We ll learn how to use
IDL to manage large projects effectively and efficiently using data
structures.
HW
Assignment 7
Solutions: eb_makeobs.pro
Week 9: How to
approach a large programming task.
HW Assignment 8
Week 10:
Implementing POOP (Big Programming Assignment)
HW Assignment 9
Week 13: Fun with
pointers
HW Assignment 10
Week 14: Keeping
your project concurrent using CVS. Guest speaker: Marshall Perrin
Week 15: How to not piss off your audience with your graphics.
Designing effective figures. Guest speaker: Tim Robishaw