Dec 082017
 
This program computes the orbital positions of planetary bodies and performs rigorous coordinate reductions to apparent geocentric and topocentric place (local altitude and azimuth). Includes C source code.
File AA-51.ZIP from The Programmer’s Corner in
Category Science and Education
This program computes the orbital positions of planetary bodies and performs rigorous coordinate reductions to apparent geocentric and topocentric place (local altitude and azimuth). Includes C source code.
File Name File Size Zip Size Zip Type
AA.ANS 19974 3487 deflated
AA.C 8584 3267 deflated
AA.EXE 144706 61366 deflated
AA.INI 331 221 deflated
AA.MAK 2743 581 deflated
AA.OPT 526 199 deflated
AA.QUE 425 74 deflated
AA.RF 332 184 deflated
AA.RSP 263 177 deflated
ALTAZ.C 3016 1301 deflated
ANGLES.C 1095 455 deflated
ANNUAB.C 795 431 deflated
CMOON.C 36205 11244 deflated
CONSTEL.C 3661 1391 deflated
DEFLEC.C 610 398 deflated
DELTAT.C 8273 3239 deflated
DESCRIP.MMS 2719 595 deflated
DIURAB.C 967 495 deflated
DIURPX.C 1333 665 deflated
DJGCC.MAK 483 297 deflated
DMS.C 9800 3865 deflated
EPSILN.C 1936 963 deflated
FK4FK5.C 2583 1211 deflated
KEP.H 2959 1177 deflated
KEPLER.C 10344 3862 deflated
KFILES.C 7120 2680 deflated
LIGHTT.C 1687 848 deflated
LONLAT.C 914 484 deflated
MAKEFILE 2059 496 deflated
MANOMS.C 1776 683 deflated
MEEUS.DOC 3933 1532 deflated
MESSIER.CAT 6870 1920 deflated
NUTATE.C 10171 3544 deflated
OEARTH.C 2202 1003 deflated
OJUPITER.C 5249 1831 deflated
OMARS.C 2495 849 deflated
OMERCURY.C 2137 864 deflated
ONEPTUNE.C 2621 1046 deflated
ORBIT.CAT 1245 671 deflated
OSATURN.C 6682 2069 deflated
OURANUS.C 3423 1346 deflated
OVENUS.C 2056 802 deflated
PLANET.H 1164 243 deflated
PRECESS.C 6279 2438 deflated
READ.ME 19600 7588 deflated
REFRAC.C 1500 761 deflated
RPLANET.C 2752 1242 deflated
RSTAR.C 2636 1084 deflated
SIDRLT.C 2097 961 deflated
STAR.CAT 5802 2542 deflated
SUN.C 2212 1075 deflated
TRNSIT.C 2176 1088 deflated
VEARTH.C 1070 579 deflated
ZATAN2.C 1191 583 deflated

Download File AA-51.ZIP Here

Contents of the READ.ME file



AA.ARC v5.1

This program computes the orbital positions of planetary
bodies and performs rigorous coordinate reductions to apparent
geocentric and topocentric place (local altitude and azimuth).
It also reduces star catalogue positions given in either the FK4
or FK5 system. Most of the algorithms employed are from The
Astronomical Almanac (AA) published by the U.S. Government
Printing Office.
Source code listings in C language are supplied in the file
aa.arc. The file aaexe.arc contains an IBM PC executable
version.

Reduction of Celestial Coordinates

aa.exe follows the rigorous algorithms for reduction of
celestial coordinates exactly as laid out in current editions of
the Astronomical Almanac. The reduction to apparent geocentric
place has been checked by a special version of the program that
takes planetary positions directly from the Jet Propulsion
Laboratory DE200 numerical integration of the solar system. The
results agree exactly with the Astronomical Almanac tables from
1987 onward (earlier Almanacs used slightly different reduction
methods).
Certain computations, such as the correction for nutation,
are not given explicitly in the AA but are referenced there. In
these cases the program performs the full computations that are
used to construct the Almanac tables (see the references at the
end of this document).


Running the Program

