| 1 | #ifndef _ASTRO_H
 | 
|---|
| 2 | #define _ASTRO_H
 | 
|---|
| 3 | 
 | 
|---|
| 4 | #include <stdio.h>
 | 
|---|
| 5 | 
 | 
|---|
| 6 | #ifndef PI
 | 
|---|
| 7 | #define PI              3.141592653589793
 | 
|---|
| 8 | #endif
 | 
|---|
| 9 | 
 | 
|---|
| 10 | /* conversions among hours (of ra), degrees and radians. */
 | 
|---|
| 11 | #define degrad(x)       ((x)*PI/180.)
 | 
|---|
| 12 | #define raddeg(x)       ((x)*180./PI)
 | 
|---|
| 13 | #define hrdeg(x)        ((x)*15.)
 | 
|---|
| 14 | #define deghr(x)        ((x)/15.)
 | 
|---|
| 15 | #define hrrad(x)        degrad(hrdeg(x))
 | 
|---|
| 16 | #define radhr(x)        deghr(raddeg(x))
 | 
|---|
| 17 | 
 | 
|---|
| 18 | /* ratio of from synodic (solar) to sidereal (stellar) rate */
 | 
|---|
| 19 | #define SIDRATE         .9972695677
 | 
|---|
| 20 | 
 | 
|---|
| 21 | #define SPD     (24.0*3600.0)   /* seconds per day */
 | 
|---|
| 22 | 
 | 
|---|
| 23 | /* manifest names for planets.
 | 
|---|
| 24 |  * N.B. must coincide with usage in pelement.c and plans.c.
 | 
|---|
| 25 |  * N.B. only the first 8 are valid for use with plans().
 | 
|---|
| 26 |  */
 | 
|---|
| 27 | typedef enum {
 | 
|---|
| 28 |     MERCURY,
 | 
|---|
| 29 |     VENUS,
 | 
|---|
| 30 |     MARS,
 | 
|---|
| 31 |     JUPITER,
 | 
|---|
| 32 |     SATURN,
 | 
|---|
| 33 |     URANUS,
 | 
|---|
| 34 |     NEPTUNE,
 | 
|---|
| 35 |     PLUTO,
 | 
|---|
| 36 |     SUN,
 | 
|---|
| 37 |     MOON,
 | 
|---|
| 38 |     NOBJ        /* total number of basic objects */
 | 
|---|
| 39 | } PLCode;
 | 
|---|
| 40 | 
 | 
|---|
| 41 | /* moon constants for pl_moon */
 | 
|---|
| 42 | typedef enum {
 | 
|---|
| 43 |     X_PLANET = 0,                       /* use to mean planet itself */
 | 
|---|
| 44 |     PHOBOS = NOBJ, DEIMOS,
 | 
|---|
| 45 |     IO, EUROPA, GANYMEDE, CALLISTO,
 | 
|---|
| 46 |     MIMAS, ENCELADUS, TETHYS, DIONE, RHEA, TITAN, HYPERION, IAPETUS,
 | 
|---|
| 47 |     ARIEL, UMBRIEL, TITANIA, OBERON, MIRANDA,
 | 
|---|
| 48 |     NBUILTIN
 | 
|---|
| 49 | } MCode;
 | 
|---|
| 50 | 
 | 
|---|
| 51 | /* starting point for MJD calculations
 | 
|---|
| 52 |  */
 | 
|---|
| 53 | #define MJD0  2415020.0
 | 
|---|
| 54 | #define J2000 (2451545.0 - MJD0)      /* yes, 2000 January 1 at 12h */
 | 
|---|
| 55 | 
 | 
|---|
| 56 | /* the Now and Obj typedefs.
 | 
|---|
| 57 |  * also, a few miscellaneous constants and declarations.
 | 
|---|
| 58 |  */
 | 
|---|
| 59 | 
 | 
|---|
| 60 | #define SPD     (24.0*3600.0)   /* seconds per day */
 | 
|---|
| 61 | #define MAU     (1.4959787e11)  /* m / au */
 | 
|---|
| 62 | #define LTAU    499.005         /* seconds light takes to travel 1 AU */
 | 
|---|
| 63 | #define ERAD    (6.37816e6)     /* earth equitorial radius, m */
 | 
|---|
| 64 | #define MRAD    (1.740e6)       /* moon equitorial radius, m */
 | 
|---|
| 65 | #define SRAD    (6.95e8)        /* sun equitorial radius, m */
 | 
|---|
| 66 | #define FTPM    3.28084         /* ft per m */
 | 
|---|
| 67 | #define ESAT_MAG        2       /* default satellite magnitude */
 | 
|---|
| 68 | #define FAST_SAT_RPD    0.25    /* max earth sat rev/day considered "fast" */
 | 
|---|
| 69 | 
 | 
|---|
| 70 | #define EOD     (-9786)         /* special epoch flag: use epoch of date */
 | 
|---|
| 71 | 
 | 
|---|
| 72 | /* info about the local observing circumstances and misc preferences */
 | 
|---|
| 73 | typedef struct {
 | 
|---|
| 74 |         double n_mjd;   /* modified Julian date, ie, days since
 | 
|---|
| 75 |                          * Jan 0.5 1900 (== 12 noon, Dec 30, 1899), utc.
 | 
|---|
| 76 |                          * enough precision to get well better than 1 second.
 | 
|---|
| 77 |                          * N.B. if not first member, must move NOMJD inits.
 | 
|---|
| 78 |                          */
 | 
|---|
| 79 |         double n_lat;   /* geographic (surface-normal) lt, >0 north, rads */
 | 
|---|
| 80 |         double n_lng;   /* longitude, >0 east, rads */
 | 
|---|
| 81 |         double n_tz;    /* time zone, hrs behind UTC */
 | 
|---|
| 82 |         double n_temp;  /* atmospheric temp, degrees C */
 | 
|---|
| 83 |         double n_pressure; /* atmospheric pressure, mBar */
 | 
|---|
| 84 |         double n_elev;  /* elevation above sea level, earth radii */
 | 
|---|
| 85 |         double n_dip;   /* dip of sun below hzn at twilight, >0 below, rads */
 | 
|---|
| 86 |         double n_epoch; /* desired precession display ep as an mjd, or EOD */
 | 
|---|
| 87 |         char n_tznm[8]; /* time zone name; 7 chars or less, always 0 at end */
 | 
|---|
| 88 | } Now;
 | 
|---|
| 89 | 
 | 
|---|
| 90 | /* handy shorthands for fields in a Now pointer, np */
 | 
|---|
| 91 | #define mjd     np->n_mjd
 | 
|---|
| 92 | #define lat     np->n_lat
 | 
|---|
| 93 | #define lng     np->n_lng
 | 
|---|
| 94 | #define tz      np->n_tz
 | 
|---|
| 95 | #define temp    np->n_temp
 | 
|---|
| 96 | #define pressure np->n_pressure
 | 
|---|
| 97 | #define elev    np->n_elev
 | 
|---|
| 98 | #define dip     np->n_dip
 | 
|---|
| 99 | #define epoch   np->n_epoch
 | 
|---|
| 100 | #define tznm    np->n_tznm
 | 
|---|
| 101 | #define mjed    mm_mjed(np)
 | 
|---|
| 102 | 
 | 
|---|
| 103 | /* structures to describe objects of various types.
 | 
|---|
| 104 |  */
 | 
|---|
| 105 | 
 | 
|---|
| 106 | /* magnitude values in two different systems */
 | 
