nbodykit.io.tpm

Classes

TPMBinaryFile(path[, precision]) Read snapshot binary files from Martin White’s TPM simulations.
class nbodykit.io.tpm.TPMBinaryFile(path, precision='f4')[source]

Read snapshot binary files from Martin White’s TPM simulations.

These files are stored column-wise with a format, with a header of size 28 bytes to begin the file.

The columns are:

  • Position : ‘f4’, ‘f8’ precision
    the position data
  • Velocity : ‘f4’, ‘f8’ precision
    the velocity data
  • ID : ‘u8’ precision
    integers specfiying the particle ID
Parameters:
  • path (str) – the path to the binary file to load
  • precision ({'f4', 'f8'}, optional) – the string dtype specifying the precision

References

White M., 2002, ApJS, 579, 16

Attributes

columns A list of the names of the columns in the file.
dtype A numpy.dtype object holding the data types of each column in the file.
ncol The number of data columns in the file.
shape The shape of the file, which defaults to (size, )
size The size of the file, i.e., number of rows

Methods

asarray() Return a view of the file, where the fields of the
get_dask(column[, blocksize]) Return the specified column as a dask array, which
keys() Aliased function to return columns
read(columns, start, stop[, step]) Read the specified column(s) over the given range