Unix* part 2 for Astronomy 695


  1. PuTTY

    If you must use Windows, PuTTY is a free ssh client. It also has an scp program and an sftp program for secure copying and ftping. It does not need to be installed. Just download and run the executable. This is extremely highly recommended if you connect to other computers remotely from a Windows machine.

  2. Unix and GNU software (including X) for other OSes:

    For Windows, check out Cygwin
    For Mac OS X (I know it is based on BSD, but it doesn't come with most of the useful standard Unix stuff) there is Fink.

  3. Astromake

    Astromake (by Peter Teuben) is a tool to load some software on your machine that are not installed by default. This includes PGPlot, a more recent version of Mozilla, the Intel Compilers, and several others. This is for GNU/Linux only.

    To use, in your .tcshrc (bash users are on your own), include the line:
    source /astromake/astromake_start
    Remember, unless unless you log out and then back in, you must type source .tcshrc for changes to count. Then, to see what is available, type:
    astroload -v
    To actually load one of the programs type (or include in you .tcshrc file) astroload followed by the name of the program you want.

  4. Latex

    A little too much to go into, but some good resources are the book Latex A document Preparation System by Lamport and the following sites for lists of the symbols in math mode: http://omega.albany.edu:8008/Symbols.html and http://www.agu.org/symbols.html.
  5. IO redirection and pipes

    Basic Unix philosophy is to string together commands that do very specialized things. And, everything is a file. This includes the screen and the keyboard. So, if a program (e.g., ls) normally outputs to the screen, you can type: ls > file and it will output to the file (erasing the file if it already exists. ls >> file puts the output the command at the end of file. command < file allows you to give the contents of a file to a command instead of the keyboard input (I use the output one a lot more than the input one).
    Pipes ( | ) let you take the output from one command and give it to another command as input. For example, what does this command do?
    ls *.dat | grep name | wc -l
  6. Plotting:

    Several of the commonly used programs in the department are IDL, sm, PGPlot, and gnuplot.

    1. IDL

      This has far more features than any of the other plotting software listed here and can read and write tons of formats. This also makes it the hardest to use for quick little plots. It is big and expensive. If you use it, by far, the single best site about it is Coyote's Guide to IDL Programming. Don't bother with the printed manuals as they are hopelessly out of date (but the online ones which you get to by typing ? in IDL are okay).

    2. sm

      This is popular in the department, so there are lots of people to talk to about it. Not free.

    3. pgplot

      This is old school Fortran plotting. Great if you want control over every aspect of your plots and don't care about things like ease of use. If you actually want to use it, you probably want PGPerl. PGplot is used as the backend for programs like WIP, but some people (like me) use it with PGPerl for most of their plotting.

    4. gnuplot

      Gnuplot is simple, easy to script, free, but somewhat limited plotting package. Good for quick plotting. Two good tutorials are at: http://www.cs.uni.edu/Help/gnuplot/ and http://www.duke.edu/~hpgavin/gnuplot.html.
      Here is an example data file we can look at.
      Here is an example use of gnuplot. To use this, type gnuplot at your prompt. At the gnuplot prompt, type load "demo.plot".
      Here is the same example, only it produces a postscript output file.

  7. Basic scripting.

    We can break scripting up into two types: shell scripting and stand alone scripting languages (Perl, Python, etc.). Many people in the department use C Shell scripting, although bash is the more common default shell on most computers these days (both Linux and OS X). C shell scripting has a C like syntax and relies primarily on the use of regular shell commands.

    For scripting, I'm going to give some examples using Perl since I don't do any shell scripting. The best way to learn Perl is with the book Learning Perl by Schwartz and Phoenix. Multiple people in the department have copies, but it is worth buying if you are serious about Perl. Also helpful is the site www.perldoc.com
    Go here for some basic perl

Back to John C. Vernaleo's home page