Constants and conversion factors

c2raytools.conv.gridmass_to_msol(grid_mass)

Convert a halo mass from simulation grid units to solar masses

Parameters:
  • gridmass (float or numpy array): the mass in grid mass units
Returns:
The mass in log10(Msol)
c2raytools.conv.gridpos_to_mpc(gridpos)

Convert a position or length in simulation grid units to Mpc

Parameters:
  • gridpos (float or numpy array): the position in simulation grid units
Returns:
The position converted to Mpc with the origin unchanged
c2raytools.conv.gridvel_to_kms(gridvel, z)

Convert a velocity in simulation grid units to km/s

Parameters:
  • gridvel (float or numpy array): the velocity in simulation grid units
  • z (float or numpy array): the redshift
Returns:
The velocity in km/s
c2raytools.conv.set_sim_constants(boxsize_cMpc)

This method will set the values of relevant constants depending on the simulation

Parameters:
  • boxsize_cMpc (float): the box size in cMpc/h

Valid values are 37, 64, 114, 425 or 500

Returns:
Nothing.

Previous topic

Various analysis functions

Next topic

Utility functions

This Page