Celestial Algorithms

Java Algorithms for Celestial Computation

Suitable for Navigation and Astronomy

Hosted by sourceforge

Mainly based on Jean MEEUS' "Astronomical Algorithms".


Check out the project page, where you can download sources and binaries from.
Check out the javadoc.

For any message or request you'd have regarding this project, please use sourceforge messaging service, from the project page. On the right column (Developer Info), use the [View Members] link to send emails. Thanks!

We intend here to provide a couple of samples, regarding the way to use what is provided on the project page.


Related - and valuated - links:


Note for non-Java programmers

Java is a language the runs virtually on any platform. Its specifications have been elaborated by Sun.
In case you just want or need to run the software this document is about, you just need two things: Once you have downloaded the Java piece, you have to install it. And once it is installed, you can run the commands described in this document, like java -classpath CeletialComputer.jar etc...; as you'll see, they all refer to the jar-file you need to get from source forge, as explained above.
If you feel that those explanations are not sufficient, please let me know (by email, as explained above), and I'll add more .

Windows users

You can also download this zip-file, which contains scripts for Windows 2000 and later (XP), and the latest jar-file.
Unzip its content in a directory you've created for the occasion, and run the script called celest.bat. It's a command line interface for you to access the different features of this soft.
+------------------------------+
! Celestial Computer Dashboard !
+------------------------------+
J. Java version
A. Ephemerides for one day
B. Ephemerides for one month
C. Ephemerides for one year
D. Basic Dead Reckoning
E. Basic Dead Reckoning with Almanac Data
F. Basic Dead Reckoning (with Swing UI)
G. Real Time data (with Swing UI)
H. Current Config
I. Lunar Distances
K. Lunar Distances (with Swing UI)
L. Lunar Distances Publisher
---------------------------------------
Q. Quit
---------------------------------------
Type the letter and press Enter:
        

Linux users

You can also download this zip-file, which contains scripts for Linux (bash shell), and the latest jar-file.
Unzip its content in a directory you've created for the occasion, and run the script called celest. It's a command line interface for you to access the different features of this soft, exactly similar to the Windows one featured above.
If the command does not start, try to change the attributes of the file by typing:
Prompt> chmod +x celest
        


We will use in the following examples the jar-file called CelestialComputer.jar, provided from the downloaded section on sourceforge.

Content

Current Configuration

Back to Content
Provides various informations, based on the System time.


Prompt> java -classpath CelestialComputer.jar main.Main
Current Time:Thu, 18 Mar 2004 12:48:29 -0800
Required date and time (current GMT) : 2004-03-18 20:48:29
GHA Sun   : 13009.54'
SHA Sun   : 00117.58'
DEC Sun   : S 0033.64'
SD Sun    : 16.1'
HP Sun    : 0.1'
EOT       : -07m 50.8s
GHAmoon   : 15206.29'
SHAmoon   : 02314.33'
DECmoon   : S 1451.99'
SDmoon    : 15.7'
HPmoon    : 57.7'
Illum     : 5.0% (-)
GHA Aries : 12851.96'
GHApolaris: 09012.55'
SHApolaris: 32120.59'
DECpolaris: N 8917.17'
GMST      : 12852.13'
GAST      : 12851.96'
EoE       : -0.682s
delta_psi : -11.154"
delta_eps : 7.293"
OoE       : 2326'19.476"
tOoE      : 2326'26.769"
JD        : 2453083.367002
JDE       : 2453083.367002
LDS       : 02558.72'
DoW       : THU

Moon-Sun deltaHA : 33426.31'(26.01 day(s))
    Between last quarter and new
(Process completed in 20 ms)
      

Data Publisher

Back to Content
Publishes the Ephemerides for one given day.
In red, are the user entries.


