synthpop.synthpop_utils.coordinates_transformation
Functions for coordinates transformations following Bovy 2011.
Classes
Functions
|
creates the transformation matrix between galactic and equatorial coordinates |
|
determines the Position Matrix A from Bovy 2011 |
|
translates d, l, b into r, theta, z |
|
Convert from galactic coordinates an distance |
|
Translate from galactocentric cartesian coordinates into |
|
Conversion from Galactic coordinates to Equatorial coordinates |
|
Conversion from Equatorial coordinates to Galactic coordinates |
|
Conversion from u,v,w to v_r, mu_l, and mu_b |
|
Conversion from u,v,w |
Module Contents
- synthpop.synthpop_utils.coordinates_transformation.get_trans_matrix() numpy.ndarray
creates the transformation matrix between galactic and equatorial coordinates
Returns
- trans_matrix :
transformation matrix between galactic and equatorial coordinates
- synthpop.synthpop_utils.coordinates_transformation.getA(longitude_rad: np.ndarray or float, latitude_rad: np.ndarray or float) numpy.ndarray
determines the Position Matrix A from Bovy 2011 Note that R^T is equivalent to A
Parameters
- longitude_rad: float, ndarray
galactic or ecliptic longitude
- latitude_rad: float, ndarray
galactic or ecliptic latitude
Returns
- Andarray
transformation matrix
- class synthpop.synthpop_utils.coordinates_transformation.CoordTrans(sun: synthpop.synthpop_utils.sun_info.SunInfo = None, amp_warp: float = 0, amp_warp_pos: float = None, amp_warp_neg: float = None, r_warp: float = 0, alpha_warp: float = 0, phi_warp_deg: float = 0, phi_warp_rad: float = 0)
- sun = None
- amp_warp_pos = None
- amp_warp_neg = None
- r_warp = 0
- alpha_warp = 0
- phi_warp_rad
- warp_correction(r_kpc, phi_rad)
Correction for the WARP following Chen X. et al. 2019
- dlb_to_rphiz(d_kpc: numpy.ndarray, l_deg: numpy.ndarray, b_deg: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
translates d, l, b into r, phi, z
phi increases along the galactic rotation with a zero point at the position of the sun
Parameters
d_kpc : float, ndarray [kpc] l_deg : float, ndarray [degree] b_deg : float, ndarray [degree]
Returns
r : float, ndarray [kpc] phi_rad : float, ndarray [rad]
polar angle follows the rotation of the galaxy zero point is at the sun.
- zfloat, ndarray [kpc]
hight above/below the galactic plane
- dlb_to_xyz(d_kpc: numpy.ndarray, l_deg: numpy.ndarray, b_deg: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Convert from galactic coordinates an distance to galactocentric cartesian coordinates.
Parameters
- l_degfloat, ndarray, [degrees]
galactic longitude
- b_degfloat, ndarray, [degrees]
galactic latitude
- d_kpcfloat ndarray, [kpc]
distance
Returns
- x,y,zfloat nd_array [kpc]
galactocentric cartesian coordinates
- rphiz_to_xyz(r_kpc: numpy.ndarray, phi_rad: numpy.ndarray, z_kpc: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Translate from cylindrical cartesian coordinates to galactocentric cartesian coordinates the zero point of z follows the warp of the galaxy.
Parameters
r_kpc : float, ndarray [kpc] phi_rad : float, ndarray [rad]
polar angle follows the rotation of the galaxy zero point is at the sun.
- z_kpcfloat, ndarray [kpc]
hight above/below the galactic plane
Returns
- x_kpc,y_kpc,z_kpcfloat, ndarray [kpc]
galactocentric cartesian coordinates
- xyz_to_rphiz(x_kpc: numpy.ndarray, y_kpc: numpy.ndarray, z_kpc: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Translate from galactocentric cartesian coordinates into cylindrical cartesian coordinates, the zero point of z follows the warp of the galaxy.
Parameters
- x_kpc,y_kpc,z_kpcfloat, ndarray [kpc]
galactocentric cartesian coordinates
Returns
r_kpc : float, ndarray [kpc] phi_rad : float, ndarray [rad]
polar angle follows the rotation of the galaxy zero point is at the sun.
- z_kpcfloat, ndarray [kpc]
hight above/below the galactic plane
- static lb_to_ad(l_deg: numpy.ndarray, b_deg: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]
Conversion from Galactic coordinates to Equatorial coordinates
Parameters
- l_degfloat, ndarray [degree]
Galactic longitude
- b_degfloat, ndarray [degree]
Galactic latitude
Returns
- a_degfloat, ndarray [degree]
right ascension
- d_degfloat, ndarray [degree]
declination
- static ad_to_lb(a_deg: numpy.ndarray, d_deg: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]
Conversion from Equatorial coordinates to Galactic coordinates
Parameters
- a_degfloat, ndarray [degree]
right ascension
- d_degfloat, ndarray [degree]
declination
Returns
- l_degfloat, ndarray [degree]
Galactic longitude
- b_degfloat, ndarray [degree]
Galactic latitude
- uvw_to_vrmulb(l_deg: numpy.ndarray, b_deg: numpy.ndarray, dist_kpc: numpy.ndarray, u_kmps: numpy.ndarray, v_kmps: numpy.ndarray, w_kmps: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Conversion from u,v,w to v_r, mu_l, and mu_b Using (vr, vl, vb) = R * (u,v,w) from Bovy 2011
Parameters
- l_degfloat, ndarray [degrees]
galactic longitude
- b_degfloat, ndarray [degrees]
galactic latitude
- dist_kpcfloat, ndarray [kpc]
distance
- u_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
- v_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
- w_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
Returns
- vr_kmpsfloat, ndarray[km/s]
radial velocity
- mu_l_maspyrfloat, ndarray [mas/yr]
proper motion in galactic longitude cos(b) is applied
- mu_b_maspyrfloat, ndarray [mas/yr]
proper motion in galactic latitude
- uvw_to_vrmuad(l_deg: numpy.ndarray, b_deg: numpy.ndarray, dist_kpc: numpy.ndarray, u_kmps: numpy.ndarray, v_kmps: numpy.ndarray, w_kmps: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Conversion from u,v,w to v_r, mu_l, and mu_b
Parameters
- l_degfloat, ndarray [degrees]
galactic longitude
- b_degfloat, ndarray [degrees]
galactic latitude
- dist_kpcfloat, ndarray [kpc]
distance
- u_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
- v_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
- w_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
Returns
- vr_kmpsfloat, ndarray[km/s]
radial velocity
- mu_a_maspyrfloat, ndarray [mas/yr]
proper motion in galactic longitude cos(delta) is applied
- mu_d_maspyrfloat, ndarray [mas/yr]
proper motion in galactic latitude
- vr_bc_to_vr_lsr(l_deg: numpy.ndarray, b_deg: numpy.ndarray, vr: numpy.ndarray) numpy.ndarray
Conversion of radial velocity from barycentric frame to local standard of rest frame following Beaulieu et al. (2000)
Parameters
- l_degfloat, ndarray [degrees]
galactic longitude
- b_degfloat, ndarray [degrees]
galactic latitude
- vrfloat, ndarray [km/s]
barycentric radial velocity
Returns
- vr_lsrfloat, ndarray[km/s]
radial velocity relative to the LSR
- synthpop.synthpop_utils.coordinates_transformation.dlb_to_rphiz(d_kpc: numpy.ndarray, l_deg: numpy.ndarray, b_deg: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
translates d, l, b into r, theta, z
phi increases along the galactic rotation with a zero point at the position of the sun
Parameters
d_kpc : float, ndarray [kpc] l_deg : float, ndarray [degree] b_deg : float, ndarray [degree]
Returns
r : float, ndarray [kpc] phi_rad : float, ndarray [rad]
polar angle follows the rotation of the galaxy zero point is at the sun.
- zfloat, ndarray [kpc]
hight above/below the galactic plane
- synthpop.synthpop_utils.coordinates_transformation.dlb_to_xyz(d_kpc: numpy.ndarray, l_deg: numpy.ndarray, b_deg: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Convert from galactic coordinates an distance to galactocentric cartesian coordinates.
Parameters
- l_degfloat, ndarray, [degrees]
galactic longitude
- b_degfloat, ndarray, [degrees]
galactic latitude
- d_kpcfloat ndarray, [kpc]
distance
Returns
- x,y,zfloat nd_array [kpc]
galactocentric cartesian coordinates
- synthpop.synthpop_utils.coordinates_transformation.xyz_to_rphiz(x_kpc: numpy.ndarray, y_kpc: numpy.ndarray, z_kpc: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Translate from galactocentric cartesian coordinates into cylindrical cartesian coordinates, the zero point of z follows the warp of the galaxy.
Parameters
- x_kpc,y_kpc,z_kpcfloat, ndarray [kpc]
galactocentric cartesian coordinates
Returns
r_kpc : float, ndarray [kpc] phi_rad : float, ndarray [rad]
polar angle follows the rotation of the galaxy zero point is at the sun.
- z_kpcfloat, ndarray [kpc]
hight above/below the galactic plane
- synthpop.synthpop_utils.coordinates_transformation.lb_to_ad(l_deg: numpy.ndarray, b_deg: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]
Conversion from Galactic coordinates to Equatorial coordinates
Parameters
- l_degfloat, ndarray [degree]
Galactic longitude
- b_degfloat, ndarray [degree]
Galactic latitude
Returns
- a_degfloat, ndarray [degree]
right ascension
- d_degfloat, ndarray [degree]
declination
- synthpop.synthpop_utils.coordinates_transformation.ad_to_lb(a_deg: numpy.ndarray, d_deg: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray]
Conversion from Equatorial coordinates to Galactic coordinates
Parameters
- a_degfloat, ndarray [degree]
right ascension
- d_degfloat, ndarray [degree]
declination
Returns
- l_degfloat, ndarray [degree]
Galactic longitude
- b_degfloat, ndarray [degree]
Galactic latitude
- synthpop.synthpop_utils.coordinates_transformation.uvw_to_vrmulb(l_deg: numpy.ndarray, b_deg: numpy.ndarray, dist_kpc: numpy.ndarray, u_kmps: numpy.ndarray, v_kmps: numpy.ndarray, w_kmps: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Conversion from u,v,w to v_r, mu_l, and mu_b Using (vr, vl, vb) = R * (u,v,w) from Bovy 2011
Parameters
- l_degfloat, ndarray [degrees]
galactic longitude
- b_degfloat, ndarray [degrees]
galactic latitude
- dist_kpcfloat, ndarray [kpc]
distance
- u_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
- v_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
- w_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
Returns
- vr_kmpsfloat, ndarray[km/s]
radial velocity
- mu_l_maspyrfloat, ndarray [mas/yr]
proper motion in galactic longitude cos(b) is applied
- mu_b_maspyrfloat, ndarray [mas/yr]
proper motion in galactic latitude
- synthpop.synthpop_utils.coordinates_transformation.uvw_to_vrmuad(l_deg: numpy.ndarray, b_deg: numpy.ndarray, dist_kpc: numpy.ndarray, u_kmps: numpy.ndarray, v_kmps: numpy.ndarray, w_kmps: numpy.ndarray) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
Conversion from u,v,w to v_r, mu_l, and mu_b
Parameters
- l_degfloat, ndarray [degrees]
galactic longitude
- b_degfloat, ndarray [degrees]
galactic latitude
- dist_kpcfloat, ndarray [kpc]
distance
- u_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
- v_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
- w_kmpsfloat, ndarray [km/s]
rectangular velocity with_out correction for the motion of the sun
Returns
- vr_kmpsfloat, ndarray[km/s]
radial velocity
- mu_a_maspyrfloat, ndarray [mas/yr]
proper motion in galactic longitude cos(delta) is applied
- mu_d_maspyrfloat, ndarray [mas/yr]
proper motion in galactic latitude