source: Sophya/trunk/SophyaExt/XephemAstroLib/ap_as.c@ 2864

Last change on this file since 2864 was 2818, checked in by cmv, 20 years ago

Update de Xephem 3.7 cmv 21/08/2005

File size: 1.3 KB
Line 
1#include <string.h>
2
3#include "astro.h"
4
5/* convert the given apparent RA/Dec to astrometric precessed to Mjd IN PLACE.
6 * we have no un-abberation etc so to find the correction: assume
7 * *rap and *decp are astrometric@EOD, convert to apparent and back out
8 * the difference; then precess to Mjd.
9 */
10void
11ap_as (Now *np, double Mjd, double *rap, double *decp)
12{
13 Obj o;
14 Now n;
15
16 zero_mem ((void *)&o, sizeof(o));
17 o.o_type = FIXED;
18 o.f_RA = (float)*rap;
19 o.f_dec = (float)*decp;
20 o.f_epoch = (float)mjd;
21 memcpy ((void *)&n, (void *)np, sizeof(Now));
22 n.n_epoch = EOD;
23 obj_cir (&n, &o);
24 *rap -= o.s_ra - *rap;
25 *decp -= o.s_dec - *decp;
26 radecrange (rap, decp);
27 precess (mjd, Mjd, rap, decp);
28 radecrange (rap, decp);
29}
30
31/* convert the given astrometric RA/Dec which are precessed to Mjd into
32 * apparent @ EOD IN PLACE.
33 */
34void
35as_ap (Now *np, double Mjd, double *rap, double *decp)
36{
37 Obj o;
38 Now n;
39
40 zero_mem ((void *)&o, sizeof(o));
41 o.o_type = FIXED;
42 o.f_RA = (float)*rap;
43 o.f_dec = (float)*decp;
44 o.f_epoch = (float)Mjd;
45 memcpy ((void *)&n, (void *)np, sizeof(Now));
46 n.n_epoch = EOD;
47 obj_cir (&n, &o);
48 *rap = o.s_ra;
49 *decp = o.s_dec;
50}
51
52/* For RCS Only -- Do Not Edit */
53static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: ap_as.c,v $ $Date: 2005-08-21 10:02:36 $ $Revision: 1.5 $ $Name: not supported by cvs2svn $"};
Note: See TracBrowser for help on using the repository browser.