HNBody Version 1.0.10

- Main Page
- Related Pages
- Data Structures
- Files

SM Macro Library

# Introduction

A SuperMongo (SM) library to support HNBody is included in HNBody downloads. Files with .sm extensions are SuperMongo plotting routines. SM is a widely-used plotting package that runs on Linux and Unix platforms; help on SM itself is available at http://www.astro.princeton.edu/~rhl/sm/. Simple plotting of one HNBody variable against another as well as more sophisticated macros are provided. The user may also write customized high-level macros that utilize the low-level macros provided in `hnblib.sm`.

# Library Installation

Four SM files ( hnblib.sm, hnbpreferences.sm, hnbhelp.sm, default) should be copied to their own directory (e.g. `/home/user/sm/hnblib`); this directory is named smdir in hnblib.sm.

# Using the Library

After starting up SM, run the following commands to access and initialize `hnblib.sm:`

      SM> define smdir "/home/user/sm/hnblib"
      SM> macro read "$!smdir/hnblib.sm"
      SM> hnbinit

where the quoted string in the first command is the path to your copy of `hnblib.sm`. If the third command produces output similar to the following, you are in business!

    Welcome to HNBLIB!
    -------------------------------------------------------------
    HNBLIB:   SUPPORTED MACROS
    getfiles  - Returns a list of files from which to read data
    getvars   - Returns a list of variables to be plotted
    hnb       - Make the default plot
    hnbhelp   - Get help on any HNBLIB macro
    hnbinit   - Read preferences and reset HNB variables
    hnbplot   - Plot all columns from the current data file vs. column 1
    hnbpref   - Adjust user preferences
    hnbread   - Read data from a specified HNB file
    hnbthin   - Thin the data by plotting every Nth point
    hnbzoom   - Adjust the limits on the x-axis
    multiplot - Plot multiple columns of data on one screen
    plot      - Plot y versus x with default labels
       >>> type hnbhelp macroname for more information <<<
    -------------------------------------------------------------

# Automatic Initialization

To automatically access and initialize `hnblib.sm` on SM startup, add the following line to the ``.sm file in your home directory:

    macro2          /home/user/sm/hnblib/

The second entry is the path to your hnblib directory (the same as smdir , above). Users who already have their own `macro2/` directory and `default` file will need to manually add the contents of `hnblib/default` to their personal default file (and change the value of smdir appropriately).