Code-specific loaders

Contents

Code-specific loaders#

Pynbody uses a number of different modules behind the scenes to take care of loading files in different formats. Unfortunately not all of these have the same capabilities; see below.

The end-user rarely needs to worry about the implementation of different loaders, as all types of simulations are loaded with pynbody.load() and the type is determined automatically.

tipsy#

Implements classes and functions for handling tipsy files. You rarely need to access this module directly as it will be invoked automatically via pynbody.load.

Input:

filename: file name string

Optional Keywords:

paramfile: string specifying the parameter file to load. If not specified, the loader will look for a file *.param in the current and parent directories.

Implements reading old-style gadget binary files (format 1 and 2, but not HDF5).

The gadget array names are mapped into pynbody array names according to the mappings given by the config.ini section [gadget-name-mapping].

Very old gadget-1 style files have a fixed block order, which is specified in the config.ini section [gadget-1-blocks].

Implements reading HDF5 Gadget files, in various variants.

The gadget array names are mapped into pynbody array names according to the mappings given by the config.ini section [gadgethdf-name-mapping].

The gadget particle groups are mapped into pynbody families according to the mappings specified by the config.ini section [gadgethdf-type-mapping]. This can be many-to-one (many gadget particle types mapping into one pynbody family), but only datasets which are common to all gadget types will be available from pynbody.

Spanned files are supported. To load a range of files snap.0.hdf5, snap.1.hdf5, … snap.n.hdf5, pass the filename snap. If you pass e.g. snap.2.hdf5, only file 2 will be loaded.

Implements loading of nchilada files.

Implements classes and functions for handling RAMSES files.

Note that AMR cells are loaded as particles, although this works surprisingly well for most analysis purposes. In particular SPH image generation routines automatically switch on an appropriate de-noising scheme to provide effective interpolation between cells.

Support for loading grafIC initial conditions files