From e4ec1c4daaed6529d70dc458a2a4d926da7ef19e Mon Sep 17 00:00:00 2001 From: rstiskalek Date: Sun, 6 Nov 2022 20:55:34 +0000 Subject: [PATCH] rm unused functions --- csiborgtools/units/__init__.py | 3 +- csiborgtools/units/transforms.py | 53 -------------------------------- 2 files changed, 1 insertion(+), 55 deletions(-) diff --git a/csiborgtools/units/__init__.py b/csiborgtools/units/__init__.py index 2244914..0796f7b 100644 --- a/csiborgtools/units/__init__.py +++ b/csiborgtools/units/__init__.py @@ -13,6 +13,5 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -from .transforms import (cartesian_to_radec, convert_mass_cols, # noqa - convert_position_cols) # noqa +from .transforms import cartesian_to_radec # noqa from .box_units import (BoxUnits, convert_from_boxunits) # noqa diff --git a/csiborgtools/units/transforms.py b/csiborgtools/units/transforms.py index 3d02db2..fe6299b 100644 --- a/csiborgtools/units/transforms.py +++ b/csiborgtools/units/transforms.py @@ -16,15 +16,9 @@ Various coordinate transformations. """ - 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"): r""" 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 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