|---|
| 107 | typedef struct {
 | 
|---|
| 108 |     float m1, m2;       /* either g/k or H/G, depending on... */
 | 
|---|
| 109 |     int whichm;         /* one of MAG_gk or MAG_HG */
 | 
|---|
| 110 | } Mag;
 | 
|---|
| 111 | 
 | 
|---|
| 112 | /* whichm */
 | 
|---|
| 113 | #define MAG_HG          0       /* using 0 makes HG the initial default */
 | 
|---|
| 114 | #define MAG_gk          1
 | 
|---|
| 115 | 
 | 
|---|
| 116 | /* we actually store magnitudes times this scale factor in a short int */
 | 
|---|
| 117 | #define MAGSCALE        100.0
 | 
|---|
| 118 | #define set_smag(op,m)  ((op)->s_mag = (short)floor((m)*MAGSCALE + 0.5))
 | 
|---|
| 119 | #define set_fmag(op,m)  ((op)->f_mag = (short)floor((m)*MAGSCALE + 0.5))
 | 
|---|
| 120 | #define get_mag(op)     ((op)->s_mag / MAGSCALE)
 | 
|---|
| 121 | #define get_fmag(op)    ((op)->f_mag / MAGSCALE)
 | 
|---|
| 122 | 
 | 
|---|
| 123 | /* longest object name, including trailing '\0' */
 | 
|---|
| 124 | #define MAXNM   21
 | 
|---|
| 125 | 
 | 
|---|
| 126 | typedef unsigned char ObjType_t;
 | 
|---|
| 127 | typedef unsigned char ObjAge_t;
 | 
|---|
| 128 | typedef unsigned char byte;
 | 
|---|
| 129 | 
 | 
|---|
| 130 | /* Obj is a massive union.
 | 
|---|
| 131 |  * many fields are in common so we use macros to make things a little easier.
 | 
|---|
| 132 |  */
 | 
|---|
| 133 | 
 | 
|---|
| 134 | /* fields common to *all* structs in the Obj union */
 | 
|---|
| 135 | #define OBJ_COMMON_FLDS                                                 \
 | 
|---|
| 136 |     ObjType_t co_type;  /* current object type; see flags, below */     \
 | 
|---|
| 137 |     byte co_flags;      /* FUSER*... used by others */                  \
 | 
|---|
| 138 |     ObjAge_t co_age;    /* update aging code; see db.c */               \
 | 
|---|
| 139 |     char co_name[MAXNM];/* name, including \0 */                        \
 | 
|---|
| 140 |     float co_ra;        /* geo/topo app/mean ra, rads */                \
 | 
|---|
| 141 |     float co_dec;       /* geo/topo app/mean dec, rads */               \
 | 
|---|
| 142 |     float co_gaera;     /* geo apparent ra, rads */                     \
 | 
|---|
| 143 |     float co_gaedec;    /* geo apparent dec, rads */                    \
 | 
|---|
| 144 |     float co_az;        /* azimuth, >0 e of n, rads */                  \
 | 
|---|
| 145 |     float co_alt;       /* altitude above topocentric horizon, rads */  \
 | 
|---|
| 146 |     float co_elong;     /* angular sep btwen obj and sun, >0 E, degs */ \
 | 
|---|
| 147 |     float co_size;      /* angular size, arc secs */                    \
 | 
|---|
| 148 |     short co_mag        /* visual magnitude * MAGSCALE */
 | 
|---|
| 149 | 
 | 
|---|
| 150 | /* fields common to all solar system objects in the Obj union */
 | 
|---|
| 151 | #define OBJ_SOLSYS_FLDS                                                 \
 | 
|---|
| 152 |     OBJ_COMMON_FLDS;    /* all the fixed ones plus ... */               \
 | 
|---|
| 153 |     float so_sdist;     /* dist from object to sun, au */               \
 | 
|---|
| 154 |     float so_edist;     /* dist from object to earth, au */             \
 | 
|---|
| 155 |     float so_hlong;     /* heliocentric longitude, rads */              \
 | 
|---|
| 156 |     float so_hlat;      /* heliocentric latitude, rads */               \
 | 
|---|
| 157 |     float so_phase      /* phase, % */
 | 
|---|
| 158 | 
 | 
|---|
| 159 | /* fields common to all fixed objects in the Obj union */
 | 
|---|
| 160 | #define OBJ_FIXED_FLDS                                                  \
 | 
|---|
| 161 |     char  fo_spect[2];  /* spectral codes, if appropriate */            \
 | 
|---|
| 162 |     float fo_epoch;     /* eq of ra/dec and time when pm=0; mjd */      \
 | 
|---|
| 163 |     float fo_ra;        /* ra, rads, in epoch frame */                  \
 | 
|---|
| 164 |     float fo_dec;       /* dec, rads, in epoch frame */                 \
 | 
|---|
| 165 |     float fo_pmra;      /* ra proper motion, rads/day/cos(dec) */       \
 | 
|---|
| 166 |     float fo_pmdec;     /* dec proper motion, rads/day */               \
 | 
|---|
| 167 |     char  fo_class      /* object class */
 | 
|---|
| 168 | 
 | 
|---|
| 169 | /* a generic object */
 | 
|---|
| 170 | typedef struct {
 | 
|---|
| 171 |     OBJ_COMMON_FLDS;
 | 
|---|
| 172 | } ObjAny;
 | 
|---|
| 173 | 
 | 
|---|
| 174 | /* a generic sol system object */
 | 
|---|
| 175 | typedef struct {
 | 
|---|
| 176 |     OBJ_SOLSYS_FLDS;
 | 
|---|
| 177 | } ObjSS;
 | 
|---|
| 178 | 
 | 
|---|
| 179 | /* basic Fixed object info.
 | 
|---|
| 180 |  */
 | 
|---|
| 181 | typedef struct {
 | 
|---|
| 182 |     OBJ_COMMON_FLDS;
 | 
|---|
| 183 |     OBJ_FIXED_FLDS;
 | 
|---|
| 184 | 
 | 
|---|
| 185 |     /* following are for galaxies */
 | 
|---|
| 186 |     byte  fo_ratio;     /* minor/major diameter ratio. use s/get_ratio() */
 | 
|---|
| 187 |     byte  fo_pa;        /* position angle, E of N, rads. use s/get_pa() */
 | 
|---|
| 188 | } ObjF;
 | 
|---|
| 189 | 
 | 
|---|
| 190 | /* true-orbit parameters of binary-star object type */
 | 
|---|
| 191 | typedef struct {
 | 
|---|
| 192 |     float bo_T;         /* epoch of periastron, years */
 | 
|---|
| 193 |     float bo_e;         /* eccentricity */
 | 
|---|
| 194 |     float bo_o;         /* argument of periastron, degress */
 | 
|---|
| 195 |     float bo_O;         /* longitude of node, degrees */
 | 
|---|
| 196 |     float bo_i;         /* inclination to plane of sky, degrees */
 | 
|---|
| 197 |     float bo_a;         /* semi major axis, arc secs */
 | 
|---|
| 198 |     float bo_P;         /* period, years */
 | 
|---|
| 199 | 
 | 
|---|
| 200 |     /* companion position, computed by obj_cir() iff b_2compute */
 | 
|---|
| 201 |     float bo_pa;        /* position angle @ ep, rads E of N */
 | 
|---|
| 202 |     float bo_sep;       /* separation @ ep, arc secs */
 | 
|---|
| 203 |     float bo_ra;        /* geo/topo app/mean ra, rads */
 | 
|---|
| 204 |     float bo_dec;       /* geo/topo app/mean dec, rads */
 | 
|---|
| 205 | } BinOrbit;
 | 