Prompt> java -classpath CelestialComputer.jar astro.runtime.DataPublisher
Year  > 2004
Month > 3
Day   > 18
Hour Angle (1) or Right Ascension (2) ? > [1] 1
Angles in Degrees Minutes 100th of minutes (1) or Degrees Minutes Seconds (2) ? > [1] 1
+-------------------------------------------------------------------------------------------------------------------+
| Ephemerides for thu 18-Mar-2004                                                                                   |
+----+------------+------------+-----------------------------------------+------------------------------------------+
|    |  Equation  |    Aries   |                   Sun                   |                    Moon                  |
| UT |     of     |------------+-----------------------------------------+------------------------------------------+
|    |    Time    |     GHA    |     GHA    |      Dec    |  sd   |  hp  |     GHA    |      Dec    |  sd   |  hp   |
+----+------------+------------+------------+-------------+-------+------+------------+-------------+-------+-------+
| 00 | -08m 06.0s | 17553.44' | 17758.51' - S 0054.22' | 16.1' | 0.1' | 21034.42' - S 1913.76' | 15.8' | 58.1' |
| 01 | -08m 05.2s | 19055.90' | 19258.69' - S 0053.23' | 16.1' | 0.1' | 22502.94' - S 1902.05' | 15.8' | 58.0' |
| 02 | -08m 04.5s | 20558.37' | 20758.87' - S 0052.24' | 16.1' | 0.1' | 23931.57' - S 1850.23' | 15.8' | 58.0' |
| 03 | -08m 03.8s | 22100.83' | 22259.05' - S 0051.25' | 16.1' | 0.1' | 25400.29' - S 1838.32' | 15.8' | 58.0' |
| 04 | -08m 03.1s | 23603.29' | 23759.23' - S 0050.27' | 16.1' | 0.1' | 26829.11' - S 1826.32' | 15.8' | 58.0' |
| 05 | -08m 02.3s | 25105.76' | 25259.42' - S 0049.28' | 16.1' | 0.1' | 28258.02' - S 1814.22' | 15.8' | 58.0' |
| 06 | -08m 01.6s | 26608.22' | 26759.60' - S 0048.29' | 16.1' | 0.1' | 29727.03' - S 1802.04' | 15.8' | 58.0' |
| 07 | -08m 00.9s | 28110.69' | 28259.78' - S 0047.30' | 16.1' | 0.1' | 31156.14' - S 1749.76' | 15.8' | 57.9' |
| 08 | -08m 00.2s | 29613.15' | 29759.96' - S 0046.31' | 16.1' | 0.1' | 32625.34' - S 1737.40' | 15.8' | 57.9' |
| 09 | -07m 59.4s | 31115.61' | 31300.14' - S 0045.32' | 16.1' | 0.1' | 34054.64' - S 1724.95' | 15.8' | 57.9' |
| 10 | -07m 58.7s | 32618.08' | 32800.32' - S 0044.33' | 16.1' | 0.1' | 35524.03' - S 1712.42' | 15.8' | 57.9' |
| 11 | -07m 58.0s | 34120.54' | 34300.51' - S 0043.34' | 16.1' | 0.1' | 00953.52' - S 1659.80' | 15.8' | 57.9' |
| 12 | -07m 57.3s | 35623.01' | 35800.69' - S 0042.35' | 16.1' | 0.1' | 02423.09' - S 1647.10' | 15.8' | 57.8' |
| 13 | -07m 56.5s | 01125.47' | 01300.87' - S 0041.36' | 16.1' | 0.1' | 03852.76' - S 1634.32' | 15.8' | 57.8' |
| 14 | -07m 55.8s | 02627.93' | 02801.05' - S 0040.38' | 16.1' | 0.1' | 05322.52' - S 1621.47' | 15.8' | 57.8' |
| 15 | -07m 55.1s | 04130.40' | 04301.23' - S 0039.39' | 16.1' | 0.1' | 06752.38' - S 1608.54' | 15.7' | 57.8' |
| 16 | -07m 54.3s | 05632.86' | 05801.42' - S 0038.40' | 16.1' | 0.1' | 08222.32' - S 1555.53' | 15.7' | 57.8' |
| 17 | -07m 53.6s | 07135.33' | 07301.60' - S 0037.41' | 16.1' | 0.1' | 09652.35' - S 1542.45' | 15.7' | 57.7' |
| 18 | -07m 52.9s | 08637.79' | 08801.78' - S 0036.42' | 16.1' | 0.1' | 11122.47' - S 1529.29' | 15.7' | 57.7' |
| 19 | -07m 52.2s | 10140.25' | 10301.96' - S 0035.43' | 16.1' | 0.1' | 12552.68' - S 1516.07' | 15.7' | 57.7' |
| 20 | -07m 51.4s | 11642.72' | 11802.14' - S 0034.44' | 16.1' | 0.1' | 14022.98' - S 1502.78' | 15.7' | 57.7' |
| 21 | -07m 50.7s | 13145.18' | 13302.33' - S 0033.45' | 16.1' | 0.1' | 15453.36' - S 1449.42' | 15.7' | 57.7' |
| 22 | -07m 50.0s | 14647.65' | 14802.51' - S 0032.46' | 16.1' | 0.1' | 16923.83' - S 1435.99' | 15.7' | 57.6' |
| 23 | -07m 49.2s | 16150.11' | 16302.69' - S 0031.48' | 16.1' | 0.1' | 18354.39' - S 1422.50' | 15.7' | 57.6' |
| 24 | -07m 48.5s | 17652.57' | 17802.88' - S 0030.49' | 16.1' | 0.1' | 19825.02' - S 1408.95' | 15.7' | 57.6' |
+----+------------+------------+------------+-------------+-------+------+------------+-------------+-------+-------+
| Sun Meridian Passage       : 12:07:57.251 |
| Moon Meridian Passage      : 10:19:02.616 |
| Moon Anti-Meridian Passage : 22:43:50.745 |
| Moon Age : 25.65 -   Phase :  6.9% (-)    |
+-------------------------------------------+
    Between last quarter and new
