IDL
IDL is a programming language, and a relatively
high-level one. It can be used for scripting-type
purposes, though, and it's pretty good -- though not
excellent! -- at brute force number crunching.
IDL stands for "Interactive Data Language"
The main important thing to know about IDL, in a practical
sense, is that it is not free (different from everything
else we have talked about this semester). It is expensive,
and is developed and maintained by a for-profit company.
The upside of this is that it is really well supported!
A lot of people use IDL. There are extensive
user forums and user-developed libraries.
IDL is good at arrays. Really good. Imagine you
have an array test that is a 10x10 array,
and that you want to calculate the square root of each
elementin test. In some languages you would
have to create two loops: one to loop over the x dimension
and one to loop over the y dimension. This takes a lot
of code and a lot of time. In IDL, you write it this way:
IDL> newarray=sqrt(test).
What that means is that in IDL you can do array math.
This is what IDL is optimized for. You can do lots of other
things too, but you are being most efficient when you
use IDL to do math.
Therefore if you are ever working on a problem that
is really slow, and computational efficiency is important(**),
the best thing you can do is figure out how to make your
computations array-based, and then IDL will be extremely
efficient, and your calculations will be fast(er).
Because IDL is good at arrays, it is really good
at image analysis and image processing (images are just arrays,
after all).
Astronomy is only a minor player in the larger IDL
world. Much more important (ie, big bucks) are
medical imaging and also GIS stuff.
One thing that I like about IDL is that it is easy
to turn your data into plots. The plots are not pretty,
but they are easy to create and just see what you've
got.
There are also lots of useful built-in
commands, as well as many user-contributed libraries
(like the astronomy library and many others).
You can nest commands in IDL. For example,
IDL> result=histogram(randomn(seed,10000),locations=loc,binsize=0.1,min=-4)
which, as it looks, assigns as output (to result) a histogram
of values of a 10,000 element array of random values.
IDL is also good at strings.
The IDL syntax is not too bad. It's better than perl ....
There are some examples on the homework 2 web page.
You can find some tutorials here, here (this is good -- from the people who
own IDL), and
here,
among many other places.
Now go and do the exercise.
** In most scripting cases, the slow part is not the computer
but the human brain that is trying to figure out what to do, or
what the results mean. In these cases, don't bother trying to
speed up your code. When you are running high performance code,
in which the slow steps are computational, then you should
worry about optimizing your code.