Read and write tipsy files as numpy arrays. Tipsy is a binary data format used in PKDGRAV3.
See examples folder.
field name: | time | n | dims | n_gas | n_dark | n_star | pad |
---|---|---|---|---|---|---|---|
dtype: | f8 | i4 | i4 | i4 | i4 | i4 | i4 |
explanation: | Usually expansion factor for cosmology simulations, or time in pkdgrav3 units for non-cosmological simulations. | n_gas +n_dark +n_star | Spatial dimensions, 1, 2 or 3. | # of gas particles | # of dark matter particles | # of star particles | 4 byte padding in case header is a struct that needs to be aligned to 8 bytes. |
n_gas + n_dark + n_star particles in the format
field name: | mass | r | v | rho | temp | hsmooth | metals | phi |
---|---|---|---|---|---|---|---|---|
dtype: | f4 | {f4, dims} | {f4, dims} | f4 | f4 | f4 | f4 | f4 |
explanation: | Mass | Position | Velocity | Density | Temperature | Smoothing length | Metalicity of the particle. | Gravitational potential |
field name: | mass | r | v | eps | phi |
---|---|---|---|---|---|
dtype: | f4 | {f4, dims} | {f4, dims} | f4 | f4 |
explanation: | Mass | Position | Velocity | Softening length | Gravitational potential |
field name: | mass | r | v | metals | tform | eps | phi |
---|---|---|---|---|---|---|---|
dtype: | f4 | {f4, dims} | {f4, dims} | f4 | f4 | f4 | f4 |
explanation: | Mass | Position | Velocity | Metalicity | Time when star was formed. | Softening length | Gravitational potential |
The tipsy file can either be saved in big or little endian format. This is tested by reading the header and checking if the dims is equal to 1, 2 or 3.