This HTML automatically generated with rman for NEMO
Table of Contents

Name

snapshell - compute statistics of bodyvariables in a set of "radial"

shells

Synopsis

snapshell in=snap_file [parameter=value] ...

Description

snapshell computes selected diagnostics and their statistics from an N-body snapshot in a set of shells in an arbitrary body variable (default rvar=r being the radius). The snapshot must have been properly centered and oriented using other tools (e.g. snapcenter(1NEMO) and/or snaprect(1NEMO) ), as well have been sorted in rvar. See snapsort(1NEMO) how to sort a snapshot.

Normally the shell radii are explicitly set (optionally normalized) in rvar space, by setting cumulative=t the mvar= variable is used to compute a cumulative mass in each shell, still sorted by rvar of course.

An arbitrary weighting may be specified for each particle.

The output will be an ascii table, in which for each variable it will print a selected set of statistics (e.g. mean, dispersion, min, max, skewness, kurtosis, number of particles). Shells with no particles are not output however.

Optionally a viewing axis (as seen from the center) can be selected with an opening angle. In this case only the particles within this cone are counted. See cone= and angle= below.

The image (ccd) based program ccdellint(1NEMO) does something similar in 2D.

Parameters

The following parameters are recognized in order; they may be given in any order if the keyword is also given. Use --help to confirm this man page is up to date.
in=snap_file
Input data is read from snap_file, which must be in snapshot(5NEMO) format. Note that only the first snapshot found in this file will be used. No default.
radii=r0,r1,r2,...
A set of radii in nemoinp(3NEMO) format, representing the edges of the shell. They are normalized if normalized=t is used, and their units are in rvar space, unless cumulative=t is used, when they are in cvar units. No default.
pvar=variable
The bodytrans(1NEMO) variable selected for statistics. [Default: vt].
rvar=shell_variable
Default: r
mvar=mass_variable
Default: m
weight=body_weight
Expression used to compute the weight of each body. See bodytrans(1NEMO) for the form of body_weight. Default: 1.0.
axes=x,y,z
Normalization values in X,Y and Z to compute (re-shape) radii. Only used if shells are given in configuration space (i.e. svar= is not used) and need to be ellipsoidal in shape. For certain choices of rvar the use of this keyword has to be taken with care. [Default: 1,1,1]
cone=x,y,z
Central axis of the cone around which particles will be selected [0,0,1].
angle=alpha
Opening angle of the cone to select particles from (-1 means no cone used, or angle > 360). [-1]
stats=print_stats
Statistics selected to print. Allowed values are mean, dispersion, min, max, median, kurt, skew, npt, though minimum match applies. [Default: mean,disp,n].
format=string
Valid C-format descriptor, as used in printf(3) , for tabular output. [default: %g].
normalized=t|f
Should svar= (if used) be done in normalized (0..1) space, and therefore easily allow equal size bins, or in direct svar space (this requires knowledge of the range of the svar variable. [Default: t]
cumulative=t|f
Should the shells be defined in the cumulative (and optionally normalized) space of the cmas variable. This way the number of particles in each shell can be better/differently controlled from selecting them in rvar space. [Default: f]
first=t|f
Should only the first snapshot be processed? [Default: f]
rstats=t|f
Should statistics on r also be added as a third set of columns. This can be handy if you selected a particular rvar and want to see over what radii they apply. [Default: f]

Examples

To get a mean rotation speed in the disk, and the velocity dispersion, for a set of rings:
    % mkdisk - rmax=10 | snapsort - - r | snapshell - 0.01:10:0.1 pvar=vt
    #[rvar] mea  dis  npt  #[pvar] mea  dis  npt
    0.221025 0 1           0.213258 0
    0.347701 0.035125 2    0.318487 0.0270184
    0.468138 0.0260884 2   0.403087 0.0164231
    ...
    9.65953 0.0284596 39   0.319191 0.000455262
    9.7589 0.0288926 40    0.317613 0.00045552
    9.85975 0.0293125 41   0.316035 0.000455434
This results in rings with different numbers of particles (3rd column). By using an appropriate cumulative variable (e.g. mass) one can easily find shells which then contain an equal number of particles. The keyword cumulative=t is used for this:


    % mkdisk - rmax=10 | snapsort - - r | snapshell - 0:1:0.01 cumulative=t mvar=1
normalized=t
where we also needed to use mvar=1 normalized=t,since mkdisk(1NEMO) creates a disk of test particles, and does not by default set the mass of the disk.

In case the particles are sorted by potential from an N-body simulation, one can select shells by particle number (easy way to make the binsizes the same)

    % snapsort run01.dat - phi times=4.0 | snapshell - 0:1:0.01 rvar=phi cumul=t
norm=t
or assign the shells directly in rvar space (this requires you to know the values in svar space):
    % snapsort run01.dat - phi times=4.0 | snapshell - -400:-200:10 rvar=phi cumul=t

Caveats

Although rvar= can be choosen arbitrarely, with a cone selection (i.e. angle>0) any select rvar!=r has probably no meaning.

Ellipsoidal shells may need reshape/sort/reshape?

See Also

snapkinem(1NEMO) , snaprect(1NEMO) , snapsort(1NEMO) , radprof(1NEMO) , ccdellint(1NEMO) , snapshot(5NEMO)

Author

Peter

Teuben

History


13-nov-01    V1.0 created    PJT
14-nov-05    V2.0 some re-write: svar= is now rvar=     PJT
15-nov-05    V2.1 added mvar= and cumulative=    PJT
14-nov-2023    V3.0 added cone= and angle=    PJT
27-nov-2023    V3.1 fix angle to be full opening angle of the cone     PJT


Table of Contents