Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 3.05 KB

loaders.rst

File metadata and controls

70 lines (51 loc) · 3.05 KB

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.

Filetype Can load? Partial loading? Can save? Array-level save? Notes

Tipsy Gadget

Yes Yes

Yes No1

Yes Yes

Yes Yes

GadgetHDF Yes No2 No No 3

Ramses NChilada

Yes Yes

No4 Yes

No No

No5 No

,6

GrafIC Yes Yes No No 7

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.

pynbody.snapshot.tipsy

pynbody.snapshot.gadget

pynbody.snapshot.gadgethdf

pynbody.snapshot.nchilada

pynbody.snapshot.ramses

pynbody.snapshot.grafic


  1. Currently these modules do not support the standard partial loading mechanism. However they do allow you to load only certain CPU outputs. For instance if you wish to load CPU 3 data only, in Gadget or GadgetHDF, you simply ask to load the specific file my_snapshot.003 instead of the imaginary file my_snapshot. In Ramses, you add cpus=[3] to your load command, e.g. pynbody.load('output_00080', cpus=[3]).

  2. Currently these modules do not support the standard partial loading mechanism. However they do allow you to load only certain CPU outputs. For instance if you wish to load CPU 3 data only, in Gadget or GadgetHDF, you simply ask to load the specific file my_snapshot.003 instead of the imaginary file my_snapshot. In Ramses, you add cpus=[3] to your load command, e.g. pynbody.load('output_00080', cpus=[3]).

  3. Requires the h5py python module. You can determine whether you have this by typing import h5py into python. If you don't get an error, you have it. If you don't have it, see here <http://www.h5py.org>

  4. Currently these modules do not support the standard partial loading mechanism. However they do allow you to load only certain CPU outputs. For instance if you wish to load CPU 3 data only, in Gadget or GadgetHDF, you simply ask to load the specific file my_snapshot.003 instead of the imaginary file my_snapshot. In Ramses, you add cpus=[3] to your load command, e.g. pynbody.load('output_00080', cpus=[3]).

  5. Ramses gas cells are loaded and converted into gas particles, one at the centre of each maximally refined cell. You can ask to generate the particles at a higher level of refinement by passing in a maxlevel argument. For example, pynbody.load('output_00080', maxlevel=10) will place gas particles at refinement level 10 or (numerically) lower.

  6. Ramses loading is enormously speeded up if you enable the parallel loading facility, which splits the task of loading the multiple files and decoding the awkward format across multiple processes. To do this, you need to install the posix_ipc module which should be as simple as typing easy_install posix_ipc into your shell. See also important notes on posix_ipc.

  7. These are initial conditions generated by Bertschinger's GrafIC or Prunet et al's MPGrafIC.