|---|
| 206 | typedef struct {
 | 
|---|
| 207 |     float bp_ep;        /* epoch of pa/sep, year */
 | 
|---|
| 208 |     float bp_pa;        /* position angle @ ep, rads E of N */
 | 
|---|
| 209 |     float bp_sep;       /* separation @ ep, arc secs */
 | 
|---|
| 210 | 
 | 
|---|
| 211 |     /* companion position, computed by obj_cir() iff b_2compute */
 | 
|---|
| 212 |     float bp_ra;        /* geo/topo app/mean ra, rads */
 | 
|---|
| 213 |     float bp_dec;       /* geo/topo app/mean dec, rads */
 | 
|---|
| 214 | } BinPos;
 | 
|---|
| 215 | #define MAXBINPOS 2     /* max discrete epochs to store when no elements */
 | 
|---|
| 216 | typedef struct {
 | 
|---|
| 217 |     OBJ_COMMON_FLDS;
 | 
|---|
| 218 |     OBJ_FIXED_FLDS;
 | 
|---|
| 219 | 
 | 
|---|
| 220 |     byte b_2compute;    /* whether to compute secondary positions */
 | 
|---|
| 221 |     byte b_nbp;         /* number of b_bp[] or 0 to use b_bo */
 | 
|---|
| 222 |     short b_2mag;       /* secondary's magnitude * MAGSCALE */
 | 
|---|
| 223 |     char b_2spect[2];   /* secondary's spectrum */
 | 
|---|
| 224 | 
 | 
|---|
| 225 |     /* either a real orbit or a set of discrete pa/sep */
 | 
|---|
| 226 |     union {
 | 
|---|
| 227 |         BinOrbit b_bo;                  /* orbital elements */
 | 
|---|
| 228 |         BinPos b_bp[MAXBINPOS];         /* table of discrete positions */
 | 
|---|
| 229 |     } u;
 | 
|---|
| 230 | } ObjB;
 | 
|---|
| 231 | 
 | 
|---|
| 232 | #define fo_mag  co_mag  /* pseudonym for so_mag since it is not computed */
 | 
|---|
| 233 | #define fo_size co_size /* pseudonym for so_size since it is not computed */
 | 
|---|
| 234 | 
 | 
|---|
| 235 | /* macros to pack/unpack some fields */
 | 
|---|
| 236 | #define SRSCALE         255.0           /* galaxy size ratio scale */
 | 
|---|
| 237 | #define PASCALE         (255.0/(2*PI))  /* pos angle scale factor */
 | 
|---|
| 238 | #define get_ratio(op)   (((int)(op)->f_ratio)/SRSCALE)
 | 
|---|
| 239 | #define set_ratio(op,maj,min) ((op)->f_ratio = (byte)(((maj) > 0)           \
 | 
|---|
| 240 |                                         ? ((min)*SRSCALE/(double)(maj)+0.5) \
 | 
|---|
| 241 |                                         : 0))
 | 
|---|
| 242 | #define get_pa(op)      ((double)(op)->f_pa/PASCALE)
 | 
|---|
| 243 | #define set_pa(op,s)    ((op)->f_pa = (byte)((s)*PASCALE + 0.5))
 | 
|---|
| 244 | 
 | 
|---|
| 245 | #define NCLASSES        128 /* n potential fo_classes -- allow for all ASCII */
 | 
|---|
| 246 | 
 | 
|---|
| 247 | /* basic planet object info */
 | 
|---|
| 248 | typedef struct {
 | 
|---|
| 249 |     OBJ_SOLSYS_FLDS;
 | 
|---|
| 250 |     PLCode plo_code;            /* which planet */
 | 
|---|
| 251 |     MCode plo_moon;             /* which moon, or X_PLANET if planet */
 | 
|---|
| 252 |     char plo_evis, plo_svis;    /* if moon: whether visible from earth, sun */
 | 
|---|
| 253 |     double plo_x, plo_y, plo_z; /* if moon: eq dist from center, planet radii */
 | 
|---|
| 254 |     double plo_aux1, plo_aux2;  /* various values, depending on type */
 | 
|---|
| 255 | } ObjPl;
 | 
|---|
| 256 | 
 | 
|---|
| 257 | /* basic info about an object in elliptical heliocentric orbit */
 | 
|---|
| 258 | typedef struct {
 | 
|---|
| 259 |     OBJ_SOLSYS_FLDS;
 | 
|---|
| 260 |     float  eo_inc;      /* inclination, degrees */
 | 
|---|
| 261 |     float  eo_Om;       /* longitude of ascending node, degrees */
 | 
|---|
| 262 |     float  eo_om;       /* argument of perihelion, degress */
 | 
|---|
| 263 |     float  eo_a;        /* mean distance, aka,semi-maj axis,AU */
 | 
|---|
| 264 |     float  eo_M;        /* mean anomaly, ie, degrees from perihelion at cepoch*/
 | 
|---|
| 265 |     float  eo_size;     /* angular size, in arc seconds at 1 AU */
 | 
|---|
| 266 |     float  eo_startok;  /* nominal first mjd this set is ok, else 0 */
 | 
|---|
| 267 |     float  eo_endok;    /* nominal last mjd this set is ok, else 0 */
 | 
|---|
| 268 |     double eo_e;        /* eccentricity (double for when near 1 computing q) */
 | 
|---|
| 269 |     double eo_cepoch;   /* epoch date (M reference), as an mjd */
 | 
|---|
| 270 |     double eo_epoch;    /* equinox year (inc/Om/om reference), as an mjd. */
 | 
|---|
| 271 |     Mag    eo_mag;      /* magnitude */
 | 
|---|
| 272 | } ObjE;
 | 
|---|
| 273 | 
 | 
|---|
| 274 | /* basic info about an object in hyperbolic heliocentric orbit */
 | 
|---|
| 275 | typedef struct {
 | 
|---|
| 276 |     OBJ_SOLSYS_FLDS;
 | 
|---|
| 277 |     double ho_epoch;    /* equinox year (inc/Om/om reference), as an mjd */
 | 
|---|
| 278 |     double ho_ep;       /* epoch of perihelion, as an mjd */
 | 
|---|
| 279 |     float  ho_startok;  /* nominal first mjd this set is ok, else 0 */
 | 
|---|
| 280 |     float  ho_endok;    /* nominal last mjd this set is ok, else 0 */
 | 
|---|
| 281 |     float  ho_inc;      /* inclination, degs */
 | 
|---|
| 282 |     float  ho_Om;       /* longitude of ascending node, degs */
 | 
|---|
| 283 |     float  ho_om;       /* argument of perihelion, degs. */
 | 
|---|
| 284 |     float  ho_e;        /* eccentricity */
 | 
|---|
| 285 |     float  ho_qp;       /* perihelion distance, AU */
 | 
|---|
| 286 |     float  ho_g, ho_k;  /* magnitude model coefficients */
 | 
|---|
| 287 |     float  ho_size;     /* angular size, in arc seconds at 1 AU */
 | 
|---|
| 288 | } ObjH;
 | 
|---|
| 289 | 
 | 
|---|
| 290 | /* basic info about an object in parabolic heliocentric orbit */
 | 
|---|
| 291 | typedef struct {
 | 
|---|
| 292 |     OBJ_SOLSYS_FLDS;
 | 
|---|
| 293 |     double po_epoch;    /* reference epoch, as an mjd */
 | 
|---|
| 294 |     double po_ep;       /* epoch of perihelion, as an mjd */
 | 
|---|
| 295 |     float  po_startok;  /* nominal first mjd this set is ok, else 0 */
 | 
|---|
| 296 |     float  po_endok;    /* nominal last mjd this set is ok, else 0 */
 | 
|---|
| 297 |     float  po_inc;      /* inclination, degs */
 | 
|---|
| 298 |     float  po_qp;       /* perihelion distance, AU */
 | 
|---|
| 299 |     float  po_om;       /* argument of perihelion, degs. */
 | 
|---|
| 300 |     float  po_Om;       /* longitude of ascending node, degs */
 | 
|---|
| 301 |     float  po_g, po_k;  /* magnitude model coefficients */
 | 
|---|
| 302 |     float  po_size;     /* angular size, in arc seconds at 1 AU */
 | 
|---|
| 303 | } ObjP;
 | 
|---|
| 304 | 
 | 
|---|
| 305 | /* basic earth satellite object info */
 | 
|---|
| 306 | typedef struct {
 | 
|---|
| 307 |     OBJ_COMMON_FLDS;
 | 
|---|
| 308 |     double eso_epoch;   /* reference epoch, as an mjd */
 | 
|---|
| 309 |     double eso_n;       /* mean motion, rev/day
 | 
|---|
| 310 |                          * N.B. we need double due to a sensitive differencing
 | 
|---|
| 311 |                          * operation used to compute MeanAnomaly in
 | 
|---|
| 312 |                          * esat_main()/satellite.c.
 | 
|---|
| 313 |                          */
 | 
|---|
| 314 |     float  eso_startok; /* nominal first mjd this set is ok, else 0 */
 | 
|---|
| 315 |     float  eso_endok;   /* nominal last mjd this set is ok, else 0 */
 | 
|---|
| 316 |     float  eso_inc;     /* inclination, degs */
 | 
|---|
| 317 |     float  eso_raan;    /* RA of ascending node, degs */
 | 
|---|
| 318 |     float  eso_e;       /* eccentricity */
 | 
|---|
| 319 |     float  eso_ap;      /* argument of perigee at epoch, degs */
 | 
|---|
| 320 |     float  eso_M;       /* mean anomaly, ie, degrees from perigee at epoch */
 | 
|---|
| 321 |     float  eso_decay;   /* orbit decay rate, rev/day^2 */
 | 
|---|
| 322 |     float  eso_drag;    /* object drag coefficient, (earth radii)^-1 */
 | 
|---|
| 323 |     int    eso_orbit;   /* integer orbit number of epoch */
 | 
|---|
| 324 | 
 | 
|---|
| 325 |     /* computed "sky" results unique to earth satellites */
 | 
|---|
| 326 |     float  ess_elev;    /* height of satellite above sea level, m */
 | 
|---|
| 327 |     float  ess_range;   /* line-of-site distance from observer to satellite, m*/
 | 
|---|
| 328 |     float  ess_rangev;  /* rate-of-change of range, m/s */
 | 
|---|
| 329 |     float  ess_sublat;  /* latitude below satellite, >0 north, rads */
 | 
|---|
| 330 |     float  ess_sublng;  /* longitude below satellite, >0 east, rads */
 | 
|---|
| 331 |     int    ess_eclipsed;/* 1 if satellite is in earth's shadow, else 0 */
 | 
|---|
| 332 | } ObjES;
 | 
|---|
| 333 | 
 | 
|---|
| 334 | typedef union {
 | 
|---|
| 335 |     ObjAny  any;        /* these fields valid for all types */
 | 
|---|
| 336 |     ObjSS   anyss;      /* these fields valid for all solar system types */
 | 
|---|
| 337 |     ObjPl   pl;         /* planet */
 | 
|---|
| 338 |     ObjF    f;          /* fixed object, plus proper motion */
 | 
|---|
| 339 |     ObjB    b;          /* bona fide binary stars (doubles are stored in f) */
 | 
|---|
| 340 |     ObjE    e;          /* object in heliocentric elliptical orbit */
 | 
|---|
| 341 |     ObjH    h;          /* object in heliocentric hyperbolic trajectory */
 | 
|---|
| 342 |     ObjP    p;          /* object in heliocentric parabolic trajectory */
 | 
|---|
| 343 |     ObjES   es;         /* earth satellite */
 | 
|---|
| 344 | } Obj;
 | 
|---|
| 345 | 
 | 
|---|
| 346 | 
 | 
|---|
| 347 | /* for o_flags -- everybody must agree */
 | 
|---|
| 348 | #define FUSER0          0x01
 | 
|---|
| 349 | #define FUSER1          0x02
 | 
|---|
| 350 | #define FUSER2          0x04
 | 
|---|
| 351 | #define FUSER3          0x08
 | 
|---|
| 352 | #define FUSER4          0x10
 | 
|---|
| 353 | #define FUSER5          0x20
 | 
|---|
| 354 | #define FUSER6          0x40
 | 
|---|
| 355 | #define FUSER7          0x80
 | 
|---|
| 356 | 
 | 
|---|
| 357 | /* mark an object as being a "field star" */
 | 
|---|
| 358 | #define FLDSTAR         FUSER3
 | 
|---|
| 359 | /* mark an object as circum calculation failed */
 | 
|---|
| 360 | #define NOCIRCUM        FUSER7
 | 
|---|
| 361 | 
 | 
|---|
| 362 | /* Obj shorthands: */
 | 
|---|
| 363 | #define o_type          any.co_type
 | 
|---|
| 364 | #define o_name          any.co_name
 | 
|---|
| 365 | #define o_flags         any.co_flags
 | 
|---|
| 366 | #define o_age           any.co_age
 | 
|---|
| 367 | #define s_ra            any.co_ra
 | 
|---|
| 368 | #define s_dec           any.co_dec
 | 
|---|
| 369 | #define s_gaera         any.co_gaera
 | 
|---|
| 370 | #define s_gaedec        any.co_gaedec
 | 
|---|
| 371 | #define s_az            any.co_az
 | 
|---|
| 372 | #define s_alt           any.co_alt
 | 
|---|
| 373 | #define s_elong         any.co_elong
 | 
|---|
| 374 | #define s_size          any.co_size
 | 
|---|
| 375 | #define s_mag           any.co_mag
 | 
|---|
| 376 | 
 | 
|---|
| 377 | #define s_sdist         anyss.so_sdist
 | 
|---|
| 378 | #define s_edist         anyss.so_edist
 | 
|---|
| 379 | #define s_hlong         anyss.so_hlong
 | 
|---|
| 380 | #define s_hlat          anyss.so_hlat
 | 
|---|
| 381 | #define s_phase         anyss.so_phase
 | 
|---|
| 382 | 
 | 
|---|
| 383 | #define s_elev          es.ess_elev
 | 
|---|
| 384 | #define s_range         es.ess_range
 | 
|---|
| 385 | #define s_rangev        es.ess_rangev
 | 
|---|
| 386 | #define s_sublat        es.ess_sublat
 | 
|---|
| 387 | #define s_sublng        es.ess_sublng
 | 
|---|
| 388 | #define s_eclipsed      es.ess_eclipsed
 | 
|---|
| 389 | 
 | 
|---|
| 390 | #define f_class         f.fo_class
 | 
|---|
| 391 | #define f_spect         f.fo_spect
 | 
|---|
| 392 | #define f_ratio         f.fo_ratio
 | 
|---|
| 393 | #define f_pa            f.fo_pa
 | 
|---|
| 394 | #define f_epoch         f.fo_epoch
 | 
|---|
| 395 | #define f_RA            f.fo_ra
 | 
|---|
| 396 | #define f_pmRA          f.fo_pmra
 | 
|---|
| 397 | #define f_dec           f.fo_dec
 | 
|---|
| 398 | #define f_pmdec         f.fo_pmdec
 | 
|---|
| 399 | #define f_mag           f.fo_mag
 | 
|---|
| 400 | #define f_size          f.fo_size
 | 
|---|
| 401 | 
 | 
|---|
| 402 | #define e_cepoch        e.eo_cepoch
 | 
|---|
| 403 | #define e_epoch         e.eo_epoch
 | 
|---|
| 404 | #define e_startok       e.eo_startok
 | 
|---|
| 405 | #define e_endok         e.eo_endok
 | 
|---|
| 406 | #define e_inc           e.eo_inc
 | 
|---|
| 407 | #define e_Om            e.eo_Om
 | 
|---|
| 408 | #define e_om            e.eo_om
 | 
|---|
| 409 | #define e_a             e.eo_a
 | 
|---|
| 410 | #define e_e             e.eo_e
 | 
|---|
| 411 | #define e_M             e.eo_M
 | 
|---|
| 412 | #define e_size          e.eo_size
 | 
|---|
| 413 | #define e_mag           e.eo_mag
 | 
|---|
| 414 | 
 | 
|---|
| 415 | #define h_epoch         h.ho_epoch
 | 
|---|
| 416 | #define h_startok       h.ho_startok
 | 
|---|
| 417 | #define h_endok         h.ho_endok
 | 
|---|
| 418 | #define h_ep            h.ho_ep
 | 
|---|
| 419 | #define h_inc           h.ho_inc
 | 
|---|
| 420 | #define h_Om            h.ho_Om
 | 
|---|
| 421 | #define h_om            h.ho_om
 | 
|---|
| 422 | #define h_e             h.ho_e
 | 
|---|
| 423 | #define h_qp            h.ho_qp
 | 
|---|
| 424 | #define h_g             h.ho_g
 | 
|---|
| 425 | #define h_k             h.ho_k
 | 
|---|
| 426 | #define h_size          h.ho_size
 | 
|---|
| 427 | 
 | 
|---|
| 428 | #define p_epoch         p.po_epoch
 | 
|---|
| 429 | #define p_startok       p.po_startok
 | 
|---|
| 430 | #define p_endok         p.po_endok
 | 
|---|
| 431 | #define p_ep            p.po_ep
 | 
|---|
| 432 | #define p_inc           p.po_inc
 | 
|---|
| 433 | #define p_qp            p.po_qp
 | 
|---|
| 434 | #define p_om            p.po_om
 | 
|---|
| 435 | #define p_Om            p.po_Om
 | 
|---|
| 436 | #define p_g             p.po_g
 | 
|---|
| 437 | #define p_k             p.po_k
 | 
|---|
| 438 | #define p_size          p.po_size
 | 
|---|
| 439 | 
 | 
|---|
| 440 | #define es_epoch        es.eso_epoch
 | 
|---|
| 441 | #define es_startok      es.eso_startok
 | 
|---|
| 442 | #define es_endok        es.eso_endok
 | 
|---|
| 443 | #define es_inc          es.eso_inc
 | 
|---|
| 444 | #define es_raan         es.eso_raan
 | 
|---|
| 445 | #define es_e            es.eso_e
 | 
|---|
| 446 | #define es_ap           es.eso_ap
 | 
|---|
| 447 | #define es_M            es.eso_M
 | 
|---|
| 448 | #define es_n            es.eso_n
 | 
|---|
| 449 | #define es_decay        es.eso_decay
 | 
|---|
| 450 | #define es_drag         es.eso_drag
 | 
|---|
| 451 | #define es_orbit        es.eso_orbit
 | 
|---|
| 452 | 
 | 
|---|
| 453 | #define pl_code         pl.plo_code
 | 
|---|
| 454 | #define pl_moon         pl.plo_moon
 | 
|---|
| 455 | #define pl_evis         pl.plo_evis
 | 
|---|
| 456 | #define pl_svis         pl.plo_svis
 | 
|---|
| 457 | #define pl_x            pl.plo_x
 | 
|---|
| 458 | #define pl_y            pl.plo_y
 | 
|---|
| 459 | #define pl_z            pl.plo_z
 | 
|---|
| 460 | #define pl_aux1         pl.plo_aux1
 | 
|---|
| 461 | #define pl_aux2         pl.plo_aux2
 | 
|---|
| 462 | 
 | 
|---|
| 463 | #define b_2compute      b.b_2compute
 | 
|---|
| 464 | #define b_2spect        b.b_2spect
 | 
|---|
| 465 | #define b_2mag          b.b_2mag
 | 
|---|
| 466 | #define b_bo            b.u.b_bo
 | 
|---|
| 467 | #define b_bp            b.u.b_bp
 | 
|---|
| 468 | #define b_nbp           b.b_nbp
 | 
|---|
| 469 | 
 | 
|---|
| 470 | /* insure we always refer to the fields and no monkey business */
 | 
|---|
| 471 | #undef OBJ_COMMON_FLDS
 | 
|---|
| 472 | #undef OBJ_SOLSYS_FLDS
 | 
|---|
| 473 | 
 | 
|---|
| 474 | /* o_type code.
 | 
|---|
| 475 |  * N.B. names are assigned in order in objmenu.c
 | 
|---|
| 476 |  * N.B. if add one add switch in obj_cir().
 | 
|---|
| 477 |  * N.B. UNDEFOBJ must be zero so new objects are undefinied by being zeroed.
 | 
|---|
| 478 |  * N.B. maintain the bitmasks too.
 | 
|---|
| 479 |  */
 | 
|---|
| 480 | enum ObjType {
 | 
|---|
| 481 |     UNDEFOBJ=0,
 | 
|---|
| 482 |     FIXED, BINARYSTAR, ELLIPTICAL, HYPERBOLIC, PARABOLIC, EARTHSAT, PLANET,
 | 
|---|
| 483 |     NOBJTYPES
 | 
|---|
| 484 | };
 | 
|---|
| 485 | 
 | 
|---|
| 486 | /* types as handy bitmasks too */
 | 
|---|
| 487 | #define OBJTYPE2MASK(t) (1<<(t))
 | 
|---|
| 488 | #define FIXEDM          OBJTYPE2MASK(FIXED)
 | 
|---|
| 489 | #define BINARYSTARM     OBJTYPE2MASK(BINARYSTAR)
 | 
|---|
| 490 | #define ELLIPTICALM     OBJTYPE2MASK(ELLIPTICAL)
 | 
|---|
| 491 | #define HYPERBOLICM     OBJTYPE2MASK(HYPERBOLIC)
 | 
|---|
| 492 | #define PARABOLICM      OBJTYPE2MASK(PARABOLIC)
 | 
|---|
| 493 | #define EARTHSATM       OBJTYPE2MASK(EARTHSAT)
 | 
|---|
| 494 | #define PLANETM         OBJTYPE2MASK(PLANET)
 | 
|---|
| 495 | #define ALLM            (~0)
 | 
|---|
| 496 | 
 | 
|---|
| 497 | /* rise, set and transit information.
 | 
|---|
| 498 |  */
 | 
