Ignore:
Timestamp:
Jan 17, 2005, 11:13:08 AM (21 years ago)
Author:
cmv
Message:

update pour version 3.6.3 Xephem cmv 17/01/04

File:
1 edited

Legend:

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

    r2551 r2643  
    1111static int use_bdl (double jd, char *dir, MoonData md[U_NMOONS]);
    1212static void moonradec (double usize, MoonData md[U_NMOONS]);
    13 static void moonSVis (Obj *eop, Obj *uop, MoonData md[U_NMOONS]);
     13static void moonSVis (Obj *sop, Obj *uop, MoonData md[U_NMOONS]);
    1414static void moonEVis (MoonData md[U_NMOONS]);
     15static void moonPShad (Obj *sop, Obj *uop, MoonData md[U_NMOONS]);
     16static void moonTrans (MoonData md[U_NMOONS]);
    1517
    1618/* moon table and a few other goodies and when it was last computed */
     
    2931static char ubdlfn[] = "uranus.9910";
    3032
     33/* These values are from the Explanatory Supplement.
     34 * Precession degrades them gradually over time.
     35 */
     36#define POLE_RA         degrad(257.43)  /* RA of Uranus' north pole */
     37#define POLE_DEC        degrad(-15.10)  /* Dec of Uranus' north pole */
     38
     39
    3140/* get uranus info in md[0], moon info in md[1..U_NMOONS-1].
    3241 * if !uop caller just wants md[] for names
    33  * N.B. we assume eop and uop are updated.
     42 * N.B. we assume sop and uop are updated.
    3443 */
    3544void
     
    3746double Mjd,             /* mjd */
    3847char dir[],             /* dir in which to look for helper files */
    39 Obj *eop,               /* earth == Sun */
     48Obj *sop,               /* Sun */
    4049Obj *uop,               /* uranus */
    4150double *sizep,          /* u angular diam, rads */
     51double *polera, double *poledec,      /* pole location */
    4252MoonData md[U_NMOONS])  /* return info */
    4353{
     
    4656        /* always copy back at least for name */
    4757        memcpy (md, umd, sizeof(umd));
     58
     59        /* pole */
     60        if (polera) *polera = POLE_RA;
     61        if (poledec) *poledec = POLE_DEC;
    4862
    4963        /* nothing else if repeat call or just want names */
     
    86100
    87101        /* set visibilities */
    88         moonSVis (eop, uop, md);
     102        moonSVis (sop, uop, md);
     103        moonPShad (sop, uop, md);
    89104        moonEVis (md);
     105        moonTrans (md);
    90106
    91107        /* fill in moon ra and dec */
     
    172188static void
    173189moonSVis(
    174 Obj *eop,               /* earth == SUN */
     190Obj *sop,               /* SUN */
    175191Obj *uop,               /* uranus */
    176192MoonData md[U_NMOONS])
    177193{
    178         double esd = eop->s_edist;
     194        double esd = sop->s_edist;
    179195        double eod = uop->s_edist;
    180196        double sod = uop->s_sdist;
     
    215231}
    216232
     233/* set pshad and sx,sy shadow info */
     234static void
     235moonPShad(
     236Obj *sop,             /* SUN */
     237Obj *uop,             /* uranus */
     238MoonData md[U_NMOONS])
     239{
     240        int i;
     241
     242        for (i = 1; i < U_NMOONS; i++) {
     243            MoonData *mdp = &md[i];
     244            mdp->pshad = !plshadow (uop, sop, POLE_RA, POLE_DEC, mdp->x,
     245                                          mdp->y, mdp->z, &mdp->sx, &mdp->sy);
     246        }
     247}
     248
     249/* set whether moons are transiting */
     250static void
     251moonTrans (MoonData md[U_NMOONS])
     252{
     253        int i;
     254
     255        for (i = 1; i < U_NMOONS; i++) {
     256            MoonData *mdp = &md[i];
     257            mdp->trans = mdp->z > 0 && mdp->x*mdp->x + mdp->y*mdp->y < 1;
     258        }
     259}
     260
     261
    217262/* For RCS Only -- Do Not Edit */
    218 static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: umoon.c,v $ $Date: 2004-06-15 16:54:12 $ $Revision: 1.1 $ $Name: not supported by cvs2svn $"};
     263static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: umoon.c,v $ $Date: 2005-01-17 10:13:08 $ $Revision: 1.2 $ $Name: not supported by cvs2svn $"};
Note: See TracChangeset for help on using the changeset viewer.