mirror of
https://github.com/Richard-Sti/csiborgtools.git
synced 2024-12-23 02:38:02 +00:00
rm unused functions
This commit is contained in:
parent
9291414572
commit
e4ec1c4daa
2 changed files with 1 additions and 55 deletions
|
@ -13,6 +13,5 @@
|
||||||
# with this program; if not, write to the Free Software Foundation, Inc.,
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
from .transforms import (cartesian_to_radec, convert_mass_cols, # noqa
|
from .transforms import cartesian_to_radec # noqa
|
||||||
convert_position_cols) # noqa
|
|
||||||
from .box_units import (BoxUnits, convert_from_boxunits) # noqa
|
from .box_units import (BoxUnits, convert_from_boxunits) # noqa
|
||||||
|
|
|
@ -16,15 +16,9 @@
|
||||||
Various coordinate transformations.
|
Various coordinate transformations.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
|
|
||||||
little_h = 0.705
|
|
||||||
BOXSIZE = 677.7 / little_h # Mpc. Otherwise positions in [0, 1].
|
|
||||||
BOXMASS = 3.749e19 # Msun
|
|
||||||
|
|
||||||
|
|
||||||
def cartesian_to_radec(arr, xpar="peak_x", ypar="peak_y", zpar="peak_z"):
|
def cartesian_to_radec(arr, xpar="peak_x", ypar="peak_y", zpar="peak_z"):
|
||||||
r"""
|
r"""
|
||||||
Extract `x`, `y`, and `z` coordinates from a record array `arr` and
|
Extract `x`, `y`, and `z` coordinates from a record array `arr` and
|
||||||
|
@ -61,50 +55,3 @@ def cartesian_to_radec(arr, xpar="peak_x", ypar="peak_y", zpar="peak_z"):
|
||||||
ra[ra < 0] += 360
|
ra[ra < 0] += 360
|
||||||
|
|
||||||
return dist, ra, dec
|
return dist, ra, dec
|
||||||
|
|
||||||
|
|
||||||
def convert_mass_cols(arr, cols):
|
|
||||||
r"""
|
|
||||||
Convert mass columns from box units to :math:`M_{\odot}`. `arr` is passed
|
|
||||||
by reference and is not explicitly returned back.
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
----------
|
|
||||||
arr : structured array
|
|
||||||
The array whose columns are to be converted.
|
|
||||||
cols : str or list of str
|
|
||||||
The mass columns to be converted.
|
|
||||||
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
None
|
|
||||||
"""
|
|
||||||
cols = [cols] if isinstance(cols, str) else cols
|
|
||||||
for col in cols:
|
|
||||||
arr[col] *= BOXMASS
|
|
||||||
|
|
||||||
|
|
||||||
def convert_position_cols(arr, cols, zero_centered=True):
|
|
||||||
r"""
|
|
||||||
Convert position columns from box units to :math:`\mathrm{Mpc}`. `arr` is
|
|
||||||
passed by reference and is not explicitly returned back.
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
----------
|
|
||||||
arr : structured array
|
|
||||||
The array whose columns are to be converted.
|
|
||||||
cols : str or list of str
|
|
||||||
The mass columns to be converted.
|
|
||||||
zero_centered : bool, optional
|
|
||||||
Whether to translate the well-resolved origin in the centre of the
|
|
||||||
simulation to the :math:`(0, 0 , 0)` point. By default `True`.
|
|
||||||
|
|
||||||
Returns
|
|
||||||
-------
|
|
||||||
None
|
|
||||||
"""
|
|
||||||
cols = [cols] if isinstance(cols, str) else cols
|
|
||||||
for col in cols:
|
|
||||||
arr[col] *= BOXSIZE
|
|
||||||
if zero_centered:
|
|
||||||
arr[col] -= BOXSIZE / 2
|
|
||||||
|
|
Loading…
Reference in a new issue