FACT++  1.0
int eraStarpm ( double  ra1,
double  dec1,
double  pmr1,
double  pmd1,
double  px1,
double  rv1,
double  ep1a,
double  ep1b,
double  ep2a,
double  ep2b,
double *  ra2,
double *  dec2,
double *  pmr2,
double *  pmd2,
double *  px2,
double *  rv2 
)

Definition at line 3 of file starpm.c.

References eraPdp(), eraPm(), eraPvstar(), eraPvu(), eraStarpv(), and ERFA_DC.

Referenced by eraPmsafe(), palPm(), and t_starpm().

112 {
113  double pv1[2][3], tl1, dt, pv[2][3], r2, rdv, v2, c2mv2, tl2,
114  pv2[2][3];
115  int j1, j2, j;
116 
117 /* RA,Dec etc. at the "before" epoch to space motion pv-vector. */
118  j1 = eraStarpv(ra1, dec1, pmr1, pmd1, px1, rv1, pv1);
119 
120 /* Light time when observed (days). */
121  tl1 = eraPm(pv1[0]) / ERFA_DC;
122 
123 /* Time interval, "before" to "after" (days). */
124  dt = (ep2a - ep1a) + (ep2b - ep1b);
125 
126 /* Move star along track from the "before" observed position to the */
127 /* "after" geometric position. */
128  eraPvu(dt + tl1, pv1, pv);
129 
130 /* From this geometric position, deduce the observed light time (days) */
131 /* at the "after" epoch (with theoretically unneccessary error check). */
132  r2 = eraPdp(pv[0], pv[0]);
133  rdv = eraPdp(pv[0], pv[1]);
134  v2 = eraPdp(pv[1], pv[1]);
135  c2mv2 = ERFA_DC*ERFA_DC - v2;
136  if (c2mv2 <= 0) return -1;
137  tl2 = (-rdv + sqrt(rdv*rdv + c2mv2*r2)) / c2mv2;
138 
139 /* Move the position along track from the observed place at the */
140 /* "before" epoch to the observed place at the "after" epoch. */
141  eraPvu(dt + (tl1 - tl2), pv1, pv2);
142 
143 /* Space motion pv-vector to RA,Dec etc. at the "after" epoch. */
144  j2 = eraPvstar(pv2, ra2, dec2, pmr2, pmd2, px2, rv2);
145 
146 /* Final status. */
147  j = (j2 == 0) ? j1 : -1;
148 
149  return j;
150 
151 }
double eraPdp(double a[3], double b[3])
Definition: pdp.c:3
#define ERFA_DC
Definition: erfam.h:111
double eraPm(double p[3])
Definition: pm.c:3
int eraPvstar(double pv[2][3], double *ra, double *dec, double *pmr, double *pmd, double *px, double *rv)
Definition: pvstar.c:3
int eraStarpv(double ra, double dec, double pmr, double pmd, double px, double rv, double pv[2][3])
Definition: starpv.c:3
void eraPvu(double dt, double pv[2][3], double upv[2][3])
Definition: pvu.c:3

+ Here is the call graph for this function:

+ Here is the caller graph for this function: