Ignore:
Timestamp:
Oct 22, 2001, 2:08:28 PM (24 years ago)
Author:
cmv
Message:

Adapted to version 3.5 xephem cmv 22/10/2001

File:
1 edited

Legend:

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

    r1457 r1719  
    6767        double lam, bet;        /* geocentric ecliptic long and lat */
    6868        double dia, mag;        /* angular diameter at 1 AU and magnitude */
    69         double f;               /* fractional phase from earth */
    7069        int p;
    7170
     
    8483        sunpos (mjed, &lsn, &rsn, 0);
    8584
    86         /* find helio long/lat; sun/planet and earth/plant dist; ecliptic
     85        /* find helio long/lat; sun/planet and earth/planet dist; ecliptic
    8786         * long/lat; diameter and mag.
    8887         */
     
    9291        cir_sky (np, lpd, psi, rp, &rho, lam, bet, lsn, rsn, op);
    9392
    94         /* compute magnitude and angular size */
    95         f = op->s_phase ? 5*log10(rp*rho) - 5*log10(op->s_phase/100) : 100;
    96         set_smag (op, mag+f);
     93        /* set magnitude and angular size */
     94        set_smag (op, mag);
    9795        op->s_size = (float)(dia/rho);
    9896
     
    129127        ra = op->f_RA;
    130128        dec = op->f_dec;
    131         precess (op->f_epoch, mjd, &ra, &dec);
     129        precess (op->f_epoch, mjed, &ra, &dec);
    132130
    133131        /* convert equatoreal ra/dec to mean geocentric ecliptic lat/long */
    134         eq_ecl (mjd, ra, dec, &bet, &lam);
     132        eq_ecl (mjed, ra, dec, &bet, &lam);
    135133
    136134        /* find solar ecliptical long.(mean equinox) and distance from earth */
     
    138136
    139137        /* allow for relativistic light bending near the sun */
    140         deflect (mjd, lam, bet, lsn, rsn, 1e10, &ra, &dec);
     138        deflect (mjed, lam, bet, lsn, rsn, 1e10, &ra, &dec);
    141139
    142140        /* TODO: correction for annual parallax would go here */
     
    145143         * geocentric
    146144         */
    147         nut_eq(mjd, &ra, &dec);
    148         ab_eq(mjd, lsn, &ra, &dec);
     145        nut_eq(mjed, &ra, &dec);
     146        ab_eq(mjed, lsn, &ra, &dec);
    149147        op->s_gaera = (float)ra;
    150148        op->s_gaedec = (float)dec;
     
    193191        double dt;              /* light travel time to object */
    194192        double lg;              /* helio long of earth */
    195         double nu, ea;          /* true anomaly and eccentric anomaly */
    196         double ma;              /* mean anomaly */
     193        double nu;              /* true anomaly */
    197194        double rp=0;            /* distance from the sun */
    198195        double lo, slo, clo;    /* angle from ascending node */
     
    206203        double lam;             /* geocentric ecliptic longitude */
    207204        double bet;             /* geocentric ecliptic latitude */
    208         double e;               /* fast eccentricity */
    209205        double ll=0, sll, cll;  /* helio angle between object and earth */
    210206        double mag;             /* magnitude */
    211207        double e_n;             /* mean daily motion */
     208        double tp;              /* time from perihelion (days) */
    212209        double rpd=0;
    213210        double y;
     
    217214        sunpos (mjed, &lsn, &rsn, 0);
    218215        lg = lsn + PI;
    219 
    220         /* faster access to eccentricty */
    221         e = op->e_e;
    222216
    223217        /* mean daily motion is derived fro mean distance */
     
    235229                                        &inc, &om, &Om);
    236230
    237             ma = degrad (op->e_M + (mjed - op->e_cepoch - dt) * e_n);
    238             anomaly (ma, e, &nu, &ea);
    239             rp = op->e_a * (1-e*e) / (1+e*cos(nu));
     231            tp = mjed - dt - (op->e_cepoch - op->e_M/e_n);
     232            vrc (&nu, &rp, tp, op->e_e, op->e_a*(1-op->e_e));
     233            nu = degrad(nu);
    240234            lo = nu + om;
    241235            slo = sin(lo);
     
    301295        double dt;              /* light travel time to object */
    302296        double lg;              /* helio long of earth */
    303         double nu, ea;          /* true anomaly and eccentric anomaly */
    304         double ma;              /* mean anomaly */
     297        double nu;              /* true anomaly and eccentric anomaly */
    305298        double rp=0;            /* distance from the sun */
    306299        double lo, slo, clo;    /* angle from ascending node */
     
    319312        double mag;             /* magnitude */
    320313        double a;               /* mean distance */
     314        double tp;              /* time from perihelion (days) */
    321315        double rpd=0;
    322316        double y;
     
    342336                            &inc, &om, &Om);
    343337
    344             ma = degrad ((mjed - op->h_ep - dt) * n);
    345             anomaly (ma, e, &nu, &ea);
    346             rp = a * (e*e-1.0) / (1.0+e*cos(nu));
     338            tp = mjed - dt - op->h_ep;
     339            vrc (&nu, &rp, tp, op->h_e, op->h_qp);
     340            nu = degrad(nu);
    347341            lo = nu + om;
    348342            slo = sin(lo);
     
    581575
    582576        /* convert to equatoreal [mean equator, with mean obliquity] */
    583         ecl_eq (mjd, bet, lam, &ra, &dec);
     577        ecl_eq (mjed, bet, lam, &ra, &dec);
    584578        tra = ra;       /* keep mean coordinates */
    585579        tdec = dec;
     
    592586         */
    593587        if (!is_planet(op,SUN) && !is_planet(op,MOON))
    594             deflect (mjd, op->s_hlong, op->s_hlat, lsn, rsn, *rho, &ra, &dec);
     588            deflect (mjed, op->s_hlong, op->s_hlat, lsn, rsn, *rho, &ra, &dec);
    595589
    596590        /* correct ra/dec to form geocentric apparent */
    597         nut_eq (mjd, &ra, &dec);
     591        nut_eq (mjed, &ra, &dec);
    598592        if (!is_planet(op,MOON))
    599             ab_eq (mjd, lsn, &ra, &dec);
     593            ab_eq (mjed, lsn, &ra, &dec);
    600594        op->s_gaera = (float)ra;
    601595        op->s_gaedec = (float)dec;
     
    635629            ra = tra + dra;
    636630            dec = tdec + ddec;
    637             precess (mjd, epoch, &ra, &dec);
     631            precess (mjed, epoch, &ra, &dec);
    638632        }
    639633        range(&ra, 2*PI);
     
    755749
    756750/* For RCS Only -- Do Not Edit */
    757 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: circum.c,v $ $Date: 2001-04-10 14:40:46 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
     751static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: circum.c,v $ $Date: 2001-10-22 12:08:26 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
Note: See TracChangeset for help on using the changeset viewer.