FACT++  1.0
void palMapqk ( double  rm,
double  dm,
double  pr,
double  pd,
double  px,
double  rv,
double  amprms[21],
double *  ra,
double *  da 
)

Definition at line 98 of file palMapqk.c.

References eraAnp(), eraC2s(), eraPdp(), eraPn(), eraRxp(), eraS2c(), i, and PAL__DAS2R.

Referenced by palMap(), and t_mapqkz().

100  {
101 
102 /* local constants */
103  const double VF = 0.21094502; /* Km/s to AU/year */
104 
105 /* Local Variables: */
106  int i;
107  double ab1, abv[3], p[3], w, p1dv, p2[3], p3[3];
108  double pmt, gr2e, eb[3], q[3], pxr, em[3];
109  double pde, pdep1, p1[3], ehn[3], pn[3];
110 
111 /* Unpack scalar and vector parameters. */
112  pmt = amprms[0];
113  gr2e = amprms[7];
114  ab1 = amprms[11];
115  for( i = 0; i < 3; i++ ) {
116  eb[i] = amprms[i+1];
117  ehn[i] = amprms[i+4];
118  abv[i] = amprms[i+8];
119  }
120 
121 /* Spherical to x,y,z. */
122  eraS2c( rm, dm, q);
123 
124  /* Space motion (radians per year) */
125  pxr = px * PAL__DAS2R;
126  w = VF * rv * pxr;
127  em[0] = -pr * q[1] - pd * cos(rm) * sin(dm) + w * q[0];
128  em[1] = pr * q[0] - pd * sin(rm) * sin(dm) + w * q[1];
129  em[2] = pd * cos(dm) + w * q[2];
130 
131 /* Geocentric direction of star (normalised) */
132  for( i = 0; i < 3; i++ ) {
133  p[i] = q[i] + pmt * em[i] - pxr * eb[i];
134  }
135  eraPn( p, &w, pn );
136 
137 /* Light deflection (restrained within the Sun's disc) */
138  pde = eraPdp( pn, ehn );
139  pdep1 = pde + 1.0;
140  w = gr2e / ( pdep1 > 1.0e-5 ? pdep1 : 1.0e-5 );
141  for( i = 0; i < 3; i++) {
142  p1[i] = pn[i] + w * ( ehn[i] - pde * pn[i] );
143  }
144 
145 /* Aberration (normalisation omitted). */
146  p1dv = eraPdp( p, abv );
147  w = 1.0 + p1dv / ( ab1 + 1.0 );
148  for( i = 0; i < 3; i++ ) {
149  p2[i] = ( ab1 * p1[i] ) + ( w * abv[i] );
150  }
151 
152 /* Precession and nutation. */
153  eraRxp( (double(*)[3]) &amprms[12], p2, p3 );
154 
155 /* Geocentric apparent RA,dec. */
156  eraC2s( p3, ra, da );
157  *ra = eraAnp( *ra );
158 
159 }
double eraPdp(double a[3], double b[3])
Definition: pdp.c:3
static const double PAL__DAS2R
Definition: palmac.h:78
int i
Definition: db_dim_client.c:21
void eraS2c(double theta, double phi, double c[3])
Definition: s2c.c:3
double w
Definition: palObs.c:168
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 eraPn(double p[3], double *r, double u[3])
Definition: pn.c:3
double p
Definition: palObs.c:169
double eraAnp(double a)
Definition: anp.c:3

+ Here is the call graph for this function:

+ Here is the caller graph for this function: