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, anddistwill be centered.trans_opt : {1, 2, 3, 4} int, optional
Option for cartesian translation/transformation for elements. This variable ist set to
4by default.- Options:
- 1 : No translation involved
- 2 : Translation to the center point.
- 3 : Translation
androtation 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 withsphericalandcartesiancoordinates. IfFalse, it returns apandas.DataFramewith the columns. This variable is set toFalseby 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 todegby default.Returns: coord_dict (coord_pd) : python dictionary
Dictionary with spherical and cartesian dictionary of elements based on
trans_optvalue. This value is returned ifreturn_dictis set toTrue. If not, apandas.DataFrameis return.