|---|
| 499 | typedef struct {
 | 
|---|
| 500 |     int rs_flags;       /* info about what has been computed and any
 | 
|---|
| 501 |                          * special conditions; see flags, below.
 | 
|---|
| 502 |                          */
 | 
|---|
| 503 |     double rs_risetm;   /* mjd time of rise today */
 | 
|---|
| 504 |     double rs_riseaz;   /* azimuth of rise, rads E of N */
 | 
|---|
| 505 |     double rs_trantm;   /* mjd time of transit today */
 | 
|---|
| 506 |     double rs_tranalt;  /* altitude of transit, rads up from horizon */
 | 
|---|
| 507 |     double rs_settm;    /* mjd time of set today */
 | 
|---|
| 508 |     double rs_setaz;    /* azimuth of set, rads E of N */
 | 
|---|
| 509 | } RiseSet;
 | 
|---|
| 510 | 
 | 
|---|
| 511 | /* RiseSet flags */
 | 
|---|
| 512 | #define RS_NORISE       0x0001  /* object does not rise as such today */
 | 
|---|
| 513 | #define RS_NOSET        0x0002  /* object does not set as such today */
 | 
|---|
| 514 | #define RS_NOTRANS      0x0004  /* object does not transit as such today */
 | 
|---|
| 515 | #define RS_CIRCUMPOLAR  0x0010  /* object stays up all day today */
 | 
|---|
| 516 | #define RS_NEVERUP      0x0020  /* object never up at all today */
 | 
|---|
| 517 | #define RS_ERROR        0x1000  /* can't figure out anything! */
 | 
|---|
| 518 | #define RS_RISERR       (0x0100|RS_ERROR) /* error computing rise */
 | 
|---|
| 519 | #define RS_SETERR       (0x0200|RS_ERROR) /* error computing set */
 | 
|---|
| 520 | #define RS_TRANSERR     (0x0400|RS_ERROR) /* error computing transit */
 | 
|---|
| 521 | 
 | 
|---|
| 522 | #define is_type(op,m)   (OBJTYPE2MASK((op)->o_type) & (m))
 | 
|---|
| 523 | 
 | 
|---|
| 524 | /* any planet or its moons */
 | 
|---|
| 525 | #define is_planet(op,p) (is_type(op,PLANETM) && op->pl_code == (p))
 | 
|---|
| 526 | 
 | 
|---|
| 527 | /* any solar system object */
 | 
|---|
| 528 | #define is_ssobj(op)    is_type(op,PLANETM|HYPERBOLICM|PARABOLICM|ELLIPTICALM)
 | 
|---|
| 529 | 
 | 
|---|
| 530 |  | 
|---|
| 531 | 
 | 
|---|
| 532 | /* natural satellite support */
 | 
|---|
| 533 | 
 | 
|---|
| 534 | typedef struct {
 | 
|---|
| 535 |     char *full;         /* full name */
 | 
|---|
| 536 |     char *tag;          /* Roman numeral tag */
 | 
|---|
| 537 |     float x, y, z;      /* sky loc in planet radii: +x:east +y:south +z:front */
 | 
|---|
| 538 |     float ra, dec;      /* sky location in ra/dec */
 | 
|---|
| 539 |     float mag;          /* magnitude */
 | 
|---|
| 540 |     int evis;           /* whether geometrically visible from earth */
 | 
|---|
| 541 |     int svis;           /* whether in sun light */
 | 
|---|
| 542 |     int pshad;          /* whether moon is casting shadow on planet */
 | 
|---|
| 543 |     int trans;          /* whether moon is transiting */
 | 
|---|
| 544 |     float sx, sy;       /* shadow sky loc in planet radii: +x:east +y:south */
 | 
|---|
| 545 | } MoonData;
 | 
|---|
| 546 | 
 | 
|---|
| 547 | /* separate set for each planet -- use in pl_moon */
 | 
|---|
| 548 | 
 | 
|---|
| 549 | 
 | 
|---|
| 550 | enum _marsmoons {
 | 
|---|
| 551 |     M_MARS = 0,                                 /* == X_PLANET */
 | 
|---|
| 552 |     M_PHOBOS, M_DEIMOS,
 | 
|---|
| 553 |     M_NMOONS                                    /* including planet at 0 */
 | 
|---|
| 554 | };
 | 
|---|
| 555 | 
 | 
|---|
| 556 | enum _jupmoons {
 | 
|---|
| 557 |     J_JUPITER = 0,                              /* == X_PLANET */
 | 
|---|
| 558 |     J_IO, J_EUROPA, J_GANYMEDE, J_CALLISTO,
 | 
|---|
| 559 |     J_NMOONS                                    /* including planet */
 | 
|---|
| 560 | };
 | 
|---|
| 561 | 
 | 
|---|
| 562 | enum _satmoons {
 | 
|---|
| 563 |     S_SATURN = 0,                               /* == X_PLANET */
 | 
|---|
| 564 |     S_MIMAS, S_ENCELADUS, S_TETHYS, S_DIONE,
 | 
|---|
| 565 |     S_RHEA, S_TITAN, S_HYPERION, S_IAPETUS,
 | 
|---|
| 566 |     S_NMOONS                                    /* including planet */
 | 
|---|
| 567 | };
 | 
|---|
| 568 | 
 | 
|---|
| 569 | enum _uramoons {
 | 
|---|
| 570 |     U_URANUS = 0,                               /* == X_PLANET */
 | 
|---|
| 571 |     U_ARIEL, U_UMBRIEL, U_TITANIA, U_OBERON, U_MIRANDA,
 | 
|---|
| 572 |     U_NMOONS                                    /* including planet */
 | 
|---|
| 573 | };
 | 
|---|
| 574 | 
 | 
|---|
| 575 | #define X_MAXNMOONS     S_NMOONS                /* N.B. chosen by hand */
 | 
|---|
| 576 | 
 | 
|---|
| 577 |  | 
|---|
| 578 | 
 | 
|---|
| 579 | /* global function declarations */
 | 
|---|
| 580 | 
 | 
|---|
| 581 | 
 | 
|---|
| 582 | /* aa_hadec.c */
 | 
|---|
| 583 | extern void aa_hadec (double lt, double alt, double az, double *ha,
 | 
|---|
| 584 |     double *dec);
 | 
|---|
| 585 | extern void hadec_aa (double lt, double ha, double dec, double *alt,
 | 
|---|
| 586 |     double *az); 
 | 
|---|
| 587 | 
 | 
|---|
| 588 | /* aberration.c */
 | 
|---|
| 589 | extern void ab_ecl (double m, double lsn, double *lam, double *bet);
 | 
|---|
| 590 | extern void ab_eq (double m, double lsn, double *ra, double *dec);
 | 
|---|
| 591 | 
 | 
|---|
| 592 | /* airmass.c */
 | 
|---|
| 593 | extern void airmass (double aa, double *Xp);
 | 
|---|
| 594 | 
 | 
|---|
| 595 | /* anomaly.c */
 | 
|---|
| 596 | extern void anomaly (double ma, double s, double *nu, double *ea);
 | 
|---|
| 597 | 
 | 
|---|
| 598 | /* ap_as.c */
 | 
|---|
| 599 | extern void ap_as ( Now *np, double Mjd, double *rap, double *decp);
 | 
|---|
| 600 | extern void as_ap ( Now *np, double Mjd, double *rap, double *decp);
 | 
|---|
| 601 | 
 | 
|---|
| 602 | /* atlas.c */
 | 
|---|
| 603 | extern char *um_atlas (double ra, double dec);
 | 
|---|
| 604 | extern char *u2k_atlas (double ra, double dec);
 | 