It is also possible to publish Ephemerides Data for a given period. This is what is actually done in the Windows scripts described and available from here.

Dead Reckoning

Back to Content
Calculates the Estimated altitude of a given celestial body (sun in the example) after its GHA and Declination.
In red, are the user entries.


Prompt> java -classpath CelestialComputer.jar main.DeadReckoningMain
GHA > Deg :                 137
GHA > Min :                 44.55
Declination > Deg :         21
Declination > Min :         50.3
North[N] or South[S] >      s
Assumed Latitude > Deg :  37
Assumed Latitude > Min :  35
North[N] or South[S] >    n
Assumed Longitude > Deg : 122
Assumed Longitude > Min : 0
Est[E] or West[W] >       w
Est. Alt. :  28°45.53'
aZimuth   :  196°41.71'
Eye Height above sea level (meters) :1.8
Corr. Alt. :  28°57.69'
Done.
      

Dead Reckoning, with Data

Back to Content
Calculates the Estimated altitude of a given celestial body (sun in the example), and the data are computed.


Prompt> java -classpath CelestialComputer.jar astro.runtime.Minimal
Enter UT:
Year   [9999] :2004
Month   [99]  :3
Day     [99]  :1
Hours   [99]  :22
Minutes [99]  :9
Seconds [99]  :0
For Mon, 1 Mar 2004 22:09:00 UT
----------- Almanac Data ----------
Aries GHA:132°17.66'
Sun GHA:149°12.21'
Sun Dec:S 07°11.24'
Sun HP:0.1'
Sun SD:16.1'
Moon GHA:028°49.90'
Moon Dec:N 27°13.16'
Moon HP:54.8'
Moon SD:14.9'
Polaris GHA:093°32.63'
Polaris Dec:N 89°17.22'
-----------------------------------
Enter your assumed position:
Latitude Degrees [99]     :37
Latitude Minutes [99.99]  :56
Latitude Sign [N|S]       :n
Longitude Degrees [999]   :123
Longitude Minutes [99.99] :4
Longitude Sign [E|W]      :w
Eye Height above sea level :2
Enter Instrumental Altitude (from sextant)
Sextant Altitude Degrees [999]   :38
Sextant Altitude Minutes [99.99] :30
Index Error (to *add*) in minutes :0.1
Ea Sun: 38°43.57' (38.726)
Z Sun : 214°04.26' (214.071)
Obs. Alt. Sun: 38°42.77' (38.713)
Intercept: 0.793' toward the sun, Z: 214.071 true
      

