FACT++  1.0
void palPlantu ( double  date,
double  elong,
double  phi,
const double  u[13],
double *  ra,
double *  dec,
double *  r,
int *  jstat 
)

Definition at line 126 of file palPlantu.c.

References eraAnp(), eraC2s(), eraRxp(), i, PAL__CR, PAL__SPD, palDt(), palEpj(), palEpv(), palGmst(), palPrenut(), palPvobs(), and palUe2pv().

Referenced by palPlante(), and t_planet().

127  {
128 
129  int i;
130  double dvb[3], dpb[3], vsg[6], vsp[6], v[6], rmat[3][3],
131  vgp[6], stl, vgo[6], dx, dy, dz, d, tl;
132 
133  double ucp[13];
134 
135  /* To retain the stated const API and conform to the documentation
136  we must copy the contents of the u array as palUe2pv updates
137  the final two elements */
138  for (i=0;i<13;i++) {
139  ucp[i] = u[i];
140  }
141 
142  /* Sun to geocentre (J2000, velocity in AU/s) */
143  palEpv( date, vsg, &(vsg[3]), dpb, dvb );
144  for (i=3; i < 6; i++) {
145  vsg[i] /= PAL__SPD;
146  }
147 
148  /* Sun to planet (J2000) */
149  palUe2pv( date, ucp, vsp, jstat );
150 
151  /* Geocentre to planet (J2000) */
152  for (i=0; i<6; i++) {
153  v[i] = vsp[i] - vsg[i];
154  }
155 
156  /* Precession and nutation to date */
157  palPrenut( 2000.0, date, rmat );
158  eraRxp(rmat, v, vgp);
159  eraRxp( rmat, &(v[3]), &(vgp[3]) );
160 
161  /* Geocentre to observer (date) */
162  stl = palGmst( date - palDt( palEpj(date) ) / PAL__SPD ) + elong;
163  palPvobs( phi, 0.0, stl, vgo );
164 
165  /* Observer to planet (date) */
166  for (i=0; i<6; i++) {
167  v[i] = vgp[i] - vgo[i];
168  }
169 
170  /* Geometric distance (AU) */
171  dx = v[0];
172  dy = v[1];
173  dz = v[2];
174  d = sqrt( dx*dx + dy*dy + dz*dz );
175 
176  /* Light time (sec) */
177  tl = PAL__CR * d;
178 
179  /* Correct position for planetary aberration */
180  for (i=0; i<3; i++) {
181  v[i] -= tl * v[i+3];
182  }
183 
184  /* To RA,Dec */
185  eraC2s( v, ra, dec );
186  *ra = eraAnp( *ra );
187  *r = d;
188 }
static const double PAL__CR
Definition: palmac.h:99
void palPrenut(double epoch, double date, double rmatpn[3][3])
Definition: palPrenut.c:70
double palEpj(double date)
Definition: palOne2One.c:1169
int i
Definition: db_dim_client.c:21
double palDt(double epoch)
Definition: palDt.c:97
void palEpv(double date, double ph[3], double vh[3], double pb[3], double vb[3])
Definition: palEpv.c:79
void eraC2s(double p[3], double *theta, double *phi)
Definition: c2s.c:3
void eraRxp(double r[3][3], double p[3], double rp[3])
Definition: rxp.c:3
void palPvobs(double p, double h, double stl, double pv[6])
Definition: palPvobs.c:77
double eraAnp(double a)
Definition: anp.c:3
static const double PAL__SPD
Definition: palmac.h:102
double palGmst(double ut1)
Definition: palOne2One.c:1332
void palUe2pv(double date, double u[13], double pv[], int *jstat)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: