Table of Contents


snapplotedit - display and edit an N-body snapshot file


snapplotedit insnap-file out [parametervalue] ...


snapplot and its relatives plot a sequence of frames from a standard N-body snapshot file. trakplot is very similar to snapplot, but does not erase and redraw the screen after each frame plotted. editplot has the same plotting capabilities as snapplot, but allows the user to define polygonic areas (using a mouse device), within which all stars are written out to a file. Arbitrary (algebraic) transformations from particle coordinates to plotting coordinates may be specified; the visibility, point type, and color may be controled in the same way.


The following parameters are recognized; they may be given in any order.
Input data is read from snap-file, which must be in snapshot format. No default.
The output file, in case editplot was used. It is best to be in a graphics window, in order to see regular output, such as menus. No default.
Only plot frames with time values within time-range, which is of the form, eg, "1.0:1.5,2.5,3.0". The default is "all".
The value of x-expression is plotted along the X axis. x-expression is a real-valued C language expression over the real values x, y, z, vx, vy, vz, phi, t, and the integer value i. The default is x.
Label for the X axis. The default is the expression given for xvar.
Range of values for the X axis, specified either as a single number (in which case the lower bound is zero) or a pair of numbers separated by a colon. The default range is -2.0:2.0.
See above. The default is y.
Determines the visibility of particles. expression is a integer expression in the above variables; only points with non-zero values are plotted. The default is 1.
Determines the point type and size. expression is a real expression in the above variables; zero means plot a point, positive (negative) means plot a circle (cross) with size controled by absolute value. The default is 0.
Determines the point color. expression is a real expression in the above variables; values between 0 and 1 produce a sequence of saturated colors starting with red, running through the spectrum, and wrapping back to red. The default is 0.
If supplied, this will be the basename of SUN screendumps stored in rasterfile(5) format. Various utilities exist to manipulate rasterfiles, e.g. movie(1NEMO) . Note that snapplot will in general be used in sunwindows mode, whereas movie can only run in native SUN fullscreen mode. Because movie expects the rasterfiles to have basename frame, name must always be frame if the frame option is used. The default is no frame rastefiles stored.


snapplot handles arbitrary C expressions by invoking the compiler, which is general but rather slow. To speed things up, the expressions are first treated as names and checked against a collection of precompiled expressions stored as ".o" files. If a match is found, the precompiled object is used instead. Precompiled transformations include: x, y, z, vx, vy, vz, r, v, vr, vt, jtot, phi, etot, t, and i. A complete list may be deduced by looking in .../nemo/obj/bodytrans/, which is the default repository. It is possible to customize your own transformations and mantain alternate collections; see bodytrans(1NEMO) for more information.


When editplot was invoked, after the usual display has been initialized, the mouse can be used to define a polygon. At the start of every new polygon the program should beep for your attention. The LEFT button can then be used to start and continue entering vertices, and they will also be shown on the screen; the RIGHT button is used to close the polygon. The MIDDLE button can be used to ’erase’ previous vertices (as far back as erasing the initial point, although the already drawn lines cannot be erased from the screen).

After each polygon is closed, the program makes sure all stars within that polygon are flagged to be copied to the output file at the end of your session. You can define new polygons in a loop, until you close a polygon with zero length (using the RIGHT button as initial and last point of the polygon). The program then copies all stars within all polygons to the output file.


Plot snapshot file "r100.dat" frame-by-frame, with default transformations:

% snapplot r100.dat
Plot radius vs radial velocity at times 2.0 through 6.0:

% snapplot r100.dat xvarr xrange0:2 yvarvr times2:6
Plot binding energy vs angular momentum, showing only the first 1000 particles:

% snapplot r100.dat xvaretot xrange-4:0 \
  xlabel"Binding energy" yvarjtot yrange0:0.8 \
  ylabel"Angular momentum" visib"i < 1000"
NB: this last example assumes that "r100.dat" includes potential data in addition to the usual phase-space data. The expression specified for visib will be passed to the C compiler.

See Also

bodytrans(1NEMO) , movie(1NEMO) , snapshot(5NEMO) .


The default ranges should depend on the variables plotted.

The basename for rasterfiles for use with movie must always be frame. See also movie(1NEMO) .

In editplot all snapshots can be edited, but many programs bomb when subsequent snapshots have more particles than the first one. It is not advised to use this mode with multiple snapshots in the output file. Data files with unequal snapshot size have now been taken care of


Joshua E. Barnes.

Update History

xx-xxx-86    Original program    JEB
xx-jul-87    V1.3  various color updates    JEB
23-oct-87    V1.3f added frame= option for movies    PJT
xx-xxx-88    V2.0  new filestruct    JEB
13-aug-88    V2.1  editplot added to the snapplot family    PJT