mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-22 22:58:02 +00:00
add velocity conversion
This commit is contained in:
parent
858a153fad
commit
1037aa4db9
1 changed files with 16 additions and 0 deletions
|
@ -199,6 +199,22 @@ class BoxUnits:
|
|||
"""
|
||||
return self.box2kpc(length) * 1e-3
|
||||
|
||||
def box2vel(self, vel):
|
||||
r"""
|
||||
Convert velocity from box units to :math:`\mathrm{m} / \mathrm{s}^2`.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
vel : float
|
||||
Velocity in box units.
|
||||
|
||||
Returns
|
||||
-------
|
||||
vel : float
|
||||
Velocity in :math:`\mathrm{m} / \mathrm{s}^2`
|
||||
"""
|
||||
return vel * (1e-2 * self._unit_l / self._unit_t / self.aexp)
|
||||
|
||||
def box2cosmoredshift(self, length):
|
||||
r"""
|
||||
Convert the box comoving distance to cosmological redshift.
|
||||
|
|
Loading…
Reference in a new issue