Metadata-Version: 2.4
Name: sfalmanac
Version: 1.13
Summary: Creates the daily pages of a Nautical Almanac using Skyfield
Home-page: https://github.com/aendie/SFalmanac-Py3
Author: Andrew Bauer
Author-email: aendie.bauer@gmail.com
License: "GPL-3.0-or-later"
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Astronomy
Requires-Python: >=3.4
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: Pandas
Requires-Dist: Skyfield>=1.49
Dynamic: license-file

=============================
SFalmanac Project Description
=============================

.. |nbsp| unicode:: 0xA0
   :trim:

.. |emsp| unicode:: U+2003
   :trim:

.. |smiley| image:: https://github.githubassets.com/images/icons/emoji/unicode/1f603.png
   :height: 24 px
   :width:  24 px

SFalmanac is a **Python 3** script 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.

**NOTE:** SFalmanac has now been superceeded by Skyalmanac. Currently the functionality is identical, however, if using SFalmanac, please switch to `Skyalmanac <https://pypi.org/project/skyalmanac/>`_ as SFalmanac will not be upgraded in the future.

SFalmanac employs multiprocessing (if your processor has multiple cores) reducing the processing time. (Single-processing is also available as an option.)

Quick Overview
--------------
SFalmanac not only creates the daily pages of the Nautical Almanac - it also contains Lunar Distance tables and charts and "Increments and Corrections" tables as well as abbreviated Sun tables and Event Time tables.

This is the **PyPI edition** of `SFalmanac-Py3 <https://github.com/aendie/SFalmanac-Py3>`_ (a Changelog can be viewed here). Version numbering follows the scheme *Major.Minor.Patch*, whereby the *Patch* number 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 as PyPI packages.
|
| The astronomical library employed is: `Skyfield <https://rhodesmill.org/skyfield/>`_.
| SFalmanac uses the Hipparcos catalog as its star database.
| Note that two options are available (by manually 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 (specifically 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 (specifiable in *config.py*). Note that IERS specifies the range of Earth Orientation Parameter (EOP) data from 2nd January 1973 and is updated weekly. Refer to the `IERS web site <https://www.iers.org/IERS/EN/Home/home_node.html>`_ for current information.

Software Requirements
=====================

|
| Nearly all of the astronomical computation is done by the Skyfield library.
| Typesetting is done typically with MiKTeX or TeX Live.
| Here are the requirements/recommendations:

* `python <https://www.python.org/downloads/>`_ >= 3.4 (version 3.13 is recommended)
* `skyfield <https://pypi.org/project/skyfield/>`__ >= v1.49 (v1.55 is recommended; see the `Skyfield Changelog <https://rhodesmill.org/skyfield/installation.html#changelog>`_)
* `numpy <https://numpy.org/>`_ < 2.0.0 (only for Skyfield versions < 1.48)
* `pandas <https://pandas.pydata.org/>`_ >= 1.0 (to decode the Hipparcos star catalog)
* `pandas <https://pandas.pydata.org/>`_ >= 2.2.2 (if numpy version >= 2.0.0)
* `MiKTeX <https://miktex.org/>`_ |nbsp| |nbsp| or |nbsp| |nbsp| `TeX Live <http://www.tug.org/texlive/>`_

**Skyfield version 1.55 or newer is recommended (versions 1.50 to 1.54 are known to have issues).**

Installation on Windows 10/11; on Linux before Python 3.12; on Mac before MacOS 14
==================================================================================

|
| Install a TeX/LaTeX program on your operating system so that ``pdflatex`` is available.
| Ensure that the `pip Python installer tool <https://pip.pypa.io/en/latest/installation/>`_ is installed. Check that the latest version of SFalmanac is installed:

::

  python -m pip install sfalmanac --upgrade

Installing 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 pandas

Thereafter run it with::

  python -m sfalmanac

|
| 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 <https://docs.python.org/3/library/venv.html>`_ virtual environment.
| Finally check or change the settings in *config.py*. Its location is printed immediately whenever SFalmanac runs.

Installation on Linux with Python 3.12 and higher; on MacOS 14 and higher
=========================================================================

More recent versions of Python (on specific operating systems) prevent users installating a PyPI package (such as Skyfield, SFalmanac, numpy, Pandas) in the Python system-wide area. The error message is "*This environment is externally managed*" and this is intended to avoid a conflict between the distribution's package manager and Python package management tools as defined in the `PEP-668 documentation <https://peps.python.org/pep-0668/>`_. 

The intention is to persuade users to install PyPI packages in a virtual environment instead, which functions very well. The downside: a virtual environment is typically created in a project folder, so you may require several vitrual environments. It is NOT wise to "break the rules" and force package installation in the Python system-wide area.

To assist users new to virtual environments, I have provided an `Installation guide for Linux  <https://github.com/aendie/SFalmanac-Py3/blob/master/How%20to%20install%20Skyalmanac%20on%20Linux.pdf>`_. (Package installation for MacOS is in principle the same.)

Guidelines for Linux & Mac OS
-----------------------------

Quote from `Chris Johnson <https://stackoverflow.com/users/763269/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``. 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.
