This HTML automatically generated with rman for NEMO
Table of Contents

Name

tipsysnap - convert tipsy file to snapshot

Synopsis

tipsysnap [parameter=value]

Description

tipsysnap converts a tipsy ascii or binary formatted data file, consisting of gas, dark and star- particles to snapshot(5NEMO) format. Simple selections by particle kind can be made.

Parameters

The following parameters are recognized in any order if the keyword is also given:
in=
Input TIPSY file. No default.
out=
Output snapshot file. If not supplied, only header information is displayed.
options=
Output which particles?. Valid options are gas, dark and star. Default: gas,dark,star (all).
modes=ascii|binary
Read ascii or binary TIPSY file format. Default: binary
swap=t|f
Swap bytes. This is needed if you want to be able to read standard (XDR, big endian) or native binary files. Default: false.
offset=0
Number of bytes to offset the data portion from the header. Normally this would be 0, but the header structure (tipsydefs.h) containing one double and 5 integers, some architectures may read this as 32 bytes, whereas it was meant to be 28 bytes. By using offset=-4 in this case, data with 28 byte headers can still be read. Equally so, the opposite can also happen, in which case offset=4 is needed. Some version of the format use the last 4 bytes as a version ID, an integer that can be 1 or 2. See tipsy(5NEMO) . The hexdump -C program may help identify problems. Default: 0
boom=t|f
If the tipsy file has extra accellerations and potentials stored, the version should be 6. Default: f

Examples

In case multiple flavors of particles are read, they are deposited in different SnapShot’s in the file. snapmerge(1NEMO) needs to be used to make one snapshot. For example the standard run99.bin from the tipsy source code distrution has all 3 flavors:
   tipsysnap run99.bin -  |  snapmerge - run99.snap
   ### nemo Debug Info: time=14.9708 N=8579 (1049,1021,6509) for gas,dark,star
   version=0
   ### nemo Debug Info: header = 32  gas = 48   dark = 36  star = 44 bytes

Some codes (e.g. Bonsai) write a different tipsy file for each dump time. this complicates the pipe approach of NEMO. Below is a script could process tipsy files into a NEMO snapshot, or into a pipe for further processing:

     ./tipsy_to_snap out.snap out_*.*
or
     ./tipsy_to_snap  -  out_*.* | tsf -
#! /usr/bin/bash
#
if [ "$#" == "0" ]; then
    echo "Usage:  $0 out.snap tipsy1 tipsy2 ...."
    exit 0
fi
out=$1
if [ -e "$out" ]; then
    echo "Cannot overwrite $out"
    exit 1
fi
shift
for f in $*; do
    # tipsysnap_acc $f - | csf - - item=SnapShot >> tmp.snap
    if [ "$out" == "-" ]; then
        tipsysnap_acc $f -
    else
        tipsysnap_acc $f -  >> $out
    fi
done

Data Format

See also tipsy(5NEMO) on some basic concepts of tipsy data. The ascii format of a TIPSY "gds" (gas-dark-star) snapshot is essentially a single long column of data with the following items
ntot ngas nstar      [noting that ndark=ntot-ngas-nstar]
ndim                 [usually 3, i’ve not see ndim=2 data]
time                 [a floating point number]
M(g),M(d),M(s)       [but all of these in 1 column]
X(g),X(d),X(s)
Y(g),Y(d),Y(s)
Z(g),Z(d),Z(s)
VX(g),VX(d),VX(s)
VY(g),VY(d),VY(s)
VZ(g),VZ(d),VZ(s)
EPS(d), EPS(s)
...

Bugs

In mode=binary the gas, dark and star particles are output in separate snapshots. Use csf(1NEMO) and/or snapmerge(1NEMO) if some or all need to be a a single snapshot. Some properties may be lost in the merging though.

See Also

snaptipsy(1NEMO) , snapmerge(1NEMO) , csf(1NEMO) , stoa_tip(1ZENO) , tipsy(5NEMO)

Author

Peter Teuben

Update History


02-Sep-94    V1.0 Created     PJT
19-aug-00    V2.0 add mode= to allow binary files, added swap=     PJT
28-aug-01    V2.1 process binary data, added offset= (replaces shortlived fix32=t|f)    PJT
4-feb-2022    V3.0 add boom= and make mode=binary the default     PJT
16-jan-2023    V3.3 fix swap= for particle data    PJT


Table of Contents