FACT++  1.0
void eraAtioq ( double  ri,
double  di,
eraASTROM astrom,
double *  aob,
double *  zob,
double *  hob,
double *  dob,
double *  rob 
)

Definition at line 3 of file atioq.c.

References eraASTROM::cphi, eraASTROM::diurab, eraAnp(), eraC2s(), eraASTROM::eral, eraS2c(), eraASTROM::refa, eraASTROM::refb, eraASTROM::sphi, eraASTROM::xpl, and eraASTROM::ypl.

Referenced by eraAtco13(), eraAtio13(), and t_atioq().

101 {
102 /* Minimum cos(alt) and sin(alt) for refraction purposes */
103  const double CELMIN = 1e-6;
104  const double SELMIN = 0.05;
105 
106  double v[3], x, y, z, xhd, yhd, zhd, f, xhdt, yhdt, zhdt,
107  xaet, yaet, zaet, azobs, r, tz, w, del, cosdel,
108  xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs;
109 
110 /*--------------------------------------------------------------------*/
111 
112 /* CIRS RA,Dec to Cartesian -HA,Dec. */
113  eraS2c(ri-astrom->eral, di, v);
114  x = v[0];
115  y = v[1];
116  z = v[2];
117 
118 /* Polar motion. */
119  xhd = x + astrom->xpl*z;
120  yhd = y - astrom->ypl*z;
121  zhd = z - astrom->xpl*x + astrom->ypl*y;
122 
123 /* Diurnal aberration. */
124  f = ( 1.0 - astrom->diurab*yhd );
125  xhdt = f * xhd;
126  yhdt = f * ( yhd + astrom->diurab );
127  zhdt = f * zhd;
128 
129 /* Cartesian -HA,Dec to Cartesian Az,El (S=0,E=90). */
130  xaet = astrom->sphi*xhdt - astrom->cphi*zhdt;
131  yaet = yhdt;
132  zaet = astrom->cphi*xhdt + astrom->sphi*zhdt;
133 
134 /* Azimuth (N=0,E=90). */
135  azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0;
136 
137 /* ---------- */
138 /* Refraction */
139 /* ---------- */
140 
141 /* Cosine and sine of altitude, with precautions. */
142  r = sqrt(xaet*xaet + yaet*yaet);
143  r = r > CELMIN ? r : CELMIN;
144  z = zaet > SELMIN ? zaet : SELMIN;
145 
146 /* A*tan(z)+B*tan^3(z) model, with Newton-Raphson correction. */
147  tz = r/z;
148  w = astrom->refb*tz*tz;
149  del = ( astrom->refa + w ) * tz /
150  ( 1.0 + ( astrom->refa + 3.0*w ) / ( z*z ) );
151 
152 /* Apply the change, giving observed vector. */
153  cosdel = 1.0 - del*del/2.0;
154  f = cosdel - del*z/r;
155  xaeo = xaet*f;
156  yaeo = yaet*f;
157  zaeo = cosdel*zaet + del*r;
158 
159 /* Observed ZD. */
160  zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo);
161 
162 /* Az/El vector to HA,Dec vector (both right-handed). */
163  v[0] = astrom->sphi*xaeo + astrom->cphi*zaeo;
164  v[1] = yaeo;
165  v[2] = - astrom->cphi*xaeo + astrom->sphi*zaeo;
166 
167 /* To spherical -HA,Dec. */
168  eraC2s ( v, &hmobs, &dcobs );
169 
170 /* Right ascension (with respect to CIO). */
171  raobs = astrom->eral + hmobs;
172 
173 /* Return the results. */
174  *aob = eraAnp(azobs);
175  *zob = zdobs;
176  *hob = -hmobs;
177  *dob = dcobs;
178  *rob = eraAnp(raobs);
179 
180 /* Finished. */
181 
182 }
double refa
Definition: erfam.h:32
double eral
Definition: erfam.h:31
double ypl
Definition: erfam.h:27
void eraS2c(double theta, double phi, double c[3])
Definition: s2c.c:3
double sphi
Definition: erfam.h:28
double refb
Definition: erfam.h:33
double cphi
Definition: erfam.h:29
void eraC2s(double p[3], double *theta, double *phi)
Definition: c2s.c:3
double eraAnp(double a)
Definition: anp.c:3
double xpl
Definition: erfam.h:26
double diurab
Definition: erfam.h:30

+ Here is the call graph for this function:

+ Here is the caller graph for this function: