Coordinates and velocities (from data)¶
-
class
jjmodel.transform.XVTrans(filename, fileformat, gframe)[source]¶ Class for coordinate transformation and calculation of Galactocentric distances and velocities from astrometric parameters and radial velocities.
-
__init__(filename, fileformat, gframe)[source]¶ Initialization of the class instance is performed with reading the data table and specifying parameters of the Galactic coordinate system.
- Parameters
filename (str) -- Name of the data file.
fileformat (str) -- Format of the file.
gframe (dict) --
Parameters describing the Galactic frame. Keys to specify are:
'Rsun': Solar radius, kpc'Zsun': Solar distance from the Galactic plane, pc'Usun','Vsun','Wsun': Cartesian components of the Solar peculiar velocity, \(\mathrm{km \ s^{-1}}\)'eRsun': Uncertainty of the Solar radius, kpc'eZsun': Uncertainty of the Solar distance from the Galactic plane, pc'eUsun','eVsun','eWsun': Uncertainties of the Solar peculiar velocity components, \(\mathrm{km \ s^{-1}}\)'pm_sgrA': Sgr A* proper motion, \(\mathrm{mas \ yr^{-1}}\)'epm_sgrA': Uncertainty of Sgr A* proper motion, \(\mathrm{mas \ yr^{-1}}\).
Note
In all methods of this class the input quantities must be in the following units:
(ra, dec, era, edec) = [deg]
(pmra, pmdec, epmra, epmdec) = [mas/yr]
(par, epar) = [mas]
(vr, evr) = km/s
d = [pc]
(Usun, Vsun, Wsun, Vtsun) and their errors = km/s
(Rsun, eRsun) = [kpc]
(Zsun, eZsun) = [pc]
Units of the output:
(l, b, phi, ephi) = [deg]
(X, Y, Z, eX, eY, eZ) = [pc]
(R, eR) = [kpc]
(U, V, W, eU, eV, eW, Vr, Vphi, eVr, eVphi) = [km/s]
-
calc_3d_err(names)[source]¶ Calculation of the coordinate errors. Should be called only after
jjmodel.transform.XVTrans.calc_3d_gal()orjjmodel.transform.XVTrans.calc_6d_gal().- Parameters
names (dict) --
Names of columns for the following quantities:
'ra': right ascention, deg'dec': declination, deg'dpc'or'dkpc': heliocentric distance, pc or kpc'parallax': parallax, can be given instead of the distance column, mas'era': error in right ascention, deg'edec': error in declination, deg'edpc'or'edkpc': error in heliocentric distance, pc or kpc'eparallax': parallax error, can be given instead of the distance error column, mas.
- Returns
None.
Adds columns to the table:
'ed': Distance error (if parallax and parallax error are given)(
'ex','ey','ez'): Errors of 3d Cartesian coordinates(
'erg','ephi'): Errors of Galactocentric cylindrical coordinates
-
calc_3d_gal(names)[source]¶ Calculates Galactic coordinates (Cartesian and cylindrical). If parallax column is used, distances are calculated as 1/parallax.
- Parameters
names (dict) --
Names of columns for the following quantities:
'ra': right ascention, deg'dec': declination, deg'dpc'or'dkpc': heliocentric distance, pc or kpc'parallax': parallax, can be given instead of the distance column, mas.
- Returns
None.
Adds columns to the table:
'd': Heliocentric distance (if parallax column is given as an input).(
'l','b'): Galactic longitude and latitude(
'x','y','z'): 3d Cartesian coordinates in a frame located at the Solar position (projected on the midplane), x-axis points to the Galactic center, y corresponds to l=90 deg, z-axis points to the northern Galactic pole(
'rg','phi'): Galactocentric cylindrical coordinates
-
calc_6d_err(names, **kwargs)[source]¶ Calculation of the coordinate and velocity errors. Should be called only after calc_6d_gal.
- Parameters
names (dict) --
Names of columns for the following quantities:
'ra': right ascention, deg'dec': declination, deg'dpc'or'dkpc': heliocentric distance, pc or kpc'parallax': parallax, can be given instead of the distance column, mas'pmra': proper motion in right ascention, \(\mathrm{mas \ yr^{-1}}\)'pmdec': proper motion in right declination, \(\mathrm{mas \ yr^{-1}}\)'vr': radial velocity, \(\mathrm{km \ s^{-1}}\)'era': error in right ascention, deg'edec': error in declination, deg'edpc'or'edkpc': error in heliocentric distance, pc or kpc'eparallax': parallax error, can be given instead of the distance error column, mas'epmra': error in proper motion in right ascention, \(\mathrm{mas \ yr^{-1}}\)'epmdec': error in proper motion in right declination, \(\mathrm{mas \ yr^{-1}}\)'evr': error in radial velocity, \(\mathrm{km \ s^{-1}}\).
cov_matrix (dict) -- Optional, correlation coefficients for the error calculation. There can be maximum 10 coefficients:
'c12','c13','c14','c15','c23','c24','c25','c34','c35','c45'. Indices correspond to the correlated quantities in the following way: (ra,dec,pmra,pmdec,parallax) = (1,2,3,4,5). Don't mess it up. Have fun:) Here we assume that there is no correlation between 5 astrometric parameters and radial velocity as they are obtained via measurements by the different instruments. Remember that terms ('c15','c25','c35','c45') should not be taken into account if distances are not simple inverted parallaxes.
- Returns
None.
Adds columns to the table:
'ed': Distance error (if parallax and parallax error are given)(
'ex','ey','ez'): Errors of 3d Cartesian coordinates(
'erg','ephi'): Errors of Galactocentric cylindrical coordinates(
'eU','eV','eW'): Errors of the 3d Cartesian velocity components(
'eUc','eVc','eWc'): Random errors of the 3d Cartesian velocity components (calculated only when covarience matrix is given to check the impact of correlations).(
'eVr','eVphi'): Errors of Galactocentric velocities in cylindrical coordinates
-
calc_6d_gal(names)[source]¶ Calculates Galactic coordinates (Cartesian and cylindrical). If parallax column is used, distances are calculated as 1/parallax.
- Parameters
names (dict) --
Names of columns for the following quantities:
'ra': right ascention, deg'dec': declination, deg'dpc'or'dkpc': heliocentric distance, pc or kpc'parallax': parallax, can be given instead of the distance column, mas'pmra': proper motion in right ascention, \(\mathrm{mas \ yr^{-1}}\)'pmdec': proper motion in right declination, \(\mathrm{mas \ yr^{-1}}\)'vr': radial velocity, \(\mathrm{km \ s^{-1}}\).
- Returns
None.
Adds columns to the table:
'd': Heliocentric distance (if parallax column is given as an input).(
'l','b'): Galactic longitude and latitude(
'x','y','z'): 3d Cartesian coordinates in a frame located at the Solar position (projected on the midplane), x-axis points to the Galactic center, y corresponds to l=90 deg, z-axis points to the northern Galactic pole(
'rg','phi'): Galactocentric cylindrical coordinates(
'U','V','W'): 3d Cartesian velocity components (relative to LSR)(
'Vr','Vphi'): Galactocentric velocities in cylindrical coordinates (the 3-rd component is W)
-