pynbody.analysis.ramses_util

pynbody.analysis.ramses_util#

RAMSES-specific analysis utilities

This module provides utilities for working with RAMSES simulations, in two main areas as below.

File Conversion#

For running AHF or pkdgrav, you can convert ramses files to tipsy format using

>>> pynbody.analysis.ramses_util.convert_to_tipsy_fullbox('output_00101') # will convert the whole output

Now you can run AHF or pkdgrav using the file named output_00101_fullbox.tipsy as an input or

>>> s_tipsy = pynbody.load('output_00101_fullbox.tipsy')

You can also just output a part of the simulation :

>>> s = pynbody.analysis.ramses_util.load_center('output_00101', align=False) # centered on halo 0
>>> pynbody.analysis.ramses_util.convert_to_tipsy_simple('output_00101', file = pynbody.filt.Sphere('200 kpc')

Now we’ve got a file called output_00101.tipsy which holds only the 200 kpc sphere centered on halo 0.

Generating tform#

Raw RAMSES outputs write the tform array in unusual units. In pynbody v2, when the user requests the tform array, it is converted to physical units using this module’s routine get_tform(). This happens transparently and for most users it will not be necessary to call this function directly.

Functions

convert_to_tipsy_fullbox(s[, write_param])

Convert RAMSES file output to tipsy format readable by pkdgrav and AHF.

convert_to_tipsy_simple(output[, halo, filt])

Convert RAMSES output to tipsy format readable by e.g. pkdgrav or AHF.

get_tform(sim, *, times_are_proper[, ...])

Convert RAMSES times to physical times for stars and replaces the original

get_tipsy_units(sim)

Return the units in the pkdgrav/gasoline unit system for a RAMSES snapshot sim.

write_ahf_input(sim, tipsyfile)

Write an input file for AHF for the RAMSES snapshot sim and the converted tipsy file tipsyfile

write_tipsy_param(sim, tipsyfile)

Write a pkdgrav-readable parameter file for the given RAMSES snapshot