Command input to aa.exe is by single line responses to
programmed prompts. The program requests date, time, and which
of a menu of things to do. Menu item 0 is the Sun, 3 is the
Moon. The other values 1-9 are planets; 99 opens an orbit
catalogue file; 88 opens a star catalogue. Each prompt indicates
the last response you entered; this will be kept if you enter
just a carriage return.
Input can also be redirected to come from an ASCII file. For example,
invoking the program by "aa answer.dat" reads commands
from the file command.dat and writes answers to answer.dat. Menu
item -1 causes the program to exit gracefully, closing the output
file.
Entering line 0 for a star catalogue causes a jump back to the
top of the program.


Initialization

The following items will be read in automatically from a disc file
named aa.ini, if one is provided. The file contains one ASCII
string number per line so is easily edited. A sample initialization
file is supplied.

Terrestrial longitude of observer, degrees East of Greenwich
Geodetic latitude of observer (program calculates astronomical latitude)
Height above sea level, meters
Atmospheric temperature, degrees Centigrade
Atmpshperic pressure, millibars
Input time type: 1 = TDT, 2 = UT, 0 = TDT set equal to UT
Value to use for deltaT, seconds; if 0 then the program will compute it.


Orbit Computations

Several methods of calculating the positions of the planets
have been provided for in the program source code. These range
in accuracy from a built-in computation using Meeus' formulae
to a solution from precise orbital elements that you supply from
an almanac.
The program uses as a default the perturbations of the orbits
of the Earth and planets given by Jean Meeus in his
_Astronomical Formulae for Calculators_. These are derived from
the analytical theories of Newcomb and Le Verrier. Perturbation
terms of about 1 arc second and higher are included. The
smaller omitted terms add up to errors ranging from about 10 to
120 arc seconds depending on the planet. Using the perturbation
formulas given by Meeus, the accuracy of the heliocentric
coordinates has been computer checked directly against the Jet
Propulsion Laboratory DE200 numerical integration from 1800 A.D.
to 2050 A.D.. The test results are given in the file meeus.doc.
The secular perturbations (given as polynomials in time) have
errors that gradually increase as the year departs from 1900.
The calculated longitudes of Jupiter and Saturn, for example,
are in error by a few tenths of a degree at 1800 B.C. using
Meeus' formulas.
A simplified verson of the Lunar theory of Chapront-Touze'
and Chapront is used to calculate the Moon's position. It has an
accuracy of about 0.1 arc minute for modern dates and maintains
a theoretical accuracy of 0.5 arc minute back to 1500 B.C. The
real position of the Moon in ancient times is not actually known
this accurately, due to uncertainty in the tidal acceleration of
the Moon's orbit.
Higher accuracy expansions for planetary positions are given
by Pierre Bretagnon and Jean-Louis Simon, _Planetary Programs
and Tables from -4000 to +2800_. Computer readable versions are
available from the publisher. Their expansions can be
integrated easily into the program. Compatible programs (but not
the coefficients) are given in the archive called bns.arc, which
also gives test results against the DE200.
A higher accuracy expansion for the Moon is given in the archive
brown.arc. An expansion for Mars that is slightly more accurate
than the Planetary Programs formula is given in marso.arc. Test
results are also given for these expansions.

In the absence of an interpolated polynomial ephemeris such
as the DE200, the highest accuracy for current planetary
positions is achieved by using the heliocentric orbital elements
that are published in the Astronomical Almanac. If precise
orbital elements are provided for the desired epoch then the
apparent place should be found to agree very closely with
Almanac tabulations.
Entering 99 for the planet number generates a prompt for the
name of a file containg human-readable ASCII strings specifying
the elements of orbits. The items in the specification are
(see also the example file orbit.cat):

First line of entry:
epoch of orbital elements (Julian date)
inclination
longitude of the ascending node
argument of the perihelion
mean distance (semimajor axis) in au
daily motion

Second line of entry:
eccentricity
mean anomaly
epoch of equinox and ecliptic, Julian date
visual magnitude B(1,0) at 1AU from earth and sun
equatorial semidiameter at 1au, arc seconds
name of the object, up to 15 characters


