Ignore:
Timestamp:
Jun 15, 2004, 6:54:12 PM (21 years ago)
Author:
cmv
Message:

nouvelle version de xephem/libastro (3.6) cmv 15/6/04

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaExt/XephemAstroLib/aberration.c

    r1719 r2551  
    22 * based on secular unperturbed Kepler orbit
    33 *
    4  * the corrections should be applied to ra/dec and lam/beta of the
     4 * the corrections should be applied to ra/dec and lam/beta at the
    55 * epoch of date.
    66 */
     
    88#include <stdio.h>
    99#include <math.h>
     10#include <stdlib.h>
    1011
    11 #if defined(__STDC__)
    12 #include <stdlib.h>
    13 #endif
    14 
    15 #include "P_.h"
    1612#include "astro.h"
    1713
     
    2016#define AB_EQ_EOD       1
    2117
    22 static void ab_aux P_((double mjd, double *x, double *y, double lsn,
    23         int mode));
     18static void ab_aux (double mj, double *x, double *y, double lsn, int mode);
    2419
    2520/* apply aberration correction to ecliptical coordinates *lam and *bet
    26  * (in radians) for a given time mjd and handily supplied longitude of sun,
     21 * (in radians) for a given time m and handily supplied longitude of sun,
    2722 * lsn (in radians)
    2823 */
    2924void
    30 ab_ecl (mjd, lsn, lam, bet)
    31 double mjd, lsn, *lam, *bet;
     25ab_ecl (double mj, double lsn, double *lam, double *bet)
    3226{
    33         ab_aux(mjd, lam, bet, lsn, AB_ECL_EOD);
     27        ab_aux(mj, lam, bet, lsn, AB_ECL_EOD);
    3428}
    3529
    3630/* apply aberration correction to equatoreal coordinates *ra and *dec
    37  * (in radians) for a given time mjd and handily supplied longitude of sun,
     31 * (in radians) for a given time m and handily supplied longitude of sun,
    3832 * lsn (in radians)
    3933 */
    4034void
    41 ab_eq (mjd, lsn, ra, dec)
    42 double mjd, lsn, *ra, *dec;
     35ab_eq (double mj, double lsn, double *ra, double *dec)
    4336{
    44         ab_aux(mjd, ra, dec, lsn, AB_EQ_EOD);
     37        ab_aux(mj, ra, dec, lsn, AB_EQ_EOD);
    4538}
    4639
     
    5144 */
    5245static void
    53 ab_aux (mjd, x, y, lsn, mode)
    54 double mjd, *x, *y, lsn;
    55 int mode;
     46ab_aux (double mj, double *x, double *y, double lsn, int mode)
    5647{
    57         static double lastmjd = -10000;
     48        static double lastmj = -10000;
    5849        static double eexc;     /* earth orbit excentricity */
    5950        static double leperi;   /* ... and longitude of perihelion */
    6051        static char dirty = 1;  /* flag for cached trig terms */
    6152
    62         if (mjd != lastmjd) {
     53        if (mj != lastmj) {
    6354            double T;           /* centuries since J2000 */
    6455
    65             T = (mjd - J2000)/36525.;
     56            T = (mj - J2000)/36525.;
    6657            eexc = 0.016708617 - (42.037e-6 + 0.1236e-6 * T) * T;
    6758            leperi = degrad(102.93735 + (0.71953 + 0.00046 * T) * T);
    68             lastmjd = mjd;
     59            lastmj = mj;
    6960            dirty = 1;
    7061        }
     
    9990                    cp = cos(leperi);
    10091                    sp = sin(leperi);
    101                     obliquity(mjd, &eps);
     92                    obliquity(mj, &eps);
    10293                    se = sin(eps);
    10394                    ce = cos(eps);
     
    127118        default:
    128119            printf ("ab_aux: bad mode: %d\n", mode);
    129             exit (1);
     120            abort();
    130121            break;
    131122
     
    134125
    135126/* For RCS Only -- Do Not Edit */
    136 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: aberration.c,v $ $Date: 2001-10-22 12:08:26 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
     127static 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.