Creates the daily pages of a Nautical Almanac using Skyfield and Ephem
Project description
This is the PyPI edition of SkyAlmanac-Py3. Version numbering started from 1.0 as the previous well-tested versions that are on github since 2015 were never published in PyPI. Version numbering follows the scheme Major.Minor.Patch, whereby the Patch number represents some kind of a small fix to the intended release, e.g. in 1.3.1 the deprecated (but still functional) LaTeX command \clearscrheadfoot is repalaced by \clearpairofpagestyles.
Skyalmanac is a Python 3 script that creates the daily pages of the Nautical Almanac. The generated tables are needed for celestial navigation with a sextant. UT1 is the timescale employed in the almanac. Although you are strongly advised to purchase the official Nautical Almanac, this program will reproduce the tables with no warranty or guarantee of accuracy.
Two astronomical libraries are employed: Skyfield and Ephem. Ephem is only used for calculating twilight (actual, civil and nautical sunrise/sunset) and moonrise/moonset, as Ephem improves performance significantly with only a marginal loss of accuracy in the times stated above (that are rounded to the minute anyway).
Skyalmanac uses the Hipparcos catalog as its star database. If a current version Skyfield (>= 1.31) is used, you have two options (which one, you specify manually by editing config.py):
if “useIERS = False”, the built-in UT1 tables in the installed version of Skyfield will be employed.
if “useIERS = True”, for optimal accuracy (especially for all GHA data), Earth orientation data from IERS (International Earth Rotation and Reference Systems Service) is downloaded and then used until it ‘expires’. It expires after a chosen number of days (also specifiable in config.py). Note that IERS specifies the range of Earth Orientation Parameter (EOP) data currently as “from 2nd January 1973 to 15th May 2022”. Refer to the IERS web site for current information.
If your Skyfield version is somewhat older (<= 1.30), Skyfield will have downloaded the older files it then used: deltat.data, deltat.preds and Leap_Second.dat, which are slightly less accurate than the IERS EOP data.
Software Requirements
python >= 3.4 (the latest version is recommended)
skyfield >= v1.15 (see the Skyfield Changelog)
pandas >= 1.0 (to decode the Hipparcos catalog)
ephem >= 3.7.6 (4.1 is good; 4.1.1, 4.1.2 and 4.1.3 are faulty)
The fault with Ephem 4.1.1, 4.1.2 or 4.1.3 is an Endless loop in computing moon rise/set
Installation
Install a TeX/LaTeX program on your operating system so that ‘pdflatex’ is available.
Ensure that the pip Python installer tool is installed. Then ensure that old versions of PyEphem, Ephem and Skyalmanac are not installed before installing SkyAlmanac from PyPI:
python -m pip uninstall pyephem ephem skyalmanac python -m pip install skyalmanac
Installing SkyAlmanac ensures that Ephem, Skyfield and Pandas (and their dependencies) are also installed. If previous versions of Skyalmanac were installed, consider upgrading Skyfield and Pandas:
python -m pip install --upgrade skyfield pandas
Thereafter run it with:
python -m skyalmanac
On a POSIX system (Linux or Mac OS), use python3 instead of python in the commands above.
This PyPI edition also supports installing and running in a venv virtual environment. Finally check or change the settings in config.py. It’s location is printed immediately whenever Skyalmanac runs.
Guidelines for Linux & Mac OS
Quote from Chris Johnson:
It’s best to not use the system-provided Python directly. Leave that one alone since the OS can change it in undesired ways.
The best practice is to configure your own Python version(s) and manage them on a per-project basis using venv (for Python 3). This eliminates all dependency on the system-provided Python version, and also isolates each project from other projects on the machine.
Each project can have a different Python point version if needed, and gets its own site_packages directory so pip-installed libraries can also have different versions by project. This approach is a major problem-avoider.
Troubleshooting
If using MiKTeX 21 or higher, executing ‘option 5’ (Increments and Corrections) will probably fail with:
! TeX capacity exceeded, sorry [main memory size=3000000].
To resolve this problem (assuming MiKTeX has been installed for all users), open a Command Prompt as Administrator and enter:
initexmf --admin --edit-config-file=pdflatex
This opens pdflatex.ini in Notepad. Add the following line:
extra_mem_top = 1000000
and save the file. Problem solved. For more details look here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file skyalmanac-1.3.9.tar.gz
.
File metadata
- Download URL: skyalmanac-1.3.9.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d63ddd5addd718b4220096d88a7589d02c0c9a7aeb3068c43f584799a877f4bc |
|
MD5 | 75caae0f8eec9a75e23099f237dc0c15 |
|
BLAKE2b-256 | f8329235a7b372cc04549d25ea332180e1e102a343fc2da85d4425d7deaeaa44 |
File details
Details for the file skyalmanac-1.3.9-py3-none-any.whl
.
File metadata
- Download URL: skyalmanac-1.3.9-py3-none-any.whl
- Upload date:
- Size: 2.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38369ba1ef3c0d613fc457bfd29ca36c64e1f73947aa3ea502bb64624679f76b |
|
MD5 | b7ebcae9fbe2c36e06b4679ec3913c83 |
|
BLAKE2b-256 | 4d677fa5dd1dbb5538a7c4dfaae7d5e3b13d4a9dafb050dd881d4ec9eb01a3fb |