Lunar Distances

Back to Content
Calculate the Lunar GMT, after the Moon Distance...
In red, are the user entries.

Prompt>java -classpath CelestialComputer.jar astro.runtime.LunarDistance
Enter UT:
Year   [9999] :2003
Month   [99]  :10
Day     [99]  :1
Hours   [99]  :18
Minutes [99]  :38
Seconds [99]  :47
Enter your assumed position
Latitude Degrees [99]     :12
Latitude Minutes [99.99]  :56.9
Latitude Sign [N|S]       :n
Longitude Degrees [999]   :61
Longitude Minutes [99.99] :17.6
Longitude Sign [E|W]      :w
Enter the sextant Index Correction
 This correction is to be *added* to what's read :
Sextant Index Correction in minutes [99.99]   :0.1
Enter the Moon-Sun distance measured with the sextant:
Sextant Lunar Distance Degrees [999]   :76
Sextant Lunar Distance Minutes [99.99] :45.6
Limb - Near[N] or Far[F] : (N) n
For Wed, 1 Oct 2003 18:38:47 UT
----------- Almanac Data ----------
Aries GHA:289°46.62'
Sun GHA:102°16.35'
Sun Dec:S 03°14.47'
Sun HP:0.1'
Sun SD:16.0'
Moon GHA:025°28.55'
Moon Dec:S 26°12.45'
Moon HP:59.2'
Moon SD:16.1'
Polaris GHA:250°34.34'
Polaris Dec:N 89°16.66'
-----------------------------------
Ea Sun: 46°12.72' (46.212)
Z Sun : 251°06.81' (251.113)
App. Alt. Sun: 46°13.55' (46.226) with parallax and refraction
Ea Moon: 37°35.68' (37.595)
Z Moon : 138°29.87' (138.498)
App. Alt. Moon: 36°49.55' (36.826) with parallax and refraction
Lunar Distance to Sun (to Observe):  76°43.70' (76.728)
Sextant:76.760
Sun SD:0.266, Moon SD:0.272
Apparent Distance:77.300
Delta Z:112.615
Observed Distance (with sextant):  76°43.69' (76.728)
Calc Dist at Wed, 1 Oct 2003 18:00:00 UT:76.375
Calc Dist at Wed, 1 Oct 2003 19:00:00 UT:76.922
--------------------------------------------------------------------------------------------------
GMT diff per Lunar Dist:Wed, 1 Oct 2003 18:38:46
 UT instead of Wed, 1 Oct 2003 18:38:47 UT
--------------------------------------------------------------------------------------------------
      

Real Time Almanac, with Swing UI

Back to Content
Runs in real time, refreshes the data every seconds.

      
Prompt> java -classpath CelestialComputer.jar astro.runtime.ui.AstroGUI
      

Real Time UI

The data in the panel are updated every seconds. The time is given by the computer's internal clock.

Sun Fix data, Lunar Distance, with Swing UI

Back to Content
Return data for a Sun fix, based on your observations.

      
Prompt> java -classpath CelestialComputer.jar astro.runtime.ui.FixApplication
      

Sun Fix

Allows you to use an artificial horizon, like a bucket full of water. In this case, you have to bring down the image of the Sun onto its image on the surface of the water in the bucket. The observed altitude will then have to be divided by two. Also, it will have not to consider the semi-diameter correction, nor the eye height above the water correction.
      
Prompt> java -classpath CelestialComputer.jar astro.runtime.ui.LunarApplication
      

Lunar Distance


History

Next

Stars, Planets.


End of Text