Creative Commons License Copyright © Michael Richmond. This work is licensed under a Creative Commons License.

Using Gosnell computers to analyze images

The plan today is for you to use the Mac computer in the Gosnell lab to connect to the computer, which contains some image processing programs. We'll use these programs to analyze data gathered at the RIT Observatory. The first step is for you to learn how to connect to this machine:

Once you have connected to spiff, how can you work with astronomical images? The enhanced goals of today's session are

If we run out of time, we'll continue on Monday.

If all goes well, you'll see a new window on the desktop

It's possible to alter the properties of the window to some degree -- I'll discuss this in class.

Navigating the directory structure

The spiff computer runs an operating system called "Linux," which is a member of the Unix family. It has a hierachical structure of directories. All students are logged in as the same user. Inside this user's home directory, each student has a subdirectory of its own. When you first connect to spiff, you will be in the home directory. The prompt should look like this:

The last portion of the prompt is the name of the directory in which you are currently working. If you change to another directory, say, richmond, by typing

     cd richmond
you'll see the prompt change:

In general, you will do all your own work inside the subdirectory with your own name. It is a very bad idea for you to play around with material in any other student's directory.

The command

prints a list of files and sub-directories on the screen. By default, it lists the contents of the current directory,

You can print out the contents of another directory(s) by typing its name as the argument(s) to the "ls" command.

Copying files

There is a directory into which I'll place data for all of us to analyze during class. That directory has a special name: $dd. To copy a file from this directory to your own, use the cp command. Here's how to copy one particular image from the $dd directory to your own subdirectory:

The point is, if you make a copy of an image in your own directory, you can modify, edit, or delete the image. You can always go back to retrieve another copy of the original without worrying about errors you might have introduced via improper processing. I would like each student to do all of its work in its own sub-directory.


  1. Copy all the images in the $dd directory into your own directory.

When you reach this point, please pause and look around. If somone nearby is having problems, please help him or her.

Deleting files

After you've used some data, it might just get in your way and clutter up your screen. To delete a file, use the rm command:

You can delete multiple files at once using the "*" character, which will stand for any set of characters in a file name. For example, to get rid of all the files with names starting with a capital "Q", I can do this:

Warning: deleting files can be dangerous. Deleting multiple files all at once with the "*" character can be very dangerous.

Examining images with XVista

Okay, you have the copy in your own sub-directory. Now what? I have written a set of programs for processing astronomical images, called the XVista package. These programs aren't user-friendly, and lack a GUI. You'll have to type the commands by hand -- horrors! Of course, if you want to put together a script of your own commands, you can then run it repeatedly on images ... without having to sit in front of the computer and click mouse buttons.

There is some information available on-line for each XVista command via the man command. For example, for help on the tv command, just type

     man tv

To see more of the man page, type the spacebar. To quit reading the man page, type the "q" key.

You can see a list of the XVista commands and a very brief description of each with

     man xvista

If you prefer, you can read this list of commands in HTML format.

So, let's start with two XVista commands.


Astronomical images in the FITS format have two components: a header, containing human-readable information about the image, and a data section. You can print out the header of an image with the buffers command.

If information scrolls off the top of your xterm window, use the scrollbar to look back at it.

If your terminal doesn't have a scrollbar, you can create one:
  1. move the cursor into the xterm window
  2. press and hold down the "Control" key
  3. press and hold the middle mouse key (press down on the wheel)
  4. slide the mouse to highlight the Enable Scrollbar item
  5. release the mouse buttons

You can use the scrollbar to review text which has scrolled off the top of the window. Place the cursor into the scrollbar region, then press the middle key (wheel) and move the mouse.


  1. On what date did we acquire the image?
  2. At what time did we acquire the image?
  3. How many pixels high is this image? How many pixels wide?

When you reach this point, please pause and look around. If somone nearby is having problems, please help him or her.


The tv command is a workhorse: it displays a FITS image in a new window, and also allows you to do look at individual pixel values, zoom in, zoom out, and make several types of measurement.

The simplest way to use it is like so:

which should pop up a new window to display the image:

If you receive an error message like this:
     read_property: XGetWindowProperty returns wrong number of items
then you need to type
and then try tv again.

You can control the contrast and base level of the displayed image with command-line options to the tv command.

    tv z=0 l=70
where Compare these two versions of the same image: first, displayed via

    tv z=0  l=1000

Next, displayed via

    tv z=0 l=100

You can also use the invert option to switch from white-stars-on-black to the reverse:

    tv z=0 l=100 invert

After you specify invert, all subsequent displays will show the same scheme (black on white) until you explicitly type invert again.

Exercises: Display an image, and find out what all the following things do. Write down the answers to each.
  1. Moving the cursor within the image window.
  2. Clicking the left mouse button.
  3. Clicking the right mouse button
  4. Pressing the following keys:
    • 'r'
    • 'a'
    • 'z'
    • 's'
  5. What do the following command-line options to the tv command do?
    • zoom=2
    • xo=300
    • yo=100

When you reach this point, please pause and look around. If somone nearby is having problems, please help him or her.

Bonus -- if you have time ...

The image called does, in fact, contain that distant body in our solar system named Pluto. It's so distant that it looks just like a star: a small blob of light, spread out over several arcseconds by the blurring of light rays as they pass through our atmosphere. Moreover, it's pretty faint.

Can you locate it in this image?

(Hint: if you know the time and date of the image, you can make a finding chart)

For more information

If you have never used any Linux or Unix system in the past, you may want to read a book or web site which describes the basic shell commands. Here are some possibilities:

Creative Commons License Copyright © Michael Richmond. This work is licensed under a Creative Commons License.