readgadget: Read Gadget simulation data

Description Usage Arguments Value Author(s) See Also

View source: R/readgadget.R

Description

Reads astrophysical N-body data output by the Gadget code (versions 1/2/3/4, see https://wwwmpa.mpa-garching.mpg.de/gadget4). Binary and HDF5 formats can be read.

Usage

1
readgadget(file, type = "auto")

Arguments

file

filename of file to load

type

character specifying the data format. Must be either of: bin for binary format, hdf for HDF5 format or auto to automatically determine the format from file extension.

Value

Returns a list containing the particle data, structured very similarly to the HDF5 format, even for binary files. When reading a binary file, some of the entries in the header are duplicated for compatibility between old (binary) and new (HDF5) parameter names: e.g. NumPart_ThisFile=Npart, NumPart_Total=Nall, MassTable=Massarr (for more, see Table 4 of https://wwwmpa.mpa-garching.mpg.de/gadget/users-guide.pdf).

Author(s)

Danail Obreschkow

See Also

writegadget


obreschkow/simstar documentation built on Jan. 29, 2022, 2:16 p.m.