The astro project seeks to help programmers new to vector astronomy work with the latest planetary ephemerides published by the NASA Jet Propulsion Laboratory, using the NOVAS-C library.
NOVAS-C and the JPL Ephemerides are free to download from the publishers. Neither is provided here, although the Makefile downloads both.
Included in this project are two sample programs:
planets
-- Calculates the apparent position of the Sun and planets from an observation point on Earthtropical
-- Displays upcoming tropical moments (equinox and solstice)
"The Naval Observatory Vector Astronomy Software (NOVAS) is a source-code library in FORTRAN, C and Python that provides common astrometric quantities and transformations. It can supply, in one or two function calls, the instantaneous celestial position of any star or planet in a variety of coordinate systems." NOVAS C 3.1 Guide
This project uses the NOVAS-C library to calculate the sky positions of the planets, Sun and Moon, from an observer at a fixed location on Earth; and predicts future solstices and equinoxes.
The latest version of the library is NOVAS-C 3.1. The Makefile also applies fixes for the two (as of 2022-May-14) known issues in NOVAS-C 3.1.
This project uses the general purpose planetary ephemeris file DE440, published 08-Feb-2021 by the National Aeronautics and Space Administration Jet Propulsion Laboratory (NASA JPL, or simply "JPL"). The JPL also publishes the DE441 ephemeris which covers a time range of more than 30,000 years. Those wishing to work with planetary positions more than 500 years ago, or 500 years in the future, should download DE441.
More information about these JPL products is provided in The JPL Planetary and Lunar Ephemerides DE440 and DE441.
The United States Naval Observatory publishes NOVAS-C. More information is avaiable at the following links:
Naval Observatory Vector Astronomy Software
All distributions:
- patch
- gcc
- make
RHEL/CentOS/Fedora:
- curl
- libcurl-devel
Debian/Ubuntu:
- libcurl4
- libcurl4-openssl-dev
Additionally, there is an optional requirement on kplot and cairo. To enable building with these libraries, set KPLOT
to a non-zero value, then run make.
export KPLOT=1
Cairo is available as Debian/Ubuntu package named libcairo2-dev
.
Kplot isn't available as a standard distribution package, but is easily installed from sources. Install to the default prefix, /usr/local
. Astro was tested with kplot v0.1.15 and cairo v1.16.0.
The plots are only generated by tropical
, and show the latitude of the solar transit point in the vicinity of the tropical moments. More plots are in the works for a future update.
The Makefile will manage downloading and patching the NOVAS-C library, and the DE 440, 430, or 431 ephemerides.
By default, the Makefile will select DE 440.
make
If you want to use DE 431, then issue the following command:
make DE=431
This project has been tested on MacOS, using gcc.
This project has been tested on Windows 10, using the Windows Subsystem for Linux. The tested WSL distribution was Debian.
This project includes two very simple applications to illustrate how to use NOVAS-C and JPL DE440. The features in these programs is intentionally limited in order to reduce dependencies on platform-specific and third-party libraries.
The planets
program displays the positions of the planets from an
observer on Earth.
planets/planets -h
watch planets/planets
The tropical
program displays upcoming tropical moments
(equinox and solstice).
It uses the latitude of the subsolar point on Earth in its calculations. A local maximum or minimum latitude is the solstice, and the crossing of the Equator is the equinox.
tropical/tropical
The output will look like:
Ephemeris: JPL Planetary Ephemeris DE440/LE440
December solstice occurs at 2021-12-21 16:13:02 UTC
Subsolar point: {23°26'15.2"S 63°42'05.1"W} [{-23.4375522828, -63.7014295322}]
March equinox occurs at 2022-03-20 15:33:38 UTC
Subsolar point: {0°00'00.0"S 51°33'23.7"W} [{-0.0000000003, -51.5565758625}]
June solstice occurs at 2022-06-21 08:11:23 UTC
Subsolar point: {23°26'16.3"N 57°35'48.4"E} [{23.4378525649, 57.5967763997}]
September equinox occurs at 2022-09-23 01:04:33 UTC
Subsolar point: {0°00'00.0"N 161°59'37.9"E} [{0.0000000003, 161.9938501501}]
December solstice occurs at 2022-12-21 20:43:09 UTC
Subsolar point: {23°26'17.5"S 131°14'14.2"W} [{-23.4381831773, -131.2372869469}]
March equinox occurs at 2023-03-20 21:25:07 UTC
Subsolar point: {0°00'00.0"S 139°25'43.8"W} [{-0.0000000004, -139.4288275902}]
June solstice occurs at 2023-06-21 13:29:45 UTC
Subsolar point: {23°26'18.3"N 21°59'24.1"W} [{23.4384036931, -21.9900147986}]
September equinox occurs at 2023-09-23 06:50:08 UTC
Subsolar point: {0°00'00.0"N 75°36'00.3"E} [{0.0000000000, 75.6000830151}]
After cloning this repository and running the setup script, the following file will be present:
Cdist/NOVAS_C3.1_Guide.pdf
That document provides the definitive reference to NOVAS-C, and is therefore required reading if you want to get the best results.
Bangert, J., Puatua, W., Kaplan, G., Bartlett, J., Harris, W., Fredericks, A., & Monet, A. (2011) User's Guide to NOVAS Version C3.1 (Washington, DC: USNO).