PyMeeus


NamePyMeeus JSON
Version 0.5.12 PyPI version JSON
download
home_pagehttps://github.com/architest/pymeeus
SummaryPython implementation of Jean Meeus astronomical routines
upload_time2022-12-11 11:37:48
maintainer
docs_urlNone
authorDagoberto Salazar
requires_python
licenseLGPLv3
keywords meeus astronomy module library
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            PyMeeus
=======

   **Library of astronomical algorithms in Python**.

PyMeeus is a Python implementation of the astronomical algorithms
described in the classical book 'Astronomical Algorithms, 2nd Edition,
Willmann-Bell Inc. (1998)' by Jean Meeus.

There are great astronomical libraries out there. For instance, if
you're looking for high precision and speed you should take a look at
`libnova <http://libnova.sourceforge.net/>`__. For a set of python
modules aimed at professional astronomers, you should look at
`Astropy <http://www.astropy.org/>`__. On the other hand, the advantages
of PyMeeus are its simplicity, ease of use, ease of reading, ease of
installation (it has the minimum amount of dependencies) and abundant
documentation.

Installation
------------

The easiest way of installing PyMeeus is using pip:

.. code:: sh

   pip install pymeeus

Or, for a per-user installation:

.. code:: sh

   pip install --user pymeeus

If you prefer Python3, you can use:

.. code:: sh

   pip3 install --user pymeeus

If you have PyMeeus already installed, but want to upgrade to the latest
version:

.. code:: sh

   pip3 install -U pymeeus

Properly Using PyMeeus
----------------------

It is very common to try to run PyMeeus like this:

.. code:: sh

   import pymeeus

   mydate = pymeeus.Epoch(1992, 10, 13.0)

But if you do that, you'll get an error like this:

.. code:: sh

   Traceback (most recent call last):
     File "/home/user/test/test.py", line 3, in <module>
       epoch = pymeeus.Epoch(1992, 10, 13.0)
   AttributeError: module 'pymeeus' has no attribute 'Epoch'

This issue points to a misunderstanding that is very common in the
Python world. The keyword ``import`` is used to import **MODULES**\ ...
but PyMeeus is **NOT** a module: It is a **LIBRARY** composed of
**MULTIPLE** modules (``Angle``, ``Epoch``, ``Coordinates``, etc). As of
today, the library Pymeeus has 19 different modules (if you look into
the directory where ``pip`` stores the library, you'll find one ".py"
file per module).

Therefore if you want to use, for example, the module ``Angle`` you
should use:

.. code:: sh

   import pymeeus.Angle

I.e., your *module* is ``pymeeus.Angle``, and not just ``Angle``.

But there is more! When you use ``import`` to fetch a module, you must
then use the *dot* notation to access the components of the module
(classes, functions, etc). For instance:

.. code:: sh

   import pymeeus.Angle

   i = pymeeus.Angle.Angle(11.94524)

In this case, you are telling the Python interpreter that you want to
use the class ``Angle`` (with parameter '11.94524') from the module
``Angle`` belonging to the library ``pymeeus``.

There is, however, a more practical (and common) way to handle modules
using the statement ``from <MODULE> import <COMPONENT>``. For instance:

.. code:: sh

   from pymeeus.Angle import Angle
   from pymeeus.Epoch import Epoch, JDE2000
   from math import sin, cos, tan, acos, atan2, sqrt, radians, log10

This way is preferred because, among other reasons, only the required
components are loaded into memory instead of the whole module. Also, now
the component is directly added to your execution environment, which
means that you no longer need to use the *dot* notation.

Therefore, the script at the beginning would become:

.. code:: sh

   from pymeeus.Epoch import Epoch

   mydate = Epoch(1992, 10, 13.0)

Meta
----

Author: Dagoberto Salazar

Distributed under the GNU Lesser General Public License v3 (LGPLv3). See
``LICENSE.txt`` and ``COPYING.LESSER`` for more information.

Documentation: https://pymeeus.readthedocs.io/en/latest/

GitHub: https://github.com/architest/pymeeus

