AST325: Making plots with SM (SuperMongo)
SM is a very handy plotting package, accessed from your UNIX
command-line. It can be run in a couple of ways (including calls from
a Fortran or C program).
What I most often use (and is probably most convenient for you) is
running sm on the commandline with an input file. That is, on the
unix commandline you type "sm < input.sm", which means "run SM,
getting all input commands from the file input.sm".
SM reads in column data from simple text files. These could be
anything from short value lists you've hand-edited in emacs to full
spectra you've created from 1-D FITS files in IRAF using "listpix".
The only important thing is that the data columns be separated by
spaces or tabs.
SM has an extensive online manual, available at
www.astro.princeton.edu/~rhl/sm/sm.html.
But, to get you started more quickly, here's a very simple example...
Say I have a text file of data, which I've made by hand in emacs,
showing aperture versus signal-to-noise ratio. Here's what the data
file, named "sn.dat", looks like:
5 7
10 11
15 9
20 3
Now I make a new file in emacs which contain instructions for SM. The
file is named "signal.sm", and it looks like this:
dev postencap "signal.eps"
data "sn.dat"
read {a 1 s 2}
limits 0 25 0 15
box
points a s
xlabel "aperture (pixels)"
ylabel "S/N"
The first line of the SM input file specifies that output should be an
encapsulated postscript file, named "signal.eps".
The next line gives the data filename.
The third line says to read the contents of the data file into two
variables, a and s.
Then the limits of the plot are given (in format xmin xmax ymin
ymax),
and the box of axes is drawn.
The sixth line says to draw the datapoints corresponding to a
and s,
and finally the labels to be drawn on the axes.
To execute these commands and make the plot, I just type
"sm < signal.sm" in the unix terminal. SM runs with the given set of
instructions, and I get a plot that looks like this:

And I can view the image with the unix command "gv signal.eps". That's it!
Here are a couple other (slightly more complicated) examples to
work from:
Running sm on the file lines.sm makes a
postscript version of this plot;
to try it for yourself you'll need these data files:
obj0907_1.model.tab and
obj0907_1.tab.err.mag.
And running SM on points.sm makes a postscript
version of this plot;
it requires these two data files:
a2390.par and cnoc2.par.
back to my course page