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, and dist 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, optional

If True, this functions returns 2 dictionaries with spherical and cartesian coordinates. If False, it returns a pandas.DataFrame with the columns. This variable is set to False by default.

unit : {‘dec’,’rad’} str, optional

Unit of ra1, ra2, dec1, and dec2. This will also determine the final unit that outputs this function. This variable is set to deg 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 if return_dict is set to True. If not, a pandas.DataFrame is return.