Coord_Transformation¶
-
cosmo_utils.utils.geometry.
Coord_Transformation
(ra, dec, dist, ra_cen, dec_cen, dist_cen, trans_opt=4, return_dict=False, unit='deg')[source] [edit on github]¶ Transforms spherical coordinates (ra, dec, dist) into cartesian coordinates.
Parameters: ra, dec, dist : array_like, shape (N,)
Arrays of Right Ascension, declination, and distance. Units are [‘degrees’, ‘degrees’, ‘distance_units’]
ra_cen, dec_cen, dist_cen : float, int
Right Ascension, declination, and distance for the center of the coordinates. These correspond to where the corodinates
ra
,dec
, anddist
will be centered.trans_opt : {1, 2, 3, 4} int, optional
Option for cartesian translation/transformation for elements. This variable ist set to
4
by default.- Options:
- 1 : No translation involved
- 2 : Translation to the center point.
- 3 : Translation
and
rotation to the center point. - 4 : Translation and 2 rotaitons about the center point
return_dict : {True, False},
bool
, optionalIf
True
, this functions returns 2 dictionaries withspherical
andcartesian
coordinates. IfFalse
, it returns apandas.DataFrame
with the columns. This variable is set toFalse
by default.unit : {‘dec’,’rad’} str, optional
Unit of
ra1
,ra2
,dec1
, anddec2
. This will also determine the final unit that outputs this function. This variable is set todeg
by default.Returns: coord_dict (coord_pd) : python dictionary
Dictionary with spherical and cartesian dictionary of elements based on
trans_opt
value. This value is returned ifreturn_dict
is set toTrue
. If not, apandas.DataFrame
is return.