|---|
| 605 | extern char *msa_atlas (double ra, double dec);
 | 
|---|
| 606 | 
 | 
|---|
| 607 | /* aux.c */
 | 
|---|
| 608 | extern double mm_mjed (Now *np);
 | 
|---|
| 609 | 
 | 
|---|
| 610 | /* chap95.c */
 | 
|---|
| 611 | extern int chap95 (double m, int obj, double prec, double *ret);
 | 
|---|
| 612 | 
 | 
|---|
| 613 | /* chap95_data.c */
 | 
|---|
| 614 | 
 | 
|---|
| 615 | /* circum.c */
 | 
|---|
| 616 | extern int obj_cir (Now *np, Obj *op);
 | 
|---|
| 617 | 
 | 
|---|
| 618 | /* comet.c */
 | 
|---|
| 619 | extern void comet (double m, double ep, double inc, double ap, double qp,
 | 
|---|
| 620 |     double om, double *lpd, double *psi, double *rp, double *rho, double *lam,
 | 
|---|
| 621 |     double *bet);
 | 
|---|
| 622 | 
 | 
|---|
| 623 | /* constel.c */
 | 
|---|
| 624 | #define NCNS    89
 | 
|---|
| 625 | extern int cns_pick (double r, double d, double e);
 | 
|---|
| 626 | extern int cns_id (char *abbrev);
 | 
|---|
| 627 | extern char *cns_name (int id);
 | 
|---|
| 628 | extern int cns_edges (double e, double **ra0p, double **dec0p, double **ra1p,
 | 
|---|
| 629 |     double **dec1p);
 | 
|---|
| 630 | extern int cns_list (double ra, double dec, double e, double rad, int ids[]);
 | 
|---|
| 631 | extern int cns_figure (int id, double e, double ra[],double dec[],int dcodes[]);
 | 
|---|
| 632 | extern int cns_loadfigs (FILE *fp, char msg[]);
 | 
|---|
| 633 | 
 | 
|---|
| 634 | /* dbfmt.c */
 | 
|---|
| 635 | extern int db_crack_line (char s[], Obj *op, char nm[][MAXNM], int nnm,
 | 
|---|
| 636 |     char whynot[]);
 | 
|---|
| 637 | extern void db_write_line (Obj *op, char *lp);
 | 
|---|
| 638 | extern int dbline_candidate (char line[]);
 | 
|---|
| 639 | extern int get_fields (char *s, int delim, char *fields[]);
 | 
|---|
| 640 | extern int db_tle (char *name, char *l1, char *l2, Obj *op);
 | 
|---|
| 641 | extern int dateRangeOK (Now *np, Obj *op);
 | 
|---|
| 642 | 
 | 
|---|
| 643 | /* deltat.c */
 | 
|---|
| 644 | extern double deltat (double m);
 | 
|---|
| 645 | 
 | 
|---|
| 646 | /* earthsat.c */
 | 
|---|
| 647 | extern int obj_earthsat (Now *np, Obj *op);
 | 
|---|
| 648 | 
 | 
|---|
| 649 | /* eq_ecl.c */
 | 
|---|
| 650 | extern void eq_ecl (double m, double ra, double dec, double *lt,double *lg);
 | 
|---|
| 651 | extern void ecl_eq (double m, double lt, double lg, double *ra,double *dec);
 | 
|---|
| 652 | 
 | 
|---|
| 653 | /* eq_gal.c */
 | 
|---|
| 654 | extern void eq_gal (double m, double ra, double dec, double *lt,double *lg);
 | 
|---|
| 655 | extern void gal_eq (double m, double lt, double lg, double *ra,double *dec);
 | 
|---|
| 656 | 
 | 
|---|
| 657 | /* formats.c */
 | 
|---|
| 658 | extern int fs_sexa (char *out, double a, int w, int fracbase);
 | 
|---|
| 659 | extern int fs_date (char out[], int format, double jd);
 | 
|---|
| 660 | extern int f_scansexa (const char *str, double *dp);
 | 
|---|
| 661 | extern void f_sscandate (char *bp, int pref, int *m, double *d, int *y);
 | 
|---|
| 662 | 
 | 
|---|
| 663 | /* helio.c */
 | 
|---|
| 664 | extern void heliocorr (double jd, double ra, double dec, double *hcp);
 | 
|---|
| 665 | 
 | 
|---|
| 666 | /* jupmoon.c */
 | 
|---|
| 667 | extern void jupiter_data (double Mjd, char dir[], Obj *sop, Obj *jop,
 | 
|---|
| 668 |     double *jupsize, double *cmlI, double *cmlII, double *polera,
 | 
|---|
| 669 |     double *poledec, MoonData md[J_NMOONS]); 
 | 
|---|
| 670 | 
 | 
|---|
| 671 | /* libration.c */
 | 
|---|
| 672 | extern void llibration (double JD, double *llatp, double *llonp);
 | 
|---|
| 673 | 
 | 
|---|
| 674 | /* magdecl.c */
 | 
|---|
| 675 | extern int magdecl (double l, double L, double e, double y, char *dir,
 | 
|---|
| 676 |     double *dp, char *err);
 | 
|---|
| 677 | 
 | 
|---|
| 678 | /* marsmoon.c */
 | 
|---|
| 679 | extern void marsm_data (double Mjd, char dir[], Obj *sop, Obj *mop,
 | 
|---|
| 680 |     double *marssize, double *polera, double *poledec, MoonData md[M_NMOONS]); 
 | 
|---|
| 681 | 
 | 
|---|
| 682 | /* misc.c */
 | 
|---|
| 683 | extern void zero_mem (void *loc, unsigned len);
 | 
|---|
| 684 | extern int tickmarks (double min, double max, int numdiv, double ticks[]);
 | 
|---|
| 685 | extern int lc (int cx, int cy, int cw, int x1, int y1, int x2, int y2,
 | 
|---|
| 686 |     int *sx1, int *sy1, int *sx2, int *sy2);
 | 
|---|
| 687 | extern void hg_mag (double h, double g, double rp, double rho, double rsn,
 | 
|---|
| 688 |     double *mp);
 | 
|---|
| 689 | extern int magdiam (int fmag, int magstp, double scale, double mag,
 | 
|---|
| 690 |     double size);
 | 
|---|
| 691 | extern void gk_mag (double g, double k, double rp, double rho, double *mp);
 | 
|---|
| 692 | extern double atod (char *buf);
 | 
|---|
| 693 | extern void solve_sphere (double A, double b, double cc, double sc,
 | 
|---|
| 694 |     double *cap, double *Bp);
 | 
|---|
| 695 | extern double delra (double dra);
 | 
|---|
| 696 | extern void now_lst (Now *np, double *lstp);
 | 
|---|
| 697 | extern void radec2ha (Now *np, double ra, double dec, double *hap);
 | 
|---|
| 698 | extern void gha (Now *np, Obj *op, double *ghap);
 | 
|---|
| 699 | extern char *obj_description (Obj *op);
 | 
|---|
| 700 | extern int is_deepsky (Obj *op);
 | 
|---|
| 701 | 
 | 
|---|
| 702 | /* mjd.c */
 | 
|---|
| 703 | extern void cal_mjd (int mn, double dy, int yr, double *m);
 | 
|---|
| 704 | extern void mjd_cal (double m, int *mn, double *dy, int *yr);
 | 
|---|
| 705 | extern int mjd_dow (double m, int *dow);
 | 
|---|
| 706 | extern int isleapyear (int year);
 | 
