FACT++  1.0
void eraApcs ( double  date1,
double  date2,
double  pv[2][3],
double  ebpv[2][3],
double  ehp[3],
eraASTROM astrom 
)

Definition at line 3 of file apcs.c.

References eraASTROM::bm1, eraASTROM::bpn, eraASTROM::eb, eraASTROM::eh, eraASTROM::em, eraCp(), eraIr(), eraPn(), ERFA_AULT, ERFA_DAU, ERFA_DAYSEC, ERFA_DJ00, ERFA_DJY, i, eraASTROM::pmt, and eraASTROM::v.

Referenced by eraApcg(), eraApco(), eraApcs13(), and t_apcs().

128 {
129 /* au/d to m/s */
130  const double AUDMS = ERFA_DAU/ERFA_DAYSEC;
131 
132 /* Light time for 1 AU (day) */
133  const double CR = ERFA_AULT/ERFA_DAYSEC;
134 
135  int i;
136  double dp, dv, pb[3], vb[3], ph[3], v2, w;
137 
138 /* Time since reference epoch, years (for proper motion calculation). */
139  astrom->pmt = ( (date1 - ERFA_DJ00) + date2 ) / ERFA_DJY;
140 
141 /* Adjust Earth ephemeris to observer. */
142  for (i = 0; i < 3; i++) {
143  dp = pv[0][i] / ERFA_DAU;
144  dv = pv[1][i] / AUDMS;
145  pb[i] = ebpv[0][i] + dp;
146  vb[i] = ebpv[1][i] + dv;
147  ph[i] = ehp[i] + dp;
148  }
149 
150 /* Barycentric position of observer (au). */
151  eraCp(pb, astrom->eb);
152 
153 /* Heliocentric direction and distance (unit vector and au). */
154  eraPn(ph, &astrom->em, astrom->eh);
155 
156 /* Barycentric vel. in units of c, and reciprocal of Lorenz factor. */
157  v2 = 0.0;
158  for (i = 0; i < 3; i++) {
159  w = vb[i] * CR;
160  astrom->v[i] = w;
161  v2 += w*w;
162  }
163  astrom->bm1 = sqrt(1.0 - v2);
164 
165 /* Reset the NPB matrix. */
166  eraIr(astrom->bpn);
167 
168 /* Finished. */
169 
170 }
#define ERFA_DJ00
Definition: erfam.h:87
#define ERFA_DAU
Definition: erfam.h:102
double pmt
Definition: erfam.h:17
double eh[3]
Definition: erfam.h:19
#define ERFA_AULT
Definition: erfam.h:108
#define ERFA_DJY
Definition: erfam.h:78
int i
Definition: db_dim_client.c:21
void eraIr(double r[3][3])
Definition: ir.c:3
#define ERFA_DAYSEC
Definition: erfam.h:75
double bpn[3][3]
Definition: erfam.h:23
void eraPn(double p[3], double *r, double u[3])
Definition: pn.c:3
double v[3]
Definition: erfam.h:21
double eb[3]
Definition: erfam.h:18
double em
Definition: erfam.h:20
double bm1
Definition: erfam.h:22
void eraCp(double p[3], double c[3])
Definition: cp.c:3

+ Here is the call graph for this function:

+ Here is the caller graph for this function: