HTML automatically generated with rman
Table of Contents


snapprint - print out items of a snapshot in table format


snapprint in=snap_in [parameter=value]


snapprint produces a table of values of requested quantities of the bodies in a snapshot. These can be processed with programs such as tabhist, tablsqfit or packages such as mongo, super-mongo and gnuplot. If your processing package is able to read other types of nbody formats, look at programs such as snapgadget(1NEMO) , snaprv(1NEMO) , or snaptipsy(1NEMO) .

snapprint also has an option of producing a table of separations between all bodies of the system. For N bodies this table will have a length of N(N-1)/2, hence the keyword separ will for any non-zero value produce a list which is nsep times smaller and print only nsep’th interaction.


The following parameters are recognized in any order if the keyword is also given:
input file, in snapshot(5NEMO) format [no default]
List of data-items which will be listed, any of the bodytrans(3NEM0) functions can be used in an arbitry expression. [default: x,y,z,vx,vy,vz].
Valid C-format descriptor used in printf(3) to output the numbers. [default: %g].
nsep will for any non-zero value turn off all above options and produce a single table of the logarithm of the separations between the bodies. Only every nsepth entry (the stride) of all N(N-1)/2 combinations will be listed [default: 0].
Time values/intervals of which snapshots should be used. Default is empty string, which will only extract the first snapshot.
If a filename is specified, the table is output to this file. If none, output will be standard output. [default: no file].
Add a header to the output? The header will contain the number of particles, followed by the timestamp, of the snapshot. If masses, position and velocities are output in the table, this format is also referred to as the ntmpv(5NEMO) format. [Default: f]
Should newlines be added between the header elements? [Default: f]
Use CSV (comma separated values) output style. This means a comma, instead of a space, will be used to separate the values in the output stream. Default: false.


Times=time-string does not work, returns btab=NULL, bits=1, i.e. something weird here. Code is identical to snapcenter, which uses same technique.

The inversion function of snapprint, reading a snapshot from a simple table, could be done with tabtos(1NEMO) . Another route is the somewhat complicated ascii file, consisting of a number of catenated tables, that has to be created with a little header. See the "205" format in atos(1NEMO) or stoa(1NEMO) . There are shell scripts which handle some of the cases here.


A single expression like atan2(y,x) is parsed into two.

See Also

tabhist(1NEMO) , tabtos(1NEMO) , mongo users-manual


Peter Teuben


~/src/pjt/nbody     snapprint.c snapprint.1

Update History

18-Mar-88    V1.0: created              PJT
15-Apr-88    V1.1: more options    PJT
6-jun-88    V1.2: new filestruct, added separ keyword    PJT
27-sep-88    V1.3: changed to options keyword    PJT
7-feb-89    V1.5: times= added    PJT
10-feb-89    V1.6: bodytrans can be used     PJT
25-may-90    V1.8: added tab= keyword    PJT
7-jul-97    (V2.0) documented header=    PJT
4-sep-03    V2.2: added csv=    PJT

Table of Contents