tardis.io.model.arepo package

Submodules

Module contents

class tardis.io.model.arepo.ArepoData(time: ~astropy.units.quantity.Quantity | float, position: ~numpy.ndarray, velocities: ~numpy.ndarray, densities: ~numpy.ndarray, mass: ~numpy.ndarray, isotope_dict: dict = <factory>)[source]

Bases: object

Data structure for Arepo snapshot data.

Parameters:
timeastropy.units.Quantity or float

Time of the snapshot. If a float is provided, it is assumed to be in seconds.

posnumpy.ndarray

Position array in Cartesian coordinates (3, N) in cm.

velnumpy.ndarray

Velocity array in Cartesian coordinates (3, N) in cm/s.

rhonumpy.ndarray

Density array in g/cm^3.

massnumpy.ndarray

Mass array in g.

nuc_dictdict

Dictionary of nuclear mass fractions keyed by species name.

densities: ndarray
isotope_dict: dict
mass: ndarray
position: ndarray
property species: list[str]

Get list of species names.

Returns:
list of str

Species names from nuc_dict keys.

time: Quantity | float
velocities: ndarray
property volume: ndarray

Calculate volume from mass and density.

Returns:
numpy.ndarray

Volume array in cm^3.

tardis.io.model.arepo.read_arepo_snapshot(filename: str | Path, species: list[str], speciesfile: str | Path, alpha: float = 0.0, beta: float = 0.0, gamma: float = 0.0) ArepoData[source]

Read an Arepo snapshot file and return ArepoData.

Loads relevant data from an Arepo snapshot for conversion to TARDIS model. Requires arepo-snap-util to be installed. The snapshot is rotated according to the provided Euler angles.

Parameters:
filenamestr or pathlib.Path

Path to the Arepo snapshot file.

specieslist of str

Names of the species to be exported. Must match the species-file of the Arepo simulation.

speciesfilestr or pathlib.Path

File specifying the species used in the Arepo simulation.

alphafloat, optional

Euler angle alpha (yaw) for rotation of the desired line-of-sight to the x-axis. Default: 0.0

betafloat, optional

Euler angle beta (pitch) for rotation of the desired line-of-sight to the x-axis. Default: 0.0

gammafloat, optional

Euler angle gamma (roll) for rotation of the desired line-of-sight to the x-axis. Default: 0.0

Returns:
ArepoData

Data structure containing the Arepo snapshot data.

Raises:
ImportError

If arepo-snap-util is not installed.