If you have Sphinx installed, you can generate your own, latest
documentation going to directory 'docs' and issuing:

.. code:: sh

   make html

Then the HTML documentation pages can be found in 'build/html'.

Contributing
------------

The preferred method to contribute is through forking and pull requests:

1. Fork it (https://github.com/architest/pymeeus/fork)
2. Create your feature branch (``git checkout -b feature/fooBar``)
3. Commit your changes (``git commit -am 'Add some fooBar'``)
4. Push to the branch (``git push origin feature/fooBar``)
5. Create a new Pull Request

Please bear in mind that PyMeeus follows the PEP8 style guide for Python
code `(PEP8) <https://www.python.org/dev/peps/pep-0008/?>`__. We suggest
you install and use a linter like
`Flake8 <http://flake8.pycqa.org/en/latest/>`__ before contributing.

Additionally, PyMeeus makes heavy use of automatic tests. As a general
rule, every function or method added must have a corresponding test in
the proper place in ``tests`` directory.

Finally, documentation is also a big thing here. Add proper and abundant
documentation to your new code. This also includes in-line comments!!!.

Contributors
------------

-  `Neil Freeman <https://github.com/fitnr>`__ - Fixed undefined
   variable in Epoch.tt2ut
-  `molsen234 <https://github.com/molsen234>`__ - Fixed bug when using
   fractional seconds, minutes, hours or days
-  `Sebastian Veigl <https://github.com/sebastian1306>`__ - Added
   functionality for Jupiter's moons
-  Sophie Scholz - Added functionality for Jupiter's moons
-  Vittorio Serra - Added functionality for Jupiter's moons
-  Michael Lutz - Added functionality for Jupiter's moons
-  `Ben Dilday <https://github.com/bdilday>`__ - Added ``__hash__()``
   method to class Epoch
-  `Zivoslav <https://github.com/zivoslav>`__ - Bug report of winter
   solstice
-  `Devid <https://github.com/sevdog>`__, `Hugo van
   Kemenade <https://github.com/hugovk>`__ - Test suggestions

What's new
----------

-  0.5.12

   -  Fixed a bug in the computation of the winter solstice. Added new
      tests and information about proper use of the library.

-  0.5.11

   -  Added parameter ``local`` to the ``Epoch`` class constructor and
      the methods ``get_date()`` and ``get_full_date()``.

-  0.5.10

   -  Added methods ``moon_librations()`` and
      ``moon_position_angle_axis()``.

-  0.5.9

   -  Added method ``moon_maximum_declination()``.

-  0.5.8

   -  Fixed several bugs in ``Epoch`` class, and added method ``doy()``.

-  0.5.7

   -  Added method ``moon_passage_nodes()``.

-  0.5.6

   -  Added method ``moon_perigee_apogee()``.

-  0.5.5

   -  Added method ``moon_phase()``.

-  0.5.4

   -  Added methods ``illuminated_fraction_disk()`` and
      ``position_bright_limb()`` to ``Moon`` class.

-  0.5.3

   -  Fixed error in the return type of method
      ``Sun.equation_of_time()``.

-  0.5.2

   -  Added methods to compute the Moon's longitude of ascending node
      and perigee.

-  0.5.1

   -  Changes in the organization of the documentation.

-  0.5.0

   -  Added ``Moon`` class and ``position()`` methods.

-  0.4.3

   -  Added method ``ring_parameters()`` to Saturn class.

-  0.4.2

   -  Added method ``__hash__()`` to Epoch. Now Epoch objects can be
      used as keys in a dictionary.

-  0.4.1

   -  Added funtionality to compute the positions of Jupiter's Galilean
      moons.

-  0.4.0

   -  Added methods to compute Saturn's ring inclination and longitude
      of ascending node.

-  0.3.13

   -  Additional encoding changes.

-  0.3.12

   -  Deleted ``encoding`` keyword from setup.py, which was giving
      problems.

-  0.3.11

   -  Added encoding specification to setup.py.

-  0.3.10

   -  Fixed characters with the wrong encoding.

-  0.3.9

   -  Relaxed requirements, added contributor molsen234, and fixed
      format problems showed by flake8.

-  0.3.8

   -  Fixed undefined variable in ``Epoch.tt2ut``.

-  0.3.7

   -  Fix bug when using fractional seconds, minutes, hours or days,
      plus documentation improvements.

-  0.3.6

   -  Add method to compute rising and setting times of the Sun.

-  0.3.5

   -  Add method ``magnitude()`` to planet classes.

-  0.3.4

   -  Add method to compute the parallax correction to Earth class.

-  0.3.3

   -  Add methods to compute the passage through the nodes.

-  0.3.2

   -  Add methods to compute the perihelion and aphelion of all planets.

-  0.3.1

   -  Fix errors in the elongation computation, add tests and examples
      of use of methods ``geocentric_position()``, and tests and
      examples for ``Pluto`` class.

-  0.3.0

   -  Added ``Pluto`` class.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/architest/pymeeus",
    "name": "PyMeeus",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Meeus astronomy module library",
    "author": "Dagoberto Salazar",
    "author_email": "dagoberto.salazar@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/81/76/599896b37e60f43078afd8354b3802eb7ca257a7e7f6253cc21c4c672877/PyMeeus-0.5.12.tar.gz",
    "platform": null,
    "description": "PyMeeus\n=======\n\n   **Library of astronomical algorithms in Python**.\n\nPyMeeus is a Python implementation of the astronomical algorithms\ndescribed in the classical book 'Astronomical Algorithms, 2nd Edition,\nWillmann-Bell Inc. (1998)' by Jean Meeus.\n\nThere are great astronomical libraries out there. For instance, if\nyou're looking for high precision and speed you should take a look at\n`libnova <http://libnova.sourceforge.net/>`__. For a set of python\nmodules aimed at professional astronomers, you should look at\n`Astropy <http://www.astropy.org/>`__. On the other hand, the advantages\nof PyMeeus are its simplicity, ease of use, ease of reading, ease of\ninstallation (it has the minimum amount of dependencies) and abundant\ndocumentation.\n\nInstallation\n------------\n\nThe easiest way of installing PyMeeus is using pip:\n\n.. code:: sh\n\n   pip install pymeeus\n\nOr, for a per-user installation:\n\n.. code:: sh\n\n   pip install --user pymeeus\n\nIf you prefer Python3, you can use:\n\n.. code:: sh\n\n   pip3 install --user pymeeus\n\nIf you have PyMeeus already installed, but want to upgrade to the latest\nversion:\n\n.. code:: sh\n\n   pip3 install -U pymeeus\n\nProperly Using PyMeeus\n----------------------\n\nIt is very common to try to run PyMeeus like this:\n\n.. code:: sh\n\n   import pymeeus\n\n   mydate = pymeeus.Epoch(1992, 10, 13.0)\n\nBut if you do that, you'll get an error like this:\n\n.. code:: sh\n\n   Traceback (most recent call last):\n     File \"/home/user/test/test.py\", line 3, in <module>\n       epoch = pymeeus.Epoch(1992, 10, 13.0)\n   AttributeError: module 'pymeeus' has no attribute 'Epoch'\n\nThis issue points to a misunderstanding that is very common in the\nPython world. The keyword ``import`` is used to import **MODULES**\\ ...\nbut PyMeeus is **NOT** a module: It is a **LIBRARY** composed of\n**MULTIPLE** modules (``Angle``, ``Epoch``, ``Coordinates``, etc). As of\ntoday, the library Pymeeus has 19 different modules (if you look into\nthe directory where ``pip`` stores the library, you'll find one \".py\"\nfile per module).\n\nTherefore if you want to use, for example, the module ``Angle`` you\nshould use:\n\n.. code:: sh\n\n   import pymeeus.Angle\n\nI.e., your *module* is ``pymeeus.Angle``, and not just ``Angle``.\n\nBut there is more! When you use ``import`` to fetch a module, you must\nthen use the *dot* notation to access the components of the module\n(classes, functions, etc). For instance:\n\n.. code:: sh\n\n   import pymeeus.Angle\n\n   i = pymeeus.Angle.Angle(11.94524)\n\nIn this case, you are telling the Python interpreter that you want to\nuse the class ``Angle`` (with parameter '11.94524') from the module\n``Angle`` belonging to the library ``pymeeus``.\n\nThere is, however, a more practical (and common) way to handle modules\nusing the statement ``from <MODULE> import <COMPONENT>``. For instance:\n\n.. code:: sh\n\n   from pymeeus.Angle import Angle\n   from pymeeus.Epoch import Epoch, JDE2000\n   from math import sin, cos, tan, acos, atan2, sqrt, radians, log10\n\nThis way is preferred because, among other reasons, only the required\ncomponents are loaded into memory instead of the whole module. Also, now\nthe component is directly added to your execution environment, which\nmeans that you no longer need to use the *dot* notation.\n\nTherefore, the script at the beginning would become:\n\n.. code:: sh\n\n   from pymeeus.Epoch import Epoch\n\n   mydate = Epoch(1992, 10, 13.0)\n\nMeta\n----\n\nAuthor: Dagoberto Salazar\n\nDistributed under the GNU Lesser General Public License v3 (LGPLv3). See\n``LICENSE.txt`` and ``COPYING.LESSER`` for more information.\n\nDocumentation: https://pymeeus.readthedocs.io/en/latest/\n\nGitHub: https://github.com/architest/pymeeus\n\nIf you have Sphinx installed, you can generate your own, latest\ndocumentation going to directory 'docs' and issuing:\n\n.. code:: sh\n\n   make html\n\nThen the HTML documentation pages can be found in 'build/html'.\n\nContributing\n------------\n\nThe preferred method to contribute is through forking and pull requests:\n\n1. Fork it (https://github.com/architest/pymeeus/fork)\n2. Create your feature branch (``git checkout -b feature/fooBar``)\n3. Commit your changes (``git commit -am 'Add some fooBar'``)\n4. Push to the branch (``git push origin feature/fooBar``)\n5. Create a new Pull Request\n\nPlease bear in mind that PyMeeus follows the PEP8 style guide for Python\ncode `(PEP8) <https://www.python.org/dev/peps/pep-0008/?>`__. We suggest\nyou install and use a linter like\n`Flake8 <http://flake8.pycqa.org/en/latest/>`__ before contributing.\n\nAdditionally, PyMeeus makes heavy use of automatic tests. As a general\nrule, every function or method added must have a corresponding test in\nthe proper place in ``tests`` directory.\n\nFinally, documentation is also a big thing here. Add proper and abundant\ndocumentation to your new code. This also includes in-line comments!!!.\n\nContributors\n------------\n\n-  `Neil Freeman <https://github.com/fitnr>`__ - Fixed undefined\n   variable in Epoch.tt2ut\n-  `molsen234 <https://github.com/molsen234>`__ - Fixed bug when using\n   fractional seconds, minutes, hours or days\n-  `Sebastian Veigl <https://github.com/sebastian1306>`__ - Added\n   functionality for Jupiter's moons\n-  Sophie Scholz - Added functionality for Jupiter's moons\n-  Vittorio Serra - Added functionality for Jupiter's moons\n-  Michael Lutz - Added functionality for Jupiter's moons\n-  `Ben Dilday <https://github.com/bdilday>`__ - Added ``__hash__()``\n   method to class Epoch\n-  `Zivoslav <https://github.com/zivoslav>`__ - Bug report of winter\n   solstice\n-  `Devid <https://github.com/sevdog>`__, `Hugo van\n   Kemenade <https://github.com/hugovk>`__ - Test suggestions\n\nWhat's new\n----------\n\n-  0.5.12\n\n   -  Fixed a bug in the computation of the winter solstice. Added new\n      tests and information about proper use of the library.\n\n-  0.5.11\n\n   -  Added parameter ``local`` to the ``Epoch`` class constructor and\n      the methods ``get_date()`` and ``get_full_date()``.\n\n-  0.5.10\n\n   -  Added methods ``moon_librations()`` and\n      ``moon_position_angle_axis()``.\n\n-  0.5.9\n\n   -  Added method ``moon_maximum_declination()``.\n\n-  0.5.8\n\n   -  Fixed several bugs in ``Epoch`` class, and added method ``doy()``.\n\n-  0.5.7\n\n   -  Added method ``moon_passage_nodes()``.\n\n-  0.5.6\n\n   -  Added method ``moon_perigee_apogee()``.\n\n-  0.5.5\n\n   -  Added method ``moon_phase()``.\n\n-  0.5.4\n\n   -  Added methods ``illuminated_fraction_disk()`` and\n      ``position_bright_limb()`` to ``Moon`` class.\n\n-  0.5.3\n\n   -  Fixed error in the return type of method\n      ``Sun.equation_of_time()``.\n\n-  0.5.2\n\n   -  Added methods to compute the Moon's longitude of ascending node\n      and perigee.\n\n-  0.5.1\n\n   -  Changes in the organization of the documentation.\n\n-  0.5.0\n\n   -  Added ``Moon`` class and ``position()`` methods.\n\n-  0.4.3\n\n   -  Added method ``ring_parameters()`` to Saturn class.\n\n-  0.4.2\n\n   -  Added method ``__hash__()`` to Epoch. Now Epoch objects can be\n      used as keys in a dictionary.\n\n-  0.4.1\n\n   -  Added funtionality to compute the positions of Jupiter's Galilean\n      moons.\n\n-  0.4.0\n\n   -  Added methods to compute Saturn's ring inclination and longitude\n      of ascending node.\n\n-  0.3.13\n\n   -  Additional encoding changes.\n\n-  0.3.12\n\n   -  Deleted ``encoding`` keyword from setup.py, which was giving\n      problems.\n\n-  0.3.11\n\n   -  Added encoding specification to setup.py.\n\n-  0.3.10\n\n   -  Fixed characters with the wrong encoding.\n\n-  0.3.9\n\n   -  Relaxed requirements, added contributor molsen234, and fixed\n      format problems showed by flake8.\n\n-  0.3.8\n\n   -  Fixed undefined variable in ``Epoch.tt2ut``.\n\n-  0.3.7\n\n   -  Fix bug when using fractional seconds, minutes, hours or days,\n      plus documentation improvements.\n\n-  0.3.6\n\n   -  Add method to compute rising and setting times of the Sun.\n\n-  0.3.5\n\n   -  Add method ``magnitude()`` to planet classes.\n\n-  0.3.4\n\n   -  Add method to compute the parallax correction to Earth class.\n\n-  0.3.3\n\n   -  Add methods to compute the passage through the nodes.\n\n-  0.3.2\n\n   -  Add methods to compute the perihelion and aphelion of all planets.\n\n-  0.3.1\n\n   -  Fix errors in the elongation computation, add tests and examples\n      of use of methods ``geocentric_position()``, and tests and\n      examples for ``Pluto`` class.\n\n-  0.3.0\n\n   -  Added ``Pluto`` class.\n\n\n",
    "bugtrack_url": null,
    "license": "LGPLv3",
    "summary": "Python implementation of Jean Meeus astronomical routines",
    "version": "0.5.12",
    "split_keywords": [
        "meeus",
        "astronomy",
        "module",
        "library"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "747081f3b6809821b94ac832d9e30b10",
                "sha256": "548f7186bd8b96cbc069cf649a8e8e377dce49ac74486709849fe63a99cad684"
            },
            "downloads": -1,
            "filename": "PyMeeus-0.5.12.tar.gz",
            "has_sig": false,
            "md5_digest": "747081f3b6809821b94ac832d9e30b10",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5752712,
            "upload_time": "2022-12-11T11:37:48",
            "upload_time_iso_8601": "2022-12-11T11:37:48.504403Z",
            "url": "https://files.pythonhosted.org/packages/81/76/599896b37e60f43078afd8354b3802eb7ca257a7e7f6253cc21c4c672877/PyMeeus-0.5.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-11 11:37:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "architest",
    "github_project": "pymeeus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "circle": true,
    "requirements": [],
    "lcname": "pymeeus"
}
        
Elapsed time: 0.10333s