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

    r1457 r1719  
    108108 * [planet][0] = angular size at 1 AU
    109109 * [planet][1] = magnitude at 1 AU from sun and earth and 0 deg phase angle
    110  */
    111 static double vis_elements[8][2] = {
    112         /* Mercury */   { 6.74, -0.42, },
    113         /* Venus */     { 16.92, -4.34, },
    114         /* Mars */      { 9.36, -1.20, },
    115         /* Jupiter */   { 196.74, -9.4, },
    116         /* Saturn */    { 165.6, -8.88, },
    117         /* Uranus */    { 65.8, -7.19, },
    118         /* Neptune */   { 62.2, -6.87, },
    119         /* Pluto */     { 8.2, -1.0, }
     110 * [planet][2] = A
     111 * [planet][3] = B
     112 * [planet][4] = C
     113 *   where mag correction = A*(i/100) + B*(i/100)^2 + C*(i/100)^3
     114 *      i = angle between sun and earth from planet, degrees
     115 * from Explanatory Supplement, 1992
     116 */
     117static double vis_elements[8][5] = {
     118        /* Mercury */   { 6.74, -0.36, 3.8, -2.73, 2.00},
     119        /* Venus */     { 16.92, -4.29, 0.09, 2.39, -.65},
     120        /* Mars */      { 9.36, -1.52, 1.60, 0., 0.},
     121        /* Jupiter */   { 196.74, -9.25, 0.50, 0., 0.},
     122        /* Saturn */    { 165.6, -8.88, 4.40, 0., 0.},
     123        /* Uranus */    { 65.8, -7.19, 0.28, 0., 0.},
     124        /* Neptune */   { 62.2, -6.87, 0., 0., 0.},
     125        /* Pluto */     { 8.2, -1.01, 4.1, 0., 0.}
    120126};
    121127
     
    132138 *         seen from the center of the Earth for the given instant.
    133139 *   dia:  angular diameter in arcsec at 1 AU,
    134  *   mag:  visual magnitude when 1 AU from sun and earth at 0 phase angle.
     140 *   mag:  visual magnitude
    135141 *
    136142 * all angles are in radians, all distances in AU.
     
    148154{
    149155        static double lastmjd = -10000;
    150         static double lsn, bsn, rsn;    /* geometric geocentric coords of sun */
    151         static double xsn, ysn, zsn;
     156        static double lsn, bsn, rsn;    /* geocentric coords of sun */
     157        static double xsn, ysn, zsn;    /* cartesian " */
    152158        double lp, bp, rp;              /* heliocentric coords of planet */
    153159        double xp, yp, zp, rho;         /* rect. coords and geocentric dist. */
    154160        double dt;                      /* light time */
     161        double *vp;                     /* vis_elements[p] */
     162        double ci, i;                   /* sun/earth angle: cos, degrees */
    155163        int pass;
    156164
     
    202210        }
    203211
    204         *dia = vis_elements[p][0];
    205         *mag = vis_elements[p][1];
     212        vp = vis_elements[p];
     213        *dia = vp[0];
     214
     215        /* solve plane triangle, assume sun/earth dist == 1 */
     216        ci = (rp*rp + rho*rho - 1)/(2*rp*rho);
     217
     218        /* expl supp equation for mag */
     219        if (ci < -1) ci = -1;
     220        if (ci >  1) ci =  1;
     221        i = raddeg(acos(ci))/100.;
     222        *mag = vp[1] + 5*log10(rho*rp) + i*(vp[2] + i*(vp[3] + i*vp[4]));
     223
     224        /* rings contribution if SATURN */
     225        if (p == SATURN) {
     226            double et, st, set;
     227            satrings (bp, lp, rp, lsn+PI, rsn, mjd+MJD0, &et, &st);
     228            set = sin(fabs(et));
     229            *mag += (-2.60 + 1.25*set)*set;
     230        }
    206231}
    207232
    208233/* For RCS Only -- Do Not Edit */
    209 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: plans.c,v $ $Date: 2001-04-10 14:40:47 $ $Revision: 1.1.1.1 $ $Name: not supported by cvs2svn $"};
     234static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: plans.c,v $ $Date: 2001-10-22 12:08:27 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
Note: See TracChangeset for help on using the changeset viewer.