Angles in the above are in degrees except as noted. Several
sample orbits are supplied in the file orbit.cat. If you read
in an orbit named "Earth" the program will install the Earth
orbit, then loop back and ask for an orbit number again.
The entry for daily motion is optional. It will be calculated
by the program if it is set equal to 0.0 in your catalogue.
Almanac values of daily motion recognize the nonzero mass of the
orbiting planet; the program's calculation will assume the mass
is zero.
Mean distance, for an elliptical orbit, is the length of the
semi-major axis of the ellipse. If the eccentricity is given to
be 1.0, the orbit is parabolic and the "mean distance" item is
taken to be the perhelion distance. Similarly a hyperbolic
orbit has eccentricity > 1.0 and "mean distance" is again
interpreted to mean perihelion distance. In both these cases,
the "epoch" is the perihelion date, and the mean anomaly is
set to 0.0 in your catalogue.
Elliptical cometary orbits are usually catalogued in terms of
perihelion distance also, but you must convert this to mean
distance to be understood by the program. Use the formula

mean distance = perihelion distance / (1 - eccentricity)

to calculate the value to be entered in your catalogue for an
elliptical orbit.
The epoch of the orbital elements refers particularly to the
date to which the given mean anomaly applies. Published data
for comets often give the time of perihelion passage as a
calendar date and fraction of a day in Ephemeris Time. To
translate this into a Julian date for your catalogue entry, run
aa.exe, type in the published date and decimal fraction of a
day, and note the displayed Julian date. This is the correct
Julian Ephemeris Date of the epoch for your catalogue entry.
Example (Sky & Telescope, March 1991, page 297): Comet Levy
1990c had a perihelion date given as 1990 Oct 24.68664 ET. As
you are prompted separately for the year, month, and day, enter
1990, 10, 24.68664 into the program. This date and fraction
translates to JED 2448189.18664. For comparison purposes, note
that published ephemerides for comets usually give astrometric
positions, not apparent positions.


Ephemeris Time and Other Time Scales

Exercise care about time scales when comparing results
against an almanac. The orbit program assumes input date is
Ephemeris Time (ET or TDT). Topocentric altitude and azimuth
are calculated from Universal Time (UT). The program converts
between the two as required, but you must indicate whether your
input entry is TDT or UT. This is done by the entry for input
time type in aa.ini. If you are comparing positions against
almanac values, you probably want TDT. If you are looking up at
the sky, you probably want UT. Ephemeris transit times can be
obtained by declaring TDT = UT. The adjustment for deltaT = ET

minus UT is accurate for the years 1620 through 1991, as the
complete tabulation from the Astronomical Almanac is included in
the program. Outside this range of years an approximate formula
is used to estimate deltaT. This formula is based on an analysis
of eclipse records going back to ancient times (Stephenson and
Houlden, 1986) but it does not predict future values very
accurately. For precise calculations, you should update the
table in deltat.c from the current year's Almanac. Note the
civil time of day is UTC, which is adjusted by integral leap
seconds to be within 0.9 second of UT.


Rise and Set Times

Time of local rising, meridian transit, and setting include a
first order correction for the motion in right ascension and
declination of the object between the entered input time and the
time of the event. The displayed rising and setting times are
accurate to a few seconds (about 1 minute for the Moon), except
when the object remains very near to the horizon. Estimated
transit time is usually within one second (assuming of course
that the orbit is correct). Age of the Moon, in days from the
nearest Quarter, also has a correction for orbital motion, but
may be off by 0.1 day (the stated Quarter is always correct,
however). These estimated times can be made much more precise by
entering the input time of day to be near the time of the event.
In other words, the rigorous calculation requires iterating on
the time of day; the program does not do this automatically so
if you want maximum accuracy you must do the iteration by hand.
The program reports the transit that is nearest to the input
time. Check the date offset displayed next to the transit time
to be sure the result is for the desired date and not for the
previous or next calendar day. The indicated transit time does
not include diurnal aberration; you must subtract this
correction yourself. For the Sun and Moon, rise and set times
are for the upper limb of the disc; but the indicated
topocentric altitude always refers to the center of the disc.


