Changeset 2551 in Sophya for trunk/SophyaExt/XephemAstroLib/aberration.c
- Timestamp:
- Jun 15, 2004, 6:54:12 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaExt/XephemAstroLib/aberration.c
r1719 r2551 2 2 * based on secular unperturbed Kepler orbit 3 3 * 4 * the corrections should be applied to ra/dec and lam/beta ofthe4 * the corrections should be applied to ra/dec and lam/beta at the 5 5 * epoch of date. 6 6 */ … … 8 8 #include <stdio.h> 9 9 #include <math.h> 10 #include <stdlib.h> 10 11 11 #if defined(__STDC__)12 #include <stdlib.h>13 #endif14 15 #include "P_.h"16 12 #include "astro.h" 17 13 … … 20 16 #define AB_EQ_EOD 1 21 17 22 static void ab_aux P_((double mjd, double *x, double *y, double lsn, 23 int mode)); 18 static void ab_aux (double mj, double *x, double *y, double lsn, int mode); 24 19 25 20 /* apply aberration correction to ecliptical coordinates *lam and *bet 26 * (in radians) for a given time m jdand handily supplied longitude of sun,21 * (in radians) for a given time m and handily supplied longitude of sun, 27 22 * lsn (in radians) 28 23 */ 29 24 void 30 ab_ecl (mjd, lsn, lam, bet) 31 double mjd, lsn, *lam, *bet; 25 ab_ecl (double mj, double lsn, double *lam, double *bet) 32 26 { 33 ab_aux(mj d, lam, bet, lsn, AB_ECL_EOD);27 ab_aux(mj, lam, bet, lsn, AB_ECL_EOD); 34 28 } 35 29 36 30 /* apply aberration correction to equatoreal coordinates *ra and *dec 37 * (in radians) for a given time m jdand handily supplied longitude of sun,31 * (in radians) for a given time m and handily supplied longitude of sun, 38 32 * lsn (in radians) 39 33 */ 40 34 void 41 ab_eq (mjd, lsn, ra, dec) 42 double mjd, lsn, *ra, *dec; 35 ab_eq (double mj, double lsn, double *ra, double *dec) 43 36 { 44 ab_aux(mj d, ra, dec, lsn, AB_EQ_EOD);37 ab_aux(mj, ra, dec, lsn, AB_EQ_EOD); 45 38 } 46 39 … … 51 44 */ 52 45 static void 53 ab_aux (mjd, x, y, lsn, mode) 54 double mjd, *x, *y, lsn; 55 int mode; 46 ab_aux (double mj, double *x, double *y, double lsn, int mode) 56 47 { 57 static double lastmj d= -10000;48 static double lastmj = -10000; 58 49 static double eexc; /* earth orbit excentricity */ 59 50 static double leperi; /* ... and longitude of perihelion */ 60 51 static char dirty = 1; /* flag for cached trig terms */ 61 52 62 if (mj d != lastmjd) {53 if (mj != lastmj) { 63 54 double T; /* centuries since J2000 */ 64 55 65 T = (mj d- J2000)/36525.;56 T = (mj - J2000)/36525.; 66 57 eexc = 0.016708617 - (42.037e-6 + 0.1236e-6 * T) * T; 67 58 leperi = degrad(102.93735 + (0.71953 + 0.00046 * T) * T); 68 lastmj d = mjd;59 lastmj = mj; 69 60 dirty = 1; 70 61 } … … 99 90 cp = cos(leperi); 100 91 sp = sin(leperi); 101 obliquity(mj d, &eps);92 obliquity(mj, &eps); 102 93 se = sin(eps); 103 94 ce = cos(eps); … … 127 118 default: 128 119 printf ("ab_aux: bad mode: %d\n", mode); 129 exit (1);120 abort(); 130 121 break; 131 122 … … 134 125 135 126 /* For RCS Only -- Do Not Edit */ 136 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: aberration.c,v $ $Date: 200 1-10-22 12:08:26 $ $Revision: 1.2$ $Name: not supported by cvs2svn $"};127 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: aberration.c,v $ $Date: 2004-06-15 16:52:37 $ $Revision: 1.3 $ $Name: not supported by cvs2svn $"};
Note:
See TracChangeset
for help on using the changeset viewer.