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/deltat.c

    r1719 r2551  
    2929 * in 2130.
    3030 *
    31  * Input is mjd (modified julian date from MJD0 on). [stern]
    32  *  Note that xephem uses a different epoch for this "mjd" than the
     31 * Input is mj (modified julian date from MJD0 on). [stern]
     32 *  Note that xephem uses a different epoch for this "mj" than the
    3333 *  normal value of JD=240000.5.
    3434 * See AA page B4.
    3535 *
    36  * Output double deltat(mjd) is ET-UT1 in seconds.
     36 * Output double deltat(mj) is ET-UT1 in seconds.
    3737 *
    3838 *
     
    6767 *   - adopted #include's for xephem
    6868 *   - made dt[] static
    69  *   - made mjd the time argument [was: year Y].
     69 *   - made mj the time argument [was: year Y].
    7070 *   - updated observed and extrapolated data from tables at
    7171 *      ftp://maia.usno.navy.mil/ser7/ -- data deviated by up to 0.8 s
     
    7474 *   - replaced treatment after TABEND by linear extrapolation instead
    7575 *      of second order version
    76  *   - installed lastmjd cache (made ans static)
     76 *   - installed lastmj cache (made ans static)
    7777 *
    7878 *   - no changes to table interpolation scheme and past extrapolations */
    7979
    80 #include "P_.h"
     80#include <math.h>
     81
    8182#include "astro.h"
    8283
     
    161162 * of the Earth rotation rate in the ET time scale.
    162163 */
    163 double deltat(mjd)
    164 double mjd;
     164double deltat(double mj)
    165165{
    166166        double Y;
     
    168168        int d[6];
    169169        int i, iy, k;
    170         double floor();
    171170        static double ans;
    172         static double lastmjd = -10000;
    173 
    174         if (mjd == lastmjd) {
     171        static double lastmj = -10000;
     172
     173        if (mj == lastmj) {
    175174            return(ans);
    176175        }
    177         lastmjd = mjd;
    178 
    179         Y = 2000.0 + (mjd - J2000)/365.25;
     176        lastmj = mj;
     177
     178        Y = 2000.0 + (mj - J2000)/365.25;
    180179
    181180        if( Y > TABEND  &&  Y < 2130.0 ) {
     
    305304
    306305/* For RCS Only -- Do Not Edit */
    307 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: deltat.c,v $ $Date: 2001-10-22 12:08:26 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
     306static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: deltat.c,v $ $Date: 2004-06-15 16:52:38 $ $Revision: 1.3 $ $Name: not supported by cvs2svn $"};
Note: See TracChangeset for help on using the changeset viewer.