FACT++  1.0
int eraPvstar ( double  pv[2][3],
double *  ra,
double *  dec,
double *  pmr,
double *  pmd,
double *  px,
double *  rv 
)

Definition at line 3 of file pvstar.c.

References eraAnp(), eraPdp(), eraPm(), eraPmp(), eraPn(), eraPpp(), eraPv2s(), eraSxp(), ERFA_DAU, ERFA_DAYSEC, ERFA_DC, ERFA_DJY, and ERFA_DR2AS.

Referenced by eraFk52h(), eraH2fk5(), eraStarpm(), and t_pvstar().

99 {
100  double r, x[3], vr, ur[3], vt, ut[3], bett, betr, d, w, del,
101  usr[3], ust[3], a, rad, decd, rd;
102 
103 /* Isolate the radial component of the velocity (AU/day, inertial). */
104  eraPn(pv[0], &r, x);
105  vr = eraPdp(x, pv[1]);
106  eraSxp(vr, x, ur);
107 
108 /* Isolate the transverse component of the velocity (AU/day, inertial). */
109  eraPmp(pv[1], ur, ut);
110  vt = eraPm(ut);
111 
112 /* Special-relativity dimensionless parameters. */
113  bett = vt / ERFA_DC;
114  betr = vr / ERFA_DC;
115 
116 /* The inertial-to-observed correction terms. */
117  d = 1.0 + betr;
118  w = 1.0 - betr*betr - bett*bett;
119  if (d == 0.0 || w < 0) return -1;
120  del = sqrt(w) - 1.0;
121 
122 /* Apply relativistic correction factor to radial velocity component. */
123  w = (betr != 0) ? (betr - del) / (betr * d) : 1.0;
124  eraSxp(w, ur, usr);
125 
126 /* Apply relativistic correction factor to tangential velocity */
127 /* component. */
128  eraSxp(1.0/d, ut, ust);
129 
130 /* Combine the two to obtain the observed velocity vector (AU/day). */
131  eraPpp(usr, ust, pv[1]);
132 
133 /* Cartesian to spherical. */
134  eraPv2s(pv, &a, dec, &r, &rad, &decd, &rd);
135  if (r == 0.0) return -2;
136 
137 /* Return RA in range 0 to 2pi. */
138  *ra = eraAnp(a);
139 
140 /* Return proper motions in radians per year. */
141  *pmr = rad * ERFA_DJY;
142  *pmd = decd * ERFA_DJY;
143 
144 /* Return parallax in arcsec. */
145  *px = ERFA_DR2AS / r;
146 
147 /* Return radial velocity in km/s. */
148  *rv = 1e-3 * rd * ERFA_DAU / ERFA_DAYSEC;
149 
150 /* OK status. */
151  return 0;
152 
153 }
double eraPdp(double a[3], double b[3])
Definition: pdp.c:3
#define ERFA_DAU
Definition: erfam.h:102
void eraPv2s(double pv[2][3], double *theta, double *phi, double *r, double *td, double *pd, double *rd)
Definition: pv2s.c:3
#define ERFA_DJY
Definition: erfam.h:78
#define ERFA_DC
Definition: erfam.h:111
#define ERFA_DR2AS
Definition: erfam.h:57
double eraPm(double p[3])
Definition: pm.c:3
#define ERFA_DAYSEC
Definition: erfam.h:75
void eraPpp(double a[3], double b[3], double apb[3])
Definition: ppp.c:3
void eraSxp(double s, double p[3], double sp[3])
Definition: sxp.c:3
void eraPmp(double a[3], double b[3], double amb[3])
Definition: pmp.c:3
void eraPn(double p[3], double *r, double u[3])
Definition: pn.c:3
double eraAnp(double a)
Definition: anp.c:3

+ Here is the call graph for this function:

+ Here is the caller graph for this function: