Package: sfalmanac
SFalmanac is aPython 3script that creates the daily pages of the Nautical Almanac (based on the UT timescale).
The generated tables are needed for celestial navigation with a sextant.
Although you are strongly advised to purchase the official Nautical Almanac, this program will reproduce the tables with no warranty or guarantee of accuracy.Multiprocessing version for increased performance!SFalmanac-Py3 can now employ multiprocessing (if your processor has multiple cores) reducing the processing time. Single-processing is also available as an option if required.
Testing has been successfully performed on Windows 10 and Ubuntu 20.04 LTS. (No testing done on Mac OS.) Compared to single-processing, data processing (excluding conversion from TEX to PDF)… of a 6-day Nautical Almanac is4x fasteron Windows 10;2x fasteron Linux.… of 6-day Event Time Tables is almost5x fasteron Windows 10;3x fasteron Linux.Windows 10 uses up to 8 threads; Linux uses up to 12 threads in parallel. Testing was performed on a PC with an AMD Ryzen 7 3700X 8-Core (16 threads) Processor. Windows & Mac OS spawn new processes; Linux forks new processes (the code is compatible with both techniques and will also run on CPUs with fewer cores/threads).Quick OverviewThis is thePyPI editionofSFalmanac-Py3(a Changelog can be viewed here). Version numbering follows the schemeMajor.Minor.Patch, whereby thePatchnumber represents some small correction to the intended release.NOTE:Version numbering in PyPI restarted from 1.0 as the previous well-tested versions that exist since early 2019 were never published in PyPI.Two astronomical libraries are employed:SkyfieldandEphem.
Ephem is only used to calculate a few planet magnitudes (Venus and Jupiter are available in Skyfield).SFalmanac uses the Hipparcos catalog as its star database. If a current version of Skyfield (>= 1.31) is used, you have two options (which one, you specify by manually editingconfig.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 inconfig.py). Note that IERS specifies the range of Earth Orientation Parameter (EOP) data currently as “from 2nd January 1973 to 22nd October 2023 (continuously advancing)”. Refer to theIERS web sitefor current information.If your Skyfield version is somewhat older (<= 1.30), Skyfield will have downloaded the older files it then used:deltat.data, deltat.predsandLeap_Second.dat, which are slightly less accurate than the IERS EOP data (which is updated weekly!).Software RequirementsNearly all of the astronomical computation is done by the free Skyfield library.Typesetting is done typically by MiKTeX or TeX Live.Here are the requirements/recommendations:python>= 3.4 (the latest version is recommended)skyfield>= v1.44 (the latest is recommended; see theSkyfield Changelog)pandas>= 1.0 (to decode the Hipparcos catalog)MiKTeXorTeX LiveInstallationInstall a TeX/LaTeX program on your operating system so thatpdflatexis available.Ensure that thepip Python installer toolis installed.
You may check that the latest version of SFalmanac is installed:python -m pip uninstall sfalmanac
python -m pip install sfalmanacInstalling SFalmanac ensures that Skyfield and Pandas (and their dependencies) are also installed. If previous versions of SFalmanac were installed, consider upgrading Skyfield and Pandas thus:python -m pip install --upgrade skyfield pandasThereafter run it with:python -m sfalmanacOn a POSIX system (Linux or Mac OS), usepython3instead ofpythonin the commands above.This PyPI edition also supports installing and running in avenvvirtual environment.Finally check or change the settings inconfig.py.
Its location is printed immediately whenever SFalmanac runs.Guidelines for Linux & Mac OSQuote fromChris 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 usingvenv(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 ownsite_packagesdirectory so pip-installed libraries can also have different versions by project. This approach is a major problem-avoider.TroubleshootingIf using MiKTeX 21 or higher, executing ‘option 6’ (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=pdflatexThis opens pdflatex.ini in Notepad. Add the following line:extra_mem_top = 1000000and save the file. Problem solved. For more details lookhere.