Stars

Positions and proper motions of the 57 navigational stars
were taken from the Fifth Fundamental Catalogue (FK5). They are
in the file star.cat. For all of these, the program's output of
astrometric position agreed with the 1986 AA to the precision of
the AA tabulation (an arc second). The same is true for 1950
FK4 positions taken from the SAO catalogue. The program agrees
to 0.01" with worked examples presented in the AA. Spot checks
against Apparent Places of Fundamental Stars confirm the mean
place agreement to <0.1". The APFS uses an older nutation
series, so direct comparison of apparent place is difficult.
The program incorporates the complete IAU Theory of Nutation
(1980). Items for the Messier catalogue, messier.cat, are from
either the AA or Sky Catalogue 2000.
To compute a star's apparent position, its motion since the
catalogue epoch must be taken into account as well as the
changes due to precession of the equatorial coordinate system.
Star catalogue files have the following data structure. Each
star entry occupies one line of ASCII characters. Numbers can
be in any usual decimal computer format and are separated from
each other by one or more spaces. From the beginning of the
line, the parameters are

Epoch of catalogue coordinates and equinox
Right ascension, hours
Right ascension, minutes
Right ascension, seconds
Declination, degrees
Declination, minutes
Declination, seconds
Proper motion in R.A., s/century
Proper motion in Dec., "/century
Radial velocity, km/s
Distance, parsecs
Visual magnitude
Object name

For example, the line

2000 02 31 48.704 89 15 50.72 19.877 -1.52 -17.0 0.0070 2.02 alUMi(Polaris)

has the following interpretation:

J2000.0 ;Epoch of coordinates, equator, and equinox
2h 31m 48.704s ;Right Ascension
89deg 15' 50.72" ;Declination
19.877 ;proper motion in R.A., s/century
-1.52 ;proper motion in Dec., "/century
-17.0 ;radial velocity, km/s
0.007 ;parallax, "
2.02 ;magnitude
alUMi(Polaris) ;abbreviated name for alpha Ursae Minoris (Polaris)

Standard abbreviations for 88 constellation names are
expanded into spelled out form (see constel.c). The program
accepts two types of catalogue coordinates. If the epoch is
given as 1950, the entire entry is interpreted as an FK4 item.
The program then automatically converts the data to the FK5
system. All other epochs are interpreted as being in the FK5
system.
Note that catalogue (and AA) star coordinates are referred to
the center of the solar system, whereas the program displays the
correct geocentric direction of the object. The maximum
difference is 0.8" in the case of alpha Centauri.


Corrections Not Implemented

Several adjustments are not included. In general, the Sun is
assumed incorrectly to be at the center of the solar system.
Since the orbit parameters are heliocentric, the main
discrepancy is a tiny change in the annual aberration on the
order of 0.01". The difference between TDT and TDB (Terrestrial
versus Solar System barycentric time) is ignored. The
topocentric correction for polar motion of the Earth is also
ignored.


- Stephen L. Moshier, November, 1987
Version 5.0: July, 1991



Disc Files

aa.ini Initialization file - edit this to reflect your location
aa.exe Executable program for IBM PC MSDOS
messier.cat Star catalogue of the Messier objects
orbit.cat Orbit catalogue with example comets, asteroids, etc.
star.cat Star catalogue of FK5 navigational stars
aa.mak Microsoft C MSDOS make file
aa.rsp Auxiliary to aa.mak
makefile Unix make file
descrip.mms VAX make file (MMS)
aa.opt Auxiliary to descrip.mms
aa.que Test questions
aa.ans Answers to test questions (not necessarily true, but
what the program says)
aa.c Main program, keyboard commands

altaz.c Apparent geocentric to local topocentric place
angles.c Angles and sides of triangle in three dimensions
annuab.c Annual aberration
constel.c Expand constellation name abbreviations
deflec.c Deflection of light due to Sun's gravity
deltat.c Ephemeris Time minus Universal Time
diurab.c Diurnal aberration
diurpx.c Diurnal parallax
dms.c Time and date conversions and display
epsiln.c Obliquity of the ecliptic
fk4fk5.c FK4 to FK5 star catalogue conversion
kepler.c Solve hyperbolic, parabolic, or elliptical Keplerian orbits
kfiles.c System dependent disc file I/O to read catalogues
lightt.c Correction for light time
lonlat.c Convert equatorial coordinates to ecliptic polar coordinates
nutate.c IAU nutation series
precess.c Precession of the equinox and ecliptic
refrac.c Correction for atmospheric refraction
rplanet.c Main reduction subroutine for planets
rstar.c Main reduction subroutine for stars
sidrlt.c Sidereal time
sun.c Main reduction subroutine for the position of the Sun
trnsit.c Transit of the local meridian
vearth.c Estimated velocity vector of the Earth
zatan2.c Quadrant correct arctangent with result from 0 to 2pi
kep.h Include file for orbit and other data structures
planet.h Include file for planetary perturbation routines
manoms.c Mean elements of the planetary orbits
moon.c Computation of the Moon's position
oearth.c Orbit and perturbations for the Earth
ojupiter.c Orbit and perturbations for Jupiter
omars.c Orbit and perturbations for Mars
omercury.c Orbit and perturbations for Mercury
oneptune.c Orbit and perturbations for Neptune
osaturn.c Orbit and perturbations for Saturn
ouranus.c Orbit and perturbations for Uranus
ovenus.c Orbit and perturbations for Venus



References

Nautical Almanac Office, U. S. Naval Observatory, _Astronomical
Almanac for the Year 1986_, U. S. Government Printing Office,
1985.

Nautical Almanac Office, U. S. Naval Observatory, _Almanac for
Computers, 1986_, U. S. Government Printing Office

Meeus, Jean, _Astronomical Formulae for Calculators_, 3rd ed.,
Willmann-Bell, Inc., 1985.

Moulton, F. R., _An Introduction to Celestial Mechanics_, 2nd ed.,
Macmillan, 1914 (Dover reprint, 1970)

Taff, L. G., _Celestial Mechanics, A Computational Guide for the
Practitioner_, Wiley, 1985

Newcomb, S., _Tables of the Four Inner Planets, Astronomical
Papers Prepared for the Use of the American Ephemeris and Nautical
Almanac_, Vol. VI. Bureau of Equipment, Navy Department,
Washington, 1898

Lieske, J. H., T. Lederle, W. Fricke, and B. Morando,
"Expressions for the Precession Quantities Based upon the IAU
(1976) System of Astronomical Constants," Astronomy and
Astrophysics 58, 1-16 (1977).

Laskar, J., "Secular terms of classical planetary theories
using the results of general theory," Astronomy and Astrophysics
157, 59070 (1986).

Bretagnon, P. and G. Francou, "Planetary theories in rectangular
and spherical variables. VSOP87 solutions," Astronomy and
Astrophysics 202, 309-315 (1988).

Bretagnon, P. and Simon, J.-L., _Planetary Programs and Tables
from -4000 to +2800_, Willmann-Bell, 1986

Seidelmann, P. K., et al., "Summary of 1980 IAU Theory of Nutation
(Final Report of the IAU Working Group on Nutation)" in
Transactions of the IAU Vol. XVIII A, Reports on Astronomy,
P. A. Wayman, ed.; D. Reidel Pub. Co., 1982.

"Nutation and the Earth's Rotation", I.A.U. Symposium No. 78,
May, 1977, page 256. I.A.U., 1980.

Woolard, E.W., "A redevelopment of the theory of nutation",
The Astronomical Journal, 58, 1-3 (1953).

Morrison, L. V. and F. R. Stephenson, "Sun and Planetary System"
vol 96,73 eds. W. Fricke, G. Teleki, Reidel, Dordrecht (1982)

Stephenson, F. R., and M. A. Houlden, _Atlas of Historical
Eclipse Maps_, Cambridge U. Press, 1986

M. Chapront-Touze' and J. Chapront, "ELP2000-85: a semi-analytical
lunar ephemeris adequate for historical times," Astronomy and
Astrophysics 190, 342-352 (1988).


 December 8, 2017  Add comments

Leave a Reply