-
Notifications
You must be signed in to change notification settings - Fork 1
tipsy format
Tipsy format is a asccii binary file format produced by various particle codes including gasoline, ChaNGa and TreeSPH. Tipsy format can be read and viewed with the Tipsy 3d visualization program by Neal Katz and Tom Quinn.
The basic format is defined by this C header file:
tipsydefs.h
There is a header:
double time ;
int nbodies ;
int ndim ;
int nsph ;
int ndark ;
int nstar
Followed by all the gas, all the dark and all the star particles in their respective formats given in tipsydefs.h
There are 3 major variants of the format and some minor sub-variants.
Tipsy ascii format contains all the data as raw ascii text (human readable).
Tipsy binary format contains all the data in the native binary format of the computer. Given that most machines are Intel-based this is mostly little endian format. Unfortunately, C compilers do not reliably choose the same size for the header which contains 28 bytes of data but may be padded to 32 bytes and confuse file readers.
Tipsy standard format contains all the data in binary big endian format, converted using the xdr library. The header file should always be 32 bytes in this format.
Note that all the particle data is stored as 4-byte standard float variables. Many readers assume 3 dimensional data (MAXDIM = 3) even though technically the number of dimensions is specified in the header (ndim).
struct gas_particle {
Real mass;
Real pos[MAXDIM];
Real vel[MAXDIM];
Real rho;
Real temp;
Real eps;
Real metals ;
Real phi ;
} ;
struct dark_particle {
Real mass;
Real pos[MAXDIM];
Real vel[MAXDIM];
Real eps;
Real phi ;
} ;
struct star_particle {
Real mass;
Real pos[MAXDIM];
Real vel[MAXDIM];
Real metals ;
Real tform ;
Real eps;
Real phi ;
Various tools such as printtipsy, pynbody and pytipsy are able to automatically detect these formats based on the header data and file size.
The Tipsy tools (see: https://github.com/N-BodyShop/tipsy_tools) utility programs can convert between tipsy formats and other popular formats like the Gadget snap format. There are other utilities for Nchilada format but not in tipsy tools.