|---|
| 707 | extern void mjd_dpm (double m, int *ndays);
 | 
|---|
| 708 | extern void mjd_year (double m, double *yr);
 | 
|---|
| 709 | extern void year_mjd (double y, double *m);
 | 
|---|
| 710 | extern void rnd_second (double *t);
 | 
|---|
| 711 | extern void mjd_dayno (double jd, int *yr, double *dy);
 | 
|---|
| 712 | extern double mjd_day (double jd);
 | 
|---|
| 713 | extern double mjd_hr (double jd);
 | 
|---|
| 714 | extern void range (double *v, double r);
 | 
|---|
| 715 | extern void radecrange (double *ra, double *dec);
 | 
|---|
| 716 | 
 | 
|---|
| 717 | /* moon.c */
 | 
|---|
| 718 | extern void moon (double m, double *lam, double *bet, double *rho,
 | 
|---|
| 719 |     double *msp, double *mdp);
 | 
|---|
| 720 | 
 | 
|---|
| 721 | /* mooncolong.c */
 | 
|---|
| 722 | extern void moon_colong (double jd, double lt, double lg, double *cp,
 | 
|---|
| 723 |     double *kp, double *ap, double *sp);
 | 
|---|
| 724 | 
 | 
|---|
| 725 | /* moonnf.c */
 | 
|---|
| 726 | extern void moonnf (double mj, double *mjn, double *mjf);
 | 
|---|
| 727 | 
 | 
|---|
| 728 | /* nutation.c */
 | 
|---|
| 729 | extern void nutation (double m, double *deps, double *dpsi);
 | 
|---|
| 730 | extern void nut_eq (double m, double *ra, double *dec);
 | 
|---|
| 731 | 
 | 
|---|
| 732 | /* obliq.c */
 | 
|---|
| 733 | extern void obliquity (double m, double *eps);
 | 
|---|
| 734 | 
 | 
|---|
| 735 | /* parallax.c */
 | 
|---|
| 736 | extern void ta_par (double tha, double tdec, double phi, double ht,
 | 
|---|
| 737 |     double *rho, double *aha, double *adec);
 | 
|---|
| 738 | 
 | 
|---|
| 739 | /* parallactic.c */
 | 
|---|
| 740 | extern double parallacticLDA (double lt, double dec, double alt);
 | 
|---|
| 741 | extern double parallacticLHD (double lt, double ha, double dec);
 | 
|---|
| 742 | 
 | 
|---|
| 743 | /* plans.c */
 | 
|---|
| 744 | extern void plans (double m, PLCode p, double *lpd0, double *psi0,
 | 
|---|
| 745 |     double *rp0, double *rho0, double *lam, double *bet, double *dia,
 | 
|---|
| 746 |     double *mag);
 | 
|---|
| 747 | 
 | 
|---|
| 748 | /* plshadow.c */
 | 
|---|
| 749 | extern int plshadow (Obj *op, Obj *sop, double polera,
 | 
|---|
| 750 |     double poledec, double x, double y, double z, float *sxp, float *syp);
 | 
|---|
| 751 | 
 | 
|---|
| 752 | /* plmoon_cir.c */
 | 
|---|
| 753 | extern int plmoon_cir (Now *np, Obj *moonop);
 | 
|---|
| 754 | extern int getBuiltInObjs (Obj **opp);
 | 
|---|
| 755 | extern void setMoonDir (char *dir);
 | 
|---|
| 756 | 
 | 
|---|
| 757 | /* precess.c */
 | 
|---|
| 758 | extern void precess (double mjd1, double mjd2, double *ra, double *dec);
 | 
|---|
| 759 | 
 | 
|---|
| 760 | /* reduce.c */
 | 
|---|
| 761 | extern void reduce_elements (double mjd0, double m, double inc0,
 | 
|---|
| 762 |     double ap0, double om0, double *inc, double *ap, double *om);
 | 
|---|
| 763 | 
 | 
|---|
| 764 | /* refract.c */
 | 
|---|
| 765 | extern void unrefract (double pr, double tr, double aa, double *ta);
 | 
|---|
| 766 | extern void refract (double pr, double tr, double ta, double *aa);
 | 
|---|
| 767 | 
 | 
|---|
| 768 | /* rings.c */
 | 
|---|
| 769 | extern void satrings (double sb, double sl, double sr, double el, double er,
 | 
|---|
| 770 |     double JD, double *etiltp, double *stiltp);
 | 
|---|
| 771 | 
 | 
|---|
| 772 | /* riset.c */
 | 
|---|
| 773 | extern void riset (double ra, double dec, double lt, double dis,
 | 
|---|
| 774 |     double *lstr, double *lsts, double *azr, double *azs, int *status);
 | 
|---|
| 775 | 
 | 
|---|
| 776 | /* riset_cir.c */
 | 
|---|
| 777 | extern void riset_cir (Now *np, Obj *op, double dis, RiseSet *rp);
 | 
|---|
| 778 | extern void twilight_cir (Now *np, double dis, double *dawn, double *dusk,
 | 
|---|
| 779 |     int *status);
 | 
|---|
| 780 | 
 | 
|---|
| 781 | /* satmoon.c */
 | 
|---|
| 782 | extern void saturn_data (double Mjd, char dir[], Obj *eop, Obj *sop,
 | 
|---|
| 783 |     double *satsize, double *etilt, double *stlit, double *polera, 
 | 
|---|
| 784 |     double *poledec, MoonData md[S_NMOONS]); 
 | 
|---|
| 785 | 
 | 
|---|
| 786 | /* sphcart.c */
 | 
|---|
| 787 | extern void sphcart (double l, double b, double r, double *x, double *y,
 | 
|---|
| 788 |     double *z);
 | 
|---|
| 789 | extern void cartsph (double x, double y, double z, double *l, double *b,
 | 
|---|
| 790 |     double *r);
 | 
|---|
| 791 | 
 | 
|---|
| 792 | /* sun.c */
 | 
|---|
| 793 | extern void sunpos (double m, double *lsn, double *rsn, double *bsn);
 | 
|---|
| 794 | 
 | 
|---|
| 795 | /* twobody.c */
 | 
|---|
| 796 | extern int vrc (double *v, double *r, double tp, double e, double q);
 | 
|---|
| 797 | 
 | 
|---|
| 798 | /* umoon.c */
 | 
|---|
| 799 | extern void uranus_data (double Mjd, char dir[], Obj *sop, Obj *uop,
 | 
|---|
| 800 |     double *usize, double *polera, double *poledec, MoonData md[U_NMOONS]); 
 | 
|---|
| 801 | 
 | 
|---|
| 802 | /* utc_gst.c */
 | 
|---|
| 803 | extern void utc_gst (double m, double utc, double *gst);
 | 
|---|
| 804 | extern void gst_utc (double m, double gst, double *utc);
 | 
|---|
| 805 | 
 | 
|---|
| 806 | /* vsop87.c */
 | 
|---|
| 807 | extern int vsop87 (double m, int obj, double prec, double *ret);
 | 
|---|
| 808 | 
 | 
|---|
| 809 | #endif /* _ASTRO_H */
 | 
|---|
| 810 | 
 | 
|---|
| 811 | /* For RCS Only -- Do Not Edit
 | 
|---|
| 812 |  * @(#) $RCSfile: astro.h,v $ $Date: 2006-11-22 13:53:28 $ $Revision: 1.6 $ $Name: not supported by cvs2svn $
 | 
|---|
| 813 |  */
 | 
|---|