debian/0000755000000000000000000000000011724216650007172 5ustar debian/rules0000755000000000000000000000543511724147355010266 0ustar #!/usr/bin/make -f # -*- makefile -*- # Sample debian/rules that uses debhelper. # This file was originally written by Joey Hess and Craig Small. # As a special exception, when this file is copied by dh-make into a # dh-make output file, you may use that output file without restriction. # This special exception was added by Craig Small in version 0.37 of dh-make. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 PACKAGE=astronomical-almanac DESTDIR = $(CURDIR)/debian/$(PACKAGE) CFLAGS = -Wall -g INSTALL = install INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j$(NUMJOBS) endif configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: configure-stamp dh_testdir # compile the package. $(MAKE) moonrise conjunct aa touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # clean up after the build process. rm -f *.o aa moonrise conjunct dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs # install the package into debian/$(PACKAGE). # $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PACKAGE) # moonrise for f in aa conjunct; do \ $(INSTALL_PROGRAM) $$f $(DESTDIR)/usr/bin/$$f; done for f in star.cat messier.cat orbit.cat; do \ $(INSTALL_FILE) $$f $(DESTDIR)/usr/share/aa/$$f; done $(INSTALL_FILE) aa.ini $(DESTDIR)/etc/aa.ini # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installchangelogs dh_installdocs read.me readme.404 dh_installexamples aa.que aa.ans debian/README.examples \ debian/leg57.log debian/leg57.work # dh_install # dh_installmenu # dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinit # dh_installcron # dh_installinfo dh_installman debian/aa.1 debian/conjunct.1 dh_link dh_strip dh_compress dh_fixperms # dh_perl # dh_python # dh_makeshlibs dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure debian/leg57.work0000644000000000000000000001774111716744520011036 0ustar Silicon Sea Leg 57 This problem is one of a series by Dan Hogan published in the NAVIGATION-L mailing list. They are available from the list home page http://www.offsoundings.info/navl.htm, described as follows: Silicon Sea is a series of small boat navigation problems in the form of a circumnavigation. Each problem, called a Leg, is complete to itself, There is no need to have worked previous Legs to participate. But being subscribed to Navigation-L is a great help. The navigation cruise started in Mallorca, Spain, transited the Red Sea, crossed the Indian Ocean, Southern Ocean and stopped in Sydney, Australia. Then to Auckland, New Zealand, around Cape Horn up to Bridgetown, Barbados. transited the Panama Canal and took the sailing route to Hawaii. It has left Hawaii and is now bound for San Pedro, California, Silicon Sea's homeport. The Silicon Sea navigation Legs are archived in the files as ssea.zip with an answers file included. The latest Leg in the archive is Leg 83. Navigation list archives maintained by Frank Reed may be found here: http://www.fer3.com/NavList/. Leg 57 was published in August of 1999: http://www.fer3.com/arc/sort2.aspx?y=199908 The NAVIGATION-L group has used three mailing list servers. For current discussions, see: http://groups.google.com/group/NavList. aa program results may be compared to the "Online Nautical Almanac" at http://www.tecepe.com.br/scripts/AlmanacPagesISAPI.isa The page for this problem is http://www.tecepe.com.br/scripts/AlmanacPagesISAPI.isa/pages?date=03%2F24%2F1999 Ed Falk has also worked this problem, see: http://www.efalk.org/Navigation/ This is my problem solution, and I'm responsible for any errors. - Jim Van Zandt # We use octave to do the arithmetic. # First work out the dead reckoning position (DR): # # leg duration in hours: # octave:1> leg57=((5/60+39)/60+23) - ((23/60+10)/60+0) # leg57 = 23.478 # sailing distance in nautical miles: # octave:2> rsail=leg57*10.3 # rsail = 241.83 # sailing course: # octave:3> TC=119.3*pi/180 # TC = 2.0822 # drift distance: # octave:4> rdrift=leg57*1 # rdrift = 23.478 # drift course: # octave:5> TD=115*pi/180 # TD = 2.0071 # find net motion for this leg (eastward and northward components in nmi) # octave:6> disp=rsail*[sin(TC),cos(TC)]+rdrift*[sin(TD),cos(TD)] # disp = # # 232.17 -128.27 # previous fix, convert to degrees and fractions octave:53> lat=-(51+30/60) lat = -51.500 octave:54> lon=-(80+59.5/60) lon = -80.992 # dead reckoning changes in latitude and longitude, in minutes octave:55> dlat=disp(2)/60 dlat = -2.1378 octave:56> dlon=disp(1)/60/cos((lat+dlat/2)*pi/180) dlon = 6.3663 # dead reckoning position (deg) octave:57> DR=[lon,lat]+[dlon,dlat] DR = -74.625 -53.638 # For reference, convert the fractional parts to minutes octave:58> [.625,.638]*60 ans = 37.500 38.280 # so DR is: 74d 37.5' W, 53d 32.28' S # convert observer height from ft to m # octave:14> 9*12*2.54/100 # ans = 2.7432 # write the DR info into a local aa configuration file cat >aa.ini < Hs=[15+4.9/60 35+14.8/60 48+40.2/60 13+51.6/60 22+24.8/60] Hs = 15.082 35.247 48.670 13.860 22.413 # index correction in minutes (same for all bodies) octave:60> IC=-2.5*ones(1,5) IC = -2.5000 -2.5000 -2.5000 -2.5000 -2.5000 # calculate the magnitude of the dip correction (difference between # visible horizon and true horizontal) in minutes # (The big number is the Earth radius in m) octave:17> dip=sqrt(2/(6/5*6378150)*2.74) *180/pi*60 dip = 2.9089 # (this agrees with the nautical almanac) # dip correction is always negative, and the same for all bodies octave:62> dip=-dip*ones(1,5) dip = -2.9089 -2.9089 -2.9089 -2.9089 -2.9089 # Ordinarily we would add horizontal parallax and refraction corrections # to the sextant sighting so we could compare them with almanac values. # And aa calculates them for us: 247:atmospheric refraction 0.057 deg dRA 0.109s dDec -203.96" 287:atmospheric refraction 0.023 deg dRA -7.288s dDec -63.30" 324:atmospheric refraction 0.014 deg dRA -6.701s dDec -23.67" 361:atmospheric refraction 0.064 deg dRA 5.532s dDec -217.58" 401:atmospheric refraction 0.040 deg dRA 4.295s dDec -138.92" # However, aa also includes them in its altitudes, so we don't have to # removed those effects from the sextant sightings. # We do need a semi-diameter correction for the moon # (correction is positive since observation was of lower limb) octave:76> SD=[15.9 0 0 0 0] SD = 15.90000 0.00000 0.00000 0.00000 0.00000 octave:77> Ha=Hs+(IC+dip+SD)/60 Ha = 15.257 35.157 48.580 13.770 22.323 # Here's a summary of the apparent positions per aa # 248:Topocentric: Altitude 15.844 deg, Azimuth 359.324 deg # 288:Topocentric: Altitude 34.898 deg, Azimuth 148.048 deg # 325:Topocentric: Altitude 48.373 deg, Azimuth 137.391 deg # 362:Topocentric: Altitude 14.028 deg, Azimuth 326.254 deg # 402:Topocentric: Altitude 21.955 deg, Azimuth 193.170 deg # Sanity check: the calculated values seem pretty close to the # observations. # calculate distance of Line of Position from assumed point # (positive for closer to body), in nmi octave:78> d=(Ha-Hc)'*60 d = -35.249 15.511 12.411 -15.489 22.091 # These are the azimuths to the bodies octave:66> az=[359.472 148.117 137.438 326.395 193.257] az = 359.47 148.12 137.44 326.39 193.26 # The linear equation for the displacement from DR is C x = d. # where C is the following coefficient matrix octave:67> C=[sin(az' *pi/180) cos(az' *pi/180)] C = -0.0092152 0.9999575 0.5281864 -0.8491284 0.6763876 -0.7365458 -0.5534642 0.8328729 -0.2293193 -0.9733512 # Calculate the least squares solution. # octave makes this very easy. octave:79> x=C\d x = -10.533 -26.773 # That's 10.5 nmi west and 26.8 nmi south from DR # find residuals (distance from least squares solution to each LOP) octave:80> C*x-d ans = 8.57421 1.65904 0.18386 -0.97981 6.38375 # The first and last (moon and Peacock) are suspiciously large. # The first LOP (for the moon) is the furthest one. Let's recalculate # the solution, leaving out that observation. octave:43> x2=C(2:5,:)\d(2:5) x2 = -4.9530 -21.5456 # which is 4.95 nmi west and 21.54 nmi south from DR # recalculate the residuals octave:82> C*x2-d ans = 13.749836 0.167752 0.108050 0.285448 0.016146 # The other LOPs agree pretty well. # Alternatively, we could omit the last sighting: octave:83> x3=C(1:4,:)\d(1:4) x3 = -22.734 -34.720 octave:84> C*x3-d ans = 0.73999 1.96292 -2.21509 -0.84611 16.91676 # In this case the residuals are larger, so we settle on leaving out # the lunar observation. # calculate the new fix octave:85> dlat=x2(2)/60 dlat = -0.35909 octave:86> dlon=x2(1)/60/cos((DR(2)+dlat/2)*pi/180) dlon = -0.13983 octave:87> FIX=DR+[dlon dlat] FIX = -74.765 -53.997 # convert the fractional degrees to minutes octave:88> [.765 .997]*60 ans = 45.900 59.820 # so the final fix is: 74 deg 45.9' W, 53 deg 59.8' S debian/rules-orig0000644000000000000000000000343111716744520011211 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # This is the debhelper compatibility version to use. export DH_COMPAT=3 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) CFLAGS += -g endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif configure: configure-stamp configure-stamp: dh_testdir # Add here commands to configure the package. touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir # Add here commands to compile the package. $(MAKE) #/usr/bin/docbook-to-man debian/astronomical-almanac.sgml > astronomical-almanac.1 touch build-stamp clean: dh_testdir dh_testroot rm -f build-stamp configure-stamp # Add here commands to clean up after the build process. -$(MAKE) clean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs # Add here commands to install the package into debian/astronomical-almanac. $(MAKE) install DESTDIR=$(CURDIR)/debian/astronomical-almanac # Build architecture-independent files here. binary-indep: build install # We have nothing to do by default. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot # dh_installdebconf dh_installdocs dh_installexamples dh_installmenu # dh_installlogrotate # dh_installemacsen # dh_installpam # dh_installmime # dh_installinit dh_installcron dh_installman dh_installinfo # dh_undocumented dh_installchangelogs dh_link dh_strip dh_compress dh_fixperms # dh_makeshlibs dh_installdeb # dh_perl dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure debian/README.examples0000644000000000000000000000177411716744520011703 0ustar #!/bin/sh # (1) aa.que contains test questions. To submit them to aa, type: aa < aa.que >test.ans # aa.ans has the corresponding answers (not necessarily true, but what # the program says) # (2) For another example, visit Steven Wepster's site: # # http://www.math.uu.nl/people/wepster/ldtab.html # # Celestial navigation is normally done with the benefit of an accurate # clock. However, the moon moves relatively quickly with respect to the # sun and stars, and it is possible to calculate the time from the # moon's position. Steven Wepster has construct lunar distance tables # for this purpose using aa. The site includes his discussion and the # tables themselves. # (3) A third example is using aa to work out a sample celestial # navigation problem, specifically leg 57 from the "silicon seas" # series (see: http://www.efalk.org/Navigation/). The problem # parameters are in leg57-4.txt, the relevant aa output is in # leg57.log, and the calculation of the navigation fix is in # leg57.work debian/changelog0000644000000000000000000000404111724214333011037 0ustar astronomical-almanac (5.6-4) unstable; urgency=low * new maintainer (closes: #636405) * debian/control: moved to dh 8 * debian/control: version bumped to 3.9.3 (no changes) * debian/copyright: point to GPL with version * debian/rules: replace dh_clean -k by dh_prep * debian/rules: build-arch and build-indep added * debian/watch: fixed * debian/source/format: introduce 3.0 (quilt) * debian/patches: move changes in source files to patches * debian/aa.1: fixed lintian warnings -- Thorsten Alteholz Fri, 02 Mar 2012 18:08:52 +0100 astronomical-almanac (5.6-3) unstable; urgency=low * debian/control: move homepage reference to Homepage field. Bump policy version to 3.8.0. * debian/rules: update handling of DEB_BUILD_OPTIONS -- James R. Van Zandt Thu, 14 Aug 2008 18:49:09 -0400 astronomical-almanac (5.6-2) unstable; urgency=low * rplanet.c: declare robject as static, so it doesn't conflict with the definition in aa (suggested by author Steven Moshier). * debian/manpage.1.ex: delete * /usr/share/doc/astronomical-almanac/examples/README: mention sample celestial navigation problem. README is now a shell script. * /usr/share/doc/astronomical-almanac/examples/: add solution of sample celestial navigation problem. -- James R. Van Zandt Mon, 9 Oct 2006 21:35:39 -0400 astronomical-almanac (5.6-1) unstable; urgency=low * Initial release (Closes:Bug#386034) * kfiles.c: default locations for star.cat and orbit.cat are in /usr/share/aa. look for initialization in ./aa.ini then ~/.aa.ini then /etc/aa.ini. Look for star charts in /usr/share/aa/star.cat. Look for orbits in /usr/share/aa/orbit.cat. * conjunct.c: Accept inputs from the command line (start and end time, event type). * aa.que, aa.ans: Look for star charts in /usr/share/aa/star.cat. Look for orbits in /usr/share/aa/orbit.cat. * dms.c: check whether fgets returns NULL. -- James R. Van Zandt Mon, 4 Sep 2006 15:13:08 -0400 debian/leg57-4.txt0000644000000000000000000000672211716744520011031 0ustar OK, here's Leg 57 warts and all. ********************** Chart(s): Plotting Sheet Sight Reduction and Dead-Reckoning problem Leg 57 080599 Test your knowledge! ---------------------- ------ ------ -------------------- The last FIX position was (51d 30.0'S 80d 59.5'W) 24/03/1999 @ 00:10:23UT, TC 119.3d, Var 18dE, Dev 2.5dW. Speed 10.3 Kts. Current Drift 1.0 Kts Set 115d. The weather has moderated, we have broken clouds, and a clear horizon. We are bound for Cape Horn (56d 04.0'S 67d 15.0'W). We are now using chart INT 20 and the Pilot Chart of The South Atlantic, NVPUB 105. The following evening after our last FIX we take the following sights: Body UT Hs Moon LL 23:40:01 15d 04.9' Rigil Kentaurus 23:41:56 35d 14.8' Acrux 23:42:06 48d 40.2' Aldebaran 23:43:12 13d 51.6' Peacock 23:45:22 22d 24.8' 1) What is the DR position at the time of the first sight? -- ------------------------------------------------------- 2) What is the FIX position? -- ------------------------- 3) What was the Speed Made Good(SMG) between fixes? -- ------------------------------------------------ Var 19dE, Dev 2.5dW. Speed 10.3Kts, Current 0.8 Kts, Set 115.0d. 4) What is the Zone Time(ZT) and Date Expected Time of Arrival(ETA) to abeam of Cape Horn? -- -------------------------------------------------------------- 5) What is the distance to Cape Horn from our FIX? -- ----------------------------------------------- 6) What is the Compass Course(CC)/Course-to-Steer for Cape Horn? -- ------------------------------------------------------------- After sighting a dark low gray non-descript island abeam, Cape Horn. We break out a bottle of Champagne and celebrate. We set a course for a waypoint at(55d 30.0'S 63d.00.0'W). At which time we must decide to either turn north up the South Atlantic Ocean west of the Falkland Islands or go around outside to the east of them. The weather will make our choice at the time. Speed 10.3 Kts, Var 14dE, Dev 2.0dW, Current Set 45d, Drift 0.8 Kts/day. 7) What is the TC and distance to the decision waypoint? -- ----------------------------------------------------- 8) What is the Compass course(CC)/Course-to-Steer to the waypoint? -- --------------------------------------------------------------- NOTE: Lat & Lo = XXd XX.X', Date=DD/MM/YY, HE 9 Feet, Index correction -2.5', Time hh:mm:ss in UT,unless otherwise stated. Silicon Sea II is a 34,000 lb(15.40t) displacement sailing vessel, 48' 3" (14.70m) LOA. 39' (12.00m) LWL; Cutter rigged. Can tack to 45d. Water Tanks = 220 gal(1000 ltrs). Fuel Tanks = 155 gal(700 ltrs). Fuel consumption .675 gal/Hr at 8.5 Kts. DR(Ded-Reckoning)=position by sailings, EP(Estimated Position)=DR+current affect. Dist to Horizon: Nmi = SQRT HE@mtrs x 2.07; Nmi = SQRT HE@ft x 1.17. PLEASE respond with your results and thinking on these exercises to the NAVIGATION list at large. If you have questions or problems, A lot of folks on the list are knowledgeable and willing to help. Any questions or doubtful areas will be responded to promptly. Let us hear from you soon! Good Navigating! -=The Navigation List Working Group=- Peter Smith - PSmith@IMPS0014.US.DG.COM John Simmonds- johnsimmo@bigpond.com Jim Manzari - manzari@bluewin.ch Dan Hogan - dhhogan@nav.cnchost.com Dan Hogan WA6PBY dhhogan@nav.cnchost.com http://nav.cnchost.com Catalina 27 "GACHA" debian/conjunct.10000644000000000000000000000347311716744520011111 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH CONJUNCT 1 "August 24, 2006" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME conjunct \- find dates of equinox or new or full moon .SH SYNOPSIS .B conjunct .RI [ options ] .SH DESCRIPTION \fBconjunct\fP searches for one of these events: spring equinox (default), summer solstice, autumn equinox, winter solstice, new moon, or full moon. .SH OPTIONS .TP .B \-s, \-\-start \fIdate\fP Set starting date (default is current date). The date may be either a Julian day number (e.g. 2454180.0 for noon, 2007 March 20) or an ISO 8601 date (e.g. 2007-03-20). .TP .B \-e, \-\-end \fIdate\fP Set ending date (default is one year from now). .TP .B \-V, \-\-vernal, \-\-spring Search for spring equinox (default). .TP .B \-S, \-\-summer Search for summer solstice. .TP .B \-A, \-\-autumn, \-\-fall Search for autumn equinox. .TP .B \-W, \-\-winter Search for winter solstice. .TP .B \-N, \-\-newmoon Search for new moon. .TP .B \-F, \-\-fullmoon Search for full moon. .TP .B \-h, \-\-help Show summary of options. .SH SEE ALSO .BR aa (1). .SH AUTHOR conjunct was written by Stephen L. Moshier . .PP This manual page was written by James R. Van Zandt , for the Debian project (but may be used by others). debian/aa.10000644000000000000000000003341511724147114007641 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH AA 1 "September 4, 2006" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME aa \- astronomical almanac - calculate planet and star positions .SH SYNOPSIS .B aa .SH DESCRIPTION The \fBaa\fP 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. Data for the 57 navigational stars is included. Most of the algorithms employed are from The Astronomical Almanac (AA) published by the U.S. Government Printing Office. The \fBaa\fP program 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 (aa200) 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). .SH Initialization The following items will be read in automatically from the first of these files to be found: \fI./aa.ini\fP, \fI~/.aa.ini\fP, \fI/etc/aa.ini\fP. The file contains one ASCII string number per line so is easily edited. A sample initialization file is supplied. The entries are: .IP lon Terrestrial longitude of observer, degrees East of Greenwich .IP lat Geodetic latitude of observer (program calculates geocentric latitude) .IP height Height above sea level, meters .IP temp Atmospheric temperature, degrees Centigrade .IP pressure Atmospheric pressure, millibars .IP tflag Input time type: 1 = TDT, 2 = UT, 0 = TDT set equal to UT .IP deltaT Value to use for deltaT, seconds; if 0 then the program will compute it. .SH 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 perturbation formulae to a solution from precise orbital elements that you supply from an almanac. The program uses as a default a set of trigonometric expansions for the position of the Earth and planets. These have been adjusted to match the Jet Propulsion Laboratory's DE404 Long Ephemeris (1995) with a precision ranging from about 0.1" for the Earth to 1" for Pluto. The adjustment was carried out on the interval from 3000 B.C. to 3000 A.D. for the outer planets. The adjustment for the inner planets is strictly valid only from 1350 B.C. to 3000 A.D., but may be used to 3000 B.C. with some loss of precision. See \fI/usr/share/doc/aa/readme.404\fP for additional information. The true accuracy of positions calculated for prehistoric or future dates is of course unknown. The Moon's position is calculated by a modified version of the lunar theory of Chapront-Touze' and Chapront. This has a precision of 0.5 arc second relative to DE404 for all dates between 1369 B.C. and 3000 A.D. 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. 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 containing human-readable ASCII strings specifying the elements of orbits. The items in the specification are (see also the example file orbit.cat): .RS .nf 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 .fi .nf 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 .fi .RE 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 perihelion 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 \fBaa\fP, 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. .SH 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 2011, as the complete tabulation from the Astronomical Almanac is included in the program. Outside this range of years, approximate formulas are used to estimate deltaT. These formulas are based on analyses of eclipse records going back to ancient times (Stephenson and Houlden, 1986; Borkowski, 1988) but they do 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. Updated deltaT values and predictions can be obtained from this network archive: http://maia.usno.navy.mil . See the file deltat.c for additional information. In addition, the IAU has adopted several other definitions of time, but this program does not distinguish among them. The International Earth Rotation Service is in charge of UT. Precise data on Earth rotation and orientation are published in the IERS bulletins, available at the IERS computer site www.iers.org as well as at the usno site. .SH Rise and Set Times Each calculation of the time of local rising, meridian transit, and setting includes 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. Even so, the calculation has to be iterated, or repeated with successively closer estimates of the event time. In view of the first order correction the iteration has a second-order convergence characteristic and arrives at a precise result in just two or three steps. On the other hand, the technique used is unstable for nearly-circumpolar objects, such as the Moon observed at high latitudes. Thus a failure to report rise and set times does not necessarily mean that there was no rise or set event. The program reports the transit that is nearest to the input time. Rise and set times ordinarily precede and follow the transit. Check the date displayed next to the rise, set, or transit time to be sure the results are for the desired date and not for the previous or next calendar day. 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. The computed event times include the effects of diurnal aberration and parallax. Age of the Moon, in days from the nearest Quarter, also has a correction for orbital motion, but does not get the benefit of iterative improvement and may be off by 0.1 day (the stated Quarter is always correct, however). The estimated time can be made much more precise by entering the input date and time of day to be near the time of the event. In other words, the rigorous calculation requires iterating on the time; in this case the program does not do so automatically, hence if you want maximum accuracy you must do the iteration by hand. .SH Stars Positions and proper motions of the 57 navigational stars were taken from the Fifth Fundamental Catalogue (FK5). They are in the file \fI/usr/share/aa/star.cat\fP. 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, \fI/usr/share/aa/messier.cat\fP, are from either the AA or Sky Catalogue 2000. To compute a star's apparent position, its motion since the catalogue epoch is 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 .RS .nf 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 .fi .RE 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: .RS .nf 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) .fi .RE 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. .SH OPTIONS \fBaa\fP does not accept any options. .SH FILES .IR "\fI./aa.ini\fP, \fI~/.aa.ini\fP, \fI/etc/aa.ini\fP" Initialization data. .IP \fI/usr/share/doc/aa/readme.404\fP Documentation of plan404 ephemerides. .IP \fI/usr/share/aa/star.cat\fP Catalogue data on the 57 navigational stars. .IP \fI/usr/share/aa/messier.cat\fP Items for the Messier catalogue .SH SEE ALSO \fBconjunct(1)\fP .br .SH AUTHOR aa was written by Stephen L. Moshier . .PP This manual page was written by James R. Van Zandt , for the Debian project (but may be used by others). debian/patches/0000755000000000000000000000000011724161120010610 5ustar debian/patches/plantbl.h.patch0000644000000000000000000000166511724160216013530 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/plantbl.h =================================================================== --- astronomical-almanach.orig/plantbl.h 2012-03-02 13:18:16.000000000 +0100 +++ astronomical-almanach/plantbl.h 2012-03-02 13:18:49.000000000 +0100 @@ -22,11 +22,28 @@ #define NARGS 18 +#ifdef _MSC_VER +#define SIGNED +#else + /* On some systems such as Silicon Graphics, char is unsigned + by default. */ +#ifdef vax + /* VAX CC rejects "signed char." */ +#define SIGNED +#else +#ifdef __STDC__ +#define SIGNED signed +#else +#define SIGNED +#endif +#endif +#endif + struct plantbl { char maxargs; char max_harmonic[NARGS]; char max_power_of_t; - char FAR *arg_tbl; + char SIGNED FAR *arg_tbl; void FAR *lon_tbl; void FAR *lat_tbl; void FAR *rad_tbl; debian/patches/mer404.c.patch0000644000000000000000000000104411724160160013067 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/mer404.c =================================================================== --- astronomical-almanach.orig/mer404.c 2012-03-02 12:44:09.000000000 +0100 +++ astronomical-almanach/mer404.c 2012-03-02 12:44:32.000000000 +0100 @@ -878,7 +878,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 3, 3, 1, 1,-10, 3, 11, 4, 0, 2, 2, 5, -5, 6, 2, debian/patches/nep404.c.patch0000644000000000000000000000104411724160210013062 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/nep404.c =================================================================== --- astronomical-almanach.orig/nep404.c 2012-03-02 13:17:16.000000000 +0100 +++ astronomical-almanach/nep404.c 2012-03-02 13:17:36.000000000 +0100 @@ -386,7 +386,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 3, 2, 1, 7, -2, 8, 0, 3, 3, 5, -8, 6, 3, 8, 0, debian/patches/sat404.c.patch0000644000000000000000000000104611724160252013077 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/sat404.c =================================================================== --- astronomical-almanach.orig/sat404.c 2012-03-02 13:28:22.000000000 +0100 +++ astronomical-almanach/sat404.c 2012-03-02 13:28:40.000000000 +0100 @@ -1487,7 +1487,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 7, 3, 2, 5, -6, 6, 3, 7, 0, 2, 2, 5, -5, 6, 5, debian/patches/mar404.c.patch0000644000000000000000000000105611724160141013065 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/mar404.c =================================================================== --- astronomical-almanach.orig/mar404.c 2012-03-02 12:33:32.000000000 +0100 +++ astronomical-almanach/mar404.c 2012-03-02 12:33:59.000000000 +0100 @@ -1344,7 +1344,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 4, 3, 4, 3, -8, 4, 3, 5, 2, 3, 5, 2, -6, 3, -4, 4, 0, debian/patches/moonrise.c.patch0000644000000000000000000000163111724160203013707 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/moonrise.c =================================================================== --- astronomical-almanach.orig/moonrise.c 2012-03-02 13:16:14.000000000 +0100 +++ astronomical-almanach/moonrise.c 2012-03-02 13:16:35.000000000 +0100 @@ -3,6 +3,7 @@ #define STARTDATE 2448431.5 #define ENDDATE 2448831.5 +#include #include "kep.h" /* Conversion factors between degrees and radians */ double DTR = 1.7453292519943295769e-2; @@ -12,6 +13,9 @@ double PI = 3.14159265358979323846; double TPI = 6.28318530717958647693; +/* unused, but must be defined for rplanet.c and rstar.c */ +struct orbit *elobject; /* pointer to orbital elements of object */ + extern double PI; /* Standard epochs. Note Julian epochs (J) are measured in debian/patches/kfiles.c.patch0000644000000000000000000000262211724160134013335 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/kfiles.c =================================================================== --- astronomical-almanach.orig/kfiles.c 2012-03-02 12:32:19.000000000 +0100 +++ astronomical-almanach/kfiles.c 2012-03-02 12:32:40.000000000 +0100 @@ -3,7 +3,7 @@ * or file containing orbital elements. */ -#if __BORLANDC__ +#if __BORLANDC__ || __STDC__ #include #endif @@ -26,8 +26,8 @@ extern char *intfmt, *strfmt;/* see dms.c */ -static char starnam[80] = {'s','t','a','r','.','c','a','t','\0'}; -static char orbnam[80] = {'o','r','b','i','t','.','c','a','t','\0'}; +static char starnam[80] = "/usr/share/aa/star.cat"; +static char orbnam[80] = "/usr/share/aa/orbit.cat"; static int linenum = 1; /* Read initialization file aa.ini @@ -73,8 +73,19 @@ printf( "\n\tSteve Moshier's Ephemeris Program v5.6\n\n" ); printf( "Planetary and lunar positions approximate DE404.\n" ); -f = fopen( "aa.ini", "r" ); -if( f ) +{ + char *t = getenv("HOME"); + strcpy(s, "aa.ini"); + if (t && strlen(t)<70) + { + strcpy(s,t); + strcat(s,"/.aa.ini"); + } +} + +if( (f=fopen("aa.ini","r")) || + (f=fopen(s,"r")) || + (f=fopen("/etc/aa.ini","r")) ) { fgets( s, 80, f ); sscanf( s, "%lf", &tlong ); debian/patches/series0000644000000000000000000000045011724161120012024 0ustar aa.ans.patch aa.c.patch aa.que.patch conjunct.c.patch dms.c.patch ear404.c.patch jup404.c.patch kfiles.c.patch mar404.c.patch mer404.c.patch mlat404.c.patch mlr404.c.patch moonrise.c.patch nep404.c.patch plantbl.h.patch plu404.c.patch rplanet.c.patch sat404.c.patch ura404.c.patch ven404.c.patch debian/patches/ear404.c.patch0000644000000000000000000000107411724160121013053 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/ear404.c =================================================================== --- astronomical-almanach.orig/ear404.c 2012-03-02 12:29:57.000000000 +0100 +++ astronomical-almanach/ear404.c 2012-03-02 12:30:17.000000000 +0100 @@ -1518,7 +1518,7 @@ 3, 13, }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 3, 3, 4, 3, -8, 4, 3, 5, 1, 2, 2, 5, -5, 6, 2, debian/patches/plu404.c.patch0000644000000000000000000000103611724160225013107 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/plu404.c =================================================================== --- astronomical-almanach.orig/plu404.c 2012-03-02 13:19:42.000000000 +0100 +++ astronomical-almanach/plu404.c 2012-03-02 13:20:09.000000000 +0100 @@ -1192,7 +1192,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 7, 2, 3, 7, -9, 9, 0, 2, 4, 7,-12, 9, 0, debian/patches/aa.c.patch0000644000000000000000000000076411724160067012453 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/aa.c =================================================================== --- astronomical-almanach.orig/aa.c 2012-03-02 11:52:02.000000000 +0100 +++ astronomical-almanach/aa.c 2012-03-02 11:52:30.000000000 +0100 @@ -37,7 +37,7 @@ */ #include "kep.h" -#ifdef __BORLANDC__ +#if __BORLANDC__ || __STDC__ #include #endif debian/patches/rplanet.c.patch0000644000000000000000000000101011724160244013515 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/rplanet.c =================================================================== --- astronomical-almanach.orig/rplanet.c 2012-03-02 13:24:55.000000000 +0100 +++ astronomical-almanach/rplanet.c 2012-03-02 13:25:21.000000000 +0100 @@ -133,7 +133,7 @@ extern struct orbit *elobject; -extern double robject[]; +static double robject[3]; int doplanet() { debian/patches/ura404.c.patch0000644000000000000000000000103611724160264013101 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/ura404.c =================================================================== --- astronomical-almanach.orig/ura404.c 2012-03-02 13:30:42.000000000 +0100 +++ astronomical-almanach/ura404.c 2012-03-02 13:31:27.000000000 +0100 @@ -1171,7 +1171,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 3, 2, 1, 7, -2, 8, 0, 2, 2, 7, -4, 8, 0, debian/patches/conjunct.c.patch0000644000000000000000000002202611724160103013677 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/conjunct.c =================================================================== --- astronomical-almanach.orig/conjunct.c 2012-03-02 12:01:46.000000000 +0100 +++ astronomical-almanach/conjunct.c 2012-03-02 12:27:49.000000000 +0100 @@ -1,12 +1,19 @@ -/* Search program to find dates of equinox or new moon. */ +/* Search program to find dates of equinox or new/full moon. */ + +double STARTDATE; +double ENDDATE; -#define STARTDATE 2439935.5 -#define ENDDATE 2445000.5 -/* Define one of these nonzero, the others zero. */ #define NEWMOON 0 #define FULLMOON 1 -#define EQUINOX 0 - +#define SPRING 2 +#define SUMMER 3 +#define AUTUMN 4 +#define WINTER 5 + +#define _XOPEN_SOURCE /* glibc2 needs this to declare strptime */ +#include +#include +#include #include "kep.h" /* Conversion factors between degrees and radians */ double DTR = 1.7453292519943295769e-2; @@ -16,6 +23,9 @@ double PI = 3.14159265358979323846; double TPI = 6.28318530717958647693; +/* unused, but must be defined for rplanet.c and rstar.c */ +struct orbit *elobject; /* pointer to orbital elements of object */ + extern double PI; /* Standard epochs. Note Julian epochs (J) are measured in @@ -115,131 +125,255 @@ double dradt, ddecdt; extern double FAR moonpol[]; extern double FAR moonpp[]; +static int event=NEWMOON; double zgetdate(), gethms(); double func(), search(); int apparent(); -int main() +int main(int argc, char **argv) { - double t, t0; + double t=0, t0; + int c; + time_t now=time(NULL); + struct tm date=*localtime(&now); kinit(); + + STARTDATE=caltoj( date.tm_year+1900, date.tm_mon+1, date.tm_mday ); + ENDDATE=caltoj( date.tm_year+1900+1, date.tm_mon+1, date.tm_mday ); + + while (1) { + int option_index = 0; + static struct option long_options[] = { + {"start", 1, 0, 's'}, + {"end", 1, 0, 'e'}, + {"spring", 0, 0, 'V'}, + {"vernal", 0, 0, 'V'}, + {"summer", 0, 0, 'S'}, + {"autumn", 0, 0, 'A'}, + {"fall", 0, 0, 'A'}, + {"winter", 0, 0, 'W'}, + {"newmoon", 0, 0, 'N'}, + {"fullmoon", 0, 0, 'F'}, + {"help", 0, 0, 'h'}, + {0, 0, 0, 0} + }; + c = getopt_long (argc, argv, "s:e:VSAWNFh", + long_options, &option_index); + if (c == -1) + break; + switch (c) { + case 's': + if (strptime(optarg, "%Y-%m-%d", &date)) + STARTDATE=caltoj( date.tm_year+1900, date.tm_mon+1, date.tm_mday ); + else + STARTDATE=atof(optarg); + break; + case 'e': + if (strptime(optarg, "%Y-%m-%d", &date)) + ENDDATE=caltoj( date.tm_year+1900, date.tm_mon+1, date.tm_mday ); + else + ENDDATE=atof(optarg); + break; + case 'V': event=SPRING; break; + case 'S': event=SUMMER; break; + case 'A': event=AUTUMN; break; + case 'W': event=WINTER; break; + case 'N': event=NEWMOON; break; + case 'F': event=FULLMOON; break; + case 'h': + default: + printf("conjunct - find dates of equinox or new/full moon\n" + "options:\n" + " -s, --start DATE Julian or ISO 8601 starting date (default today)\n" + " -e, --end DATE ending date (default 1 year from today)\n" + " -V, --vernal find times of spring equinox\n" + " -S, --summer find times of summer solstice\n" + " -A, --autumn find times of autumn equinox\n" + " -W, --winter find times of winter solstice\n" + " -F, --fullmoon find times of full moon\n" + " -N, --newmoon find times of new moon (default)\n"); + exit(0); + break; + } + } + if (STARTDATE >= ENDDATE) + { + printf("start date=%f >= end date=%f\n", STARTDATE, ENDDATE); + exit(1); + } + objnum = 0; - t0 = STARTDATE; - while( t0 <= ENDDATE ) + // printf("184:STARTDATE=%6.1f\n", STARTDATE); + t0 = STARTDATE - (((event==FULLMOON)||(event==NEWMOON))?40:400); + while( 1 ) { prtflg = 0; -#if EQUINOX - t = search( t0, 0.0, 364.0 ); -#endif -#if NEWMOON - t = search( t0, PI, 27.0 ); -#endif -#if FULLMOON - t = search( t0, 0.0, 27.0 ); -#endif + switch(event) + { + case SPRING: + t = search( t0, 0.0, 364.0 ); + break; + case AUTUMN: + t = search( t0, PI, 364.0 ); + break; + case WINTER: + t = search( t0, -PI/2, 364.0 ); + break; + case SUMMER: + t = search( t0, PI/2, 364.0 ); + break; + case NEWMOON: + t = search( t0, 0.0, 27.0 ); + break; + case FULLMOON: + t = search( t0, PI, 27.0 ); + break; + } TDT = t; - printf("%.4f ", t); - prtflg = 1; - jtocal(t); + if (t > ENDDATE) + break; + if (t >= STARTDATE) + { + printf("%.4f ", t); + prtflg = 1; + jtocal(t); + } t0 = t; } exit(0); } /* Search for desired conjunction. - Step forward DELTA days from date T. Then begin searching - for the date at which the desired function equals Y. */ + On the first call to this function, search forward from date T + in steps of DELTA / 8 days until the error changes sign. + On subsequent calls, step forward DELTA days from T, then search forward + in steps of 1 day until the error changes sign. + Then, in both cases, reduce the error by interval halving + until the function equals Y with the desired precision. */ + +static int first_search = 0; + double search(t, y, delta) -double t, y, delta; + double t, y, delta; { - double tl, tm, th, yl, ym, yh, e; + double tl, tm, th, yl, ym, yh, el, eh, em, dt; - tl = t; - yl = func(t); - th = tl + delta; - yh = yl; + if (first_search == 0) + { + dt = 0.125 * delta; + first_search = 1; + th = t; + } + else + { + dt = 1.0; + th = t + delta; + } + yh = func(th); + eh = yh - y; + if (eh > PI) + eh -= TPI; + if (eh <= -PI) + eh += TPI; /* Bracket the solution date. */ - do + for (;;) { tl = th; yl = yh; - th = th + 1.0; + el = eh; + th = th + dt; yh = func(th); - e = yh - y; - if(e > PI) - { - e -= TPI; - yh -= TPI; - } - if(e < -PI) - { - e += TPI; - yh += TPI; - } + eh = yh - y; + if(eh > PI) + eh -= TPI; + if (eh <= -PI) + eh += TPI; + /* Bracket the solution date. */ + for (;;) + { + tl = th; + yl = yh; + el = eh; + th = th + dt; + yh = func(th); + eh = yh - y; + if(eh > PI) + eh -= TPI; + if(eh <= -PI) + eh += TPI; + /* Keep searching while the error is large. */ + if (fabs (eh) > 0.5*PI) + continue; + /* Look for sign change */ + if((el * eh) <= 0.0) + break; + } + /* Search by simple interval halving. */ + while( (th - tl) > .00001 ) + { + tm = 0.5 * (tl + th); + ym = func(tm); + em = ym - y; + if(em > PI) + em -= TPI; + if(em <= -PI) + em += TPI; + /* Replace the inteval boundary that has the same sign as em. */ + if( em * eh > 0 ) + { + yh = ym; + th = tm; + eh = em; + } + else + { + yl = ym; + tl = tm; + el = em; + } + } + tm = tl + (th - tl) * (-el)/(yh -yl); + return (tm); } -while(e < 0); - -/* Search by simple interval halving. */ -while( (th - tl) > .00001 ) - { - tm = 0.5 * (tl + th); - ym = func(tm); - e = ym - y; - if(e > PI) - { - e -= TPI; - ym -= TPI; - } - if(e < -PI) - { - e += TPI; - ym += TPI; - } - if( e > 0 ) - { - yh = ym; - th = tm; - } - else - { - yl = ym; - tl = tm; - } - } -tm = tl + (th - tl) * (y - yl)/(yh - yl); -return (tm); } -/* Compute desired relation of apperent ecliptic longitude +/* Compute desired relation of apparent ecliptic longitude as a function of the ephemeris date. */ double func(t) double t; { double p[3], q[3], polar[3]; double s; -#if NEWMOON || FULLMOON double m; -#endif + double val; TDT = t; /* Longitude of the sun. */ objnum = 0; apparent(p,q); lonlat(p,TDT,polar,0); - s = polar[0]; -#if NEWMOON || FULLMOON - /* Longitude of the moon. */ - objnum = 3; - apparent(p,q); - lonlat(p,TDT,polar,0); - m = polar[0]; - return (s - m); -#endif -#if EQUINOX - return s; -#endif + val = s = polar[0]; + switch(event) + { + case NEWMOON: + case FULLMOON: + /* Longitude of the moon. */ + objnum = 3; + apparent(p,q); + lonlat(p,TDT,polar,0); + m = polar[0]; + val = s - m; + break; + case SPRING: + case WINTER: + case AUTUMN: + case SUMMER: + val = s; + break; + } + return val; } @@ -319,7 +453,7 @@ */ precess( p, TDT, -1 ); -/* Ajust for nutation +/* Adjust for nutation * at current ecliptic. */ epsiln( TDT ); debian/patches/dms.c.patch0000644000000000000000000000146211724160111012637 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/dms.c =================================================================== --- astronomical-almanach.orig/dms.c 2012-03-02 12:28:22.000000000 +0100 +++ astronomical-almanach/dms.c 2012-03-02 12:28:43.000000000 +0100 @@ -5,6 +5,8 @@ #include "kep.h" #if __STDC__ double caltoj (long, int, double); +#include +#include #else double caltoj(); #endif @@ -485,7 +487,13 @@ else printf( "Illegal input format\n" ); printf( ") ? "); -gets(s); +{ + char *str; + if (fgets(s,40,stdin) == NULL) + exit(0); + if ((str = strchr(s, '\n'))) + *str=0; +} if( s[0] != '\0' ) sscanf( s, format, num ); return(0); debian/patches/jup404.c.patch0000644000000000000000000000104611724160126013106 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/jup404.c =================================================================== --- astronomical-almanach.orig/jup404.c 2012-03-02 12:31:06.000000000 +0100 +++ astronomical-almanach/jup404.c 2012-03-02 12:31:35.000000000 +0100 @@ -1058,7 +1058,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 6, 3, 2, 5, -6, 6, 3, 7, 0, 2, 2, 5, -5, 6, 6, debian/patches/ven404.c.patch0000644000000000000000000000104411724160271013077 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/ven404.c =================================================================== --- astronomical-almanach.orig/ven404.c 2012-03-02 13:32:36.000000000 +0100 +++ astronomical-almanach/ven404.c 2012-03-02 13:52:36.000000000 +0100 @@ -701,7 +701,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 3, 2, 2, 5, -5, 6, 0, 3, 2, 2, 1, 3, -8, 4, 0, debian/patches/mlat404.c.patch0000644000000000000000000000111511724160170013241 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/mlat404.c =================================================================== --- astronomical-almanach.orig/mlat404.c 2012-03-02 12:45:12.000000000 +0100 +++ astronomical-almanach/mlat404.c 2012-03-02 12:45:31.000000000 +0100 @@ -735,7 +735,7 @@ 0, 119, }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 1, 3, 1, 10, 1, 12, -1, 11, 1, 4, 2, 10, 2, 12, -1, 13, -1, 11, 0, debian/patches/mlr404.c.patch0000644000000000000000000000104611724160176013107 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/mlr404.c =================================================================== --- astronomical-almanach.orig/mlr404.c 2012-03-02 12:46:10.000000000 +0100 +++ astronomical-almanach/mlr404.c 2012-03-02 12:46:37.000000000 +0100 @@ -2618,7 +2618,7 @@ }; -static char FAR args[] = { +static char SIGNED FAR args[] = { 0, 3, 3, 4, 3, -8, 4, 3, 5, 1, 2, 2, 5, -5, 6, 2, debian/patches/aa.que.patch0000644000000000000000000000101511724160075013010 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/aa.que =================================================================== --- astronomical-almanach.orig/aa.que 2012-03-02 12:00:29.000000000 +0100 +++ astronomical-almanach/aa.que 2012-03-02 12:00:50.000000000 +0100 @@ -97,7 +97,7 @@ 1 1 88 -star.cat +/usr/share/aa/star.cat 1 1986 1 @@ -108,7 +108,7 @@ 1 1 99 -orbit.cat +/usr/share/aa/orbit.cat 5 1986 1 debian/patches/aa.ans.patch0000644000000000000000000000427611724160061013006 0ustar Description: move changes in source files to patches Author: Thorsten Alteholz Last-Update: 03 Mar 2012 Index: astronomical-almanach/aa.ans =================================================================== --- astronomical-almanach.orig/aa.ans 2012-03-02 11:49:37.000000000 +0100 +++ astronomical-almanach/aa.ans 2012-03-02 11:50:46.000000000 +0100 @@ -313,7 +313,7 @@ Calendar date: Year (1986) ? Month (1-12) (1) ? Day.fraction (1.000000) ? Time: Hours (12) ? Minutes (40) ? Seconds (0.000000) ? 1986 January 1 Wednesday 6h 09m 05.130s UT 1986 January 1 Wednesday 6h 10m 00.000s TDT Julian day 2446431.7569444 -Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (9) ? Name of star catalogue file: (star.cat) ? Line number (1) ? 2000 00 08 23.265 29 05 25.58 1.039 -16.33 -12.0 0.0240 2.06 alAnd(Alpheratz) 4 +Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (9) ? Name of star catalogue file: (/usr/share/aa/star.cat) ? Line number (1) ? 2000 00 08 23.265 29 05 25.58 1.039 -16.33 -12.0 0.0240 2.06 alAnd(Alpheratz) 4 alpha Andromedae (Alpheratz) @@ -342,7 +342,7 @@ Calendar date: Year (1986) ? Month (1-12) (1) ? Day.fraction (1.000000) ? Time: Hours (6) ? Minutes (10) ? Seconds (0.000000) ? 1986 January 1 Wednesday 8h 26m 05.130s UT 1986 January 1 Wednesday 8h 27m 00.000s TDT Julian day 2446431.8520833 -Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (88) ? Name of orbit catalogue file: (orbit.cat) ? Line number (1) ? 2447120.5 34.0897 267.3835 73.9085 167.4675275 0.00045478773 +Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (88) ? Name of orbit catalogue file: (/usr/share/aa/orbit.cat) ? Line number (1) ? 2447120.5 34.0897 267.3835 73.9085 167.4675275 0.00045478773 0.994811 0.0062424619 2433282.423 5.0 0.0 Bradfield_1987s 5 debian/source/0000755000000000000000000000000011716745333010500 5ustar debian/source/format0000644000000000000000000000001411716745333011706 0ustar 3.0 (quilt) debian/leg57.log0000644000000000000000000001765011716744520010634 0ustar vanzandt:/usr/local/src/aa/astronomical-almanac-5.6/debian$ aa Steve Moshier's Ephemeris Program v5.6 Planetary and lunar positions approximate DE404. Terrestrial east longitude -74.6250 deg geocentric latitude -53.4541 deg Earth radius 0.99783 temperature 12.0 C pressure 1010 mb Input time is UT. Enter starting date of tabulation Calendar date: Year (1986) ? 1999 Month (1-12) (1) ? 3 Day.fraction (1.000000) ? 24 Time: Hours (0) ? 23 Minutes (0) ? 40 Seconds (0.000000) ? 01 1999 March 24 Wednesday 23h 41m 04.563s TDT 1999 March 24 Wednesday 23h 40m 01.000s UT Julian day 2451262.4861227 Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (0) ? 3 The Moon JD 2451262.49, 1999 March 24 Wednesday 23h 41m 04.563s TDT 1999 March 24 Wednesday 23h 40m 01.000s UT nutation dRA -0.821s dDec -5.53" Geometric lon 101.024 deg, lat -3.352 deg, rad 2.5111e-03 au Apparent geocentric longitude 101.020 deg latitude -3.352 deg Distance 58.896 Earth-radii Horizontal parallax 0d 58' 22.34" Semidiameter 0d 15' 54.26" Elongation from sun 97.11 deg, Illuminated fraction 0.56 Phase 0.56 days past First Quarter Apparent: R.A. 6h 46m 45.615s Declination 19d 38' 21.00" Local apparent sidereal time 6h 49m 30.689s diurnal aberration dRA 0.013s dDec 0.00" diurnal parallax dRA -1.787s dDec 3359.75" atmospheric refraction 0.057 deg dRA 0.109s dDec -203.96" Topocentric: Altitude 15.844 deg, Azimuth 359.324 deg Topocentric: R.A. 6h 46m 43.949s Dec. 20d 30' 56.79" local meridian transit 1999 March 24 Wednesday 23h 37m 09.464s UT rises 1999 March 24 Wednesday 19h 24m 49.679s UT sets 1999 March 25 Thursday 3h 49m 53.066s UT Visible hours 8.4176 Enter starting date of tabulation Calendar date: Year (1999) ? Month (1-12) (3) ? Day.fraction (24.000000) ? Time: Hours (23) ? Minutes (40) ? 41 Seconds (1.000000) ? 56 1999 March 24 Wednesday 23h 42m 59.563s TDT 1999 March 24 Wednesday 23h 41m 56.000s UT Julian day 2451262.4874537 Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (3) ? 88 Name of star catalogue file: (/usr/share/aa/star.cat) ? Line number (1) ? 38 2000 14 39 35.885 -60 50 7.44 -49.826 69.93 -22.2 0.7516 -0.01 alCen(Rigil) 5483 alpha Centauri (Rigil) JD 2451262.49, 1999 March 24 Wednesday 23h 42m 59.563s TDT 1999 March 24 Wednesday 23h 41m 56.000s UT approx. visual magnitude -0.0 Astrometric J2000.0: R.A. 14h 39m 36.331s Dec. - 60d 50' 08.50" Astrometric B1950.0: R.A. 14h 35m 46.918s Dec. - 60d 37' 14.33" Astrometric of date: R.A. 14h 39m 32.765s Dec. - 60d 49' 56.60" elongation from sun 114.59 degrees, light defl. dRA -0.000s dDec 0.00" annual aberration dRA 2.070s dDec 5.85" nutation dRA -0.424s dDec 7.63" Apparent: R.A. 14h 39m 34.410s Dec. - 60d 49' 43.12" Local apparent sidereal time 6h 51m 26.004s diurnal aberration dRA -0.012s dDec 0.15" atmospheric refraction 0.023 deg dRA -7.288s dDec -63.30" Topocentric: Altitude 34.898 deg, Azimuth 148.048 deg Topocentric: R.A. 14h 39m 27.110s Dec. - 60d 50' 46.27" local meridian transit 1999 March 25 Thursday 7h 28m 47.751s UT Enter starting date of tabulation Calendar date: Year (1999) ? Month (1-12) (3) ? Day.fraction (24.000000) ? Time: Hours (23) ? Minutes (41) ? 42 Seconds (56.000000) ? 06 1999 March 24 Wednesday 23h 43m 09.563s TDT 1999 March 24 Wednesday 23h 42m 06.000s UT Julian day 2451262.4875694 Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (88) ? Name of star catalogue file: (/usr/share/aa/star.cat) ? Line number (38) ? 30 2000 12 26 35.871 -63 05 56.58 -0.524 -1.21 -11.0 0.0000 1.58 al-1Cru(Acrux) 2745 alpha-1 Crucis (Acrux) JD 2451262.49, 1999 March 24 Wednesday 23h 43m 09.563s TDT 1999 March 24 Wednesday 23h 42m 06.000s UT approx. visual magnitude 1.6 Astrometric J2000.0: R.A. 12h 26m 35.875s Dec. - 63d 05' 56.57" Astrometric B1950.0: R.A. 12h 23m 47.794s Dec. - 62d 49' 20.42" Astrometric of date: R.A. 12h 26m 33.261s Dec. - 63d 05' 41.17" elongation from sun 118.41 degrees, light defl. dRA -0.000s dDec 0.00" annual aberration dRA 2.774s dDec -2.70" nutation dRA 0.105s dDec 5.19" Apparent: R.A. 12h 26m 36.139s Dec. - 63d 05' 38.68" Local apparent sidereal time 6h 51m 36.031s diurnal aberration dRA 0.003s dDec 0.17" atmospheric refraction 0.014 deg dRA -6.701s dDec -23.67" Topocentric: Altitude 48.373 deg, Azimuth 137.391 deg Topocentric: R.A. 12h 26m 29.441s Dec. - 63d 06' 02.18" local meridian transit 1999 March 25 Thursday 5h 16m 11.256s UT Enter starting date of tabulation Calendar date: Year (1999) ? Month (1-12) (3) ? Day.fraction (24.000000) ? Time: Hours (23) ? Minutes (42) ? 43 Seconds (6.000000) ? 12 1999 March 24 Wednesday 23h 44m 15.563s TDT 1999 March 24 Wednesday 23h 43m 12.000s UT Julian day 2451262.4883333 Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (88) ? Name of star catalogue file: (/usr/share/aa/star.cat) ? Line number (30) ? 10 2000 04 35 55.237 16 30 33.39 0.439 -18.97 54.0 0.0480 0.85 alTau(Aldebara) 629 alpha Tauri (Aldebara) JD 2451262.49, 1999 March 24 Wednesday 23h 44m 15.563s TDT 1999 March 24 Wednesday 23h 43m 12.000s UT approx. visual magnitude 0.8 Astrometric J2000.0: R.A. 4h 35m 55.231s Dec. 16d 30' 33.53" Astrometric B1950.0: R.A. 4h 33m 03.134s Dec. 16d 24' 28.21" Astrometric of date: R.A. 4h 35m 52.566s Dec. 16d 30' 27.97" elongation from sun 66.00 degrees, light defl. dRA 0.000s dDec 0.00" annual aberration dRA -0.539s dDec -2.94" nutation dRA -0.721s dDec -7.73" Apparent: R.A. 4h 35m 51.307s Dec. 16d 30' 17.30" Local apparent sidereal time 6h 52m 42.212s diurnal aberration dRA 0.011s dDec 0.03" atmospheric refraction 0.064 deg dRA 5.532s dDec -217.58" Topocentric: Altitude 14.028 deg, Azimuth 326.254 deg Topocentric: R.A. 4h 35m 56.850s Dec. 16d 26' 39.75" local meridian transit 1999 March 24 Wednesday 21h 26m 43.529s UT rises 1999 March 24 Wednesday 16h 58m 03.022s UT sets 1999 March 25 Thursday 1h 55m 24.009s UT Visible hours 8.9558 Enter starting date of tabulation Calendar date: Year (1999) ? Month (1-12) (3) ? Day.fraction (24.000000) ? Time: Hours (23) ? Minutes (43) ? 45 Seconds (12.000000) ? 22 1999 March 24 Wednesday 23h 46m 25.563s TDT 1999 March 24 Wednesday 23h 45m 22.000s UT Julian day 2451262.4898380 Enter interval between tabulations in days (1.000000) ? Number of tabulations to display (1) ? Planet number 0-9 or 88 to read star, 99 to read orbit (88) ? Name of star catalogue file: (/usr/share/aa/star.cat) ? Line number (10) ? 52 2000 20 25 38.852 -56 44 6.38 0.082 -8.91 2.0 0.0000 1.94 alPav(Peacock) 9674 alpha Pavonis (Peacock) JD 2451262.49, 1999 March 24 Wednesday 23h 46m 25.563s TDT 1999 March 24 Wednesday 23h 45m 22.000s UT approx. visual magnitude 1.9 Astrometric J2000.0: R.A. 20h 25m 38.851s Dec. - 56d 44' 06.31" Astrometric B1950.0: R.A. 20h 21m 42.396s Dec. - 56d 53' 54.26" Astrometric of date: R.A. 20h 25m 35.205s Dec. - 56d 44' 15.51" elongation from sun 74.06 degrees, light defl. dRA -0.001s dDec -0.00" annual aberration dRA -1.254s dDec 8.72" nutation dRA -1.446s dDec 2.65" Apparent: R.A. 20h 25m 32.505s Dec. - 56d 44' 04.14" Local apparent sidereal time 6h 54m 52.568s diurnal aberration dRA -0.021s dDec -0.06" atmospheric refraction 0.040 deg dRA 4.295s dDec -138.92" Topocentric: Altitude 21.955 deg, Azimuth 193.170 deg Topocentric: R.A. 20h 25m 36.778s Dec. - 56d 46' 23.12" local meridian transit 1999 March 24 Wednesday 13h 17m 45.039s UT debian/aa.ini0000644000000000000000000000050211716744520010254 0ustar -74.625 ;Terrestrial east longitude of observer, degrees -53.638 ;Geodetic latitude, degrees 2.74 ;Height above sea level, meters 12.0 ;Atmospheric temperature, deg C 1010.0 ;Atmospheric pressure, millibars 2 ; 0 - TDT=UT, 1 - input=TDT, 2 - input=UT 0.0 ;Use this deltaT (sec) if nonzero, else compute it. debian/compat0000644000000000000000000000000211716744644010402 0ustar 8 debian/dirs0000644000000000000000000000003111716744520010053 0ustar usr/bin usr/share/aa etc debian/README.Debian0000644000000000000000000000104611716744520011237 0ustar astronomical-almanac for Debian ------------------------------- astronomical-almanac looks for its initialization information in three places: ./aa.ini ~/.aa.ini /etc/aa.ini You may want to adjust the default values in the site-wide file /etc/aa.ini, or else make a local copy and make changes there. The example files conjunct and moonrise had their inputs compiled in. I have adapted conjunct to accept them from the command line. I plan the same for moonrise. -- James R. Van Zandt , Mon, 4 Sep 2006 20:48:20 -0400 debian/copyright0000644000000000000000000000175411716745044011141 0ustar This package was debianized by James R. Van Zandt on Sun, 20 Aug 2006 16:05:34 -0400. It was downloaded from http://www.moshier.net/ Copyright (c) 2005 by Stephen L. Moshier . License: Permission is granted to copy, use, and distribute for any commercial or noncommercial purpose in accordance with the requirements of version 2.0 of the GNU General Public license. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. debian/watch0000644000000000000000000000013311716745250010224 0ustar version=3 opts="uversionmangle=s/(.)(.)/$1.$2/" \ http://www.moshier.net/aa-(\d+).*\.zip debian/control0000644000000000000000000000312111724161334010570 0ustar Source: astronomical-almanac Section: science Priority: optional Maintainer: Thorsten Alteholz Build-Depends: debhelper (>= 8.0.0) Standards-Version: 3.9.3 Homepage: http://www.moshier.net/ Package: astronomical-almanac Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: astronomical almanac - calculate planet and star positions The aa 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. Data for the 57 navigational stars is included. Most of the algorithms employed are from The Astronomical Almanac (AA) published by the U.S. Government Printing Office. . The aa program 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 (aa200) 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 (references are provided).