======
PyERFA
======
|PyPI Status| |Zenodo| |CI Status| |Documentation Status|
PyERFA is the Python_ wrapper for the ERFA_ library (Essential Routines for
Fundamental Astronomy), a C library containing key algorithms for astronomy,
which is based on the SOFA library published by the International Astronomical
Union (IAU). All C routines are wrapped as Numpy_ `universal functions
<https://numpy.org/devdocs/reference/ufuncs.html>`_, so that they can be
called with scalar or array inputs.
The project is a split of ``astropy._erfa`` module, developed in the
context of Astropy_ project, into a standalone package. It contains
the ERFA_ C source code as a git submodule. The wrapping is done
with help of the Jinja2_ template engine.
If you use this package in your research, please cita it via DOI
`10.5281/zenodo.3940699 <https://doi.org/10.5281/zenodo.3940699>`_.
.. Installation
Installation instructions
-------------------------
The package can be installed from the package directory using a simple::
$ pip install .
and similarly a wheel_ can be created with::
$ pip wheel .
.. note:: If you already have the C library ``liberfa`` on your
system, you can use that by setting environment variable
``PYERFA_USE_SYSTEM_LIBERFA=1``.
.. _wheel: https://github.com/pypa/wheel
The package can be obtained from PyPI_ or directly from the git repository::
$ git clone --recursive https://github.com/liberfa/pyerfa/
The package also has nightly wheel that can be obtained as follows::
$ pip install --upgrade --index-url https://pypi.anaconda.org/liberfa/simple pyerfa --pre
Testing
-------
For testing, one can install the packages together with its testing
dependencies and then test it with::
$ pip install .[test]
$ pytest
Alternatively, one can use ``tox``, which will set up a separate testing
environment for you, with::
$ tox -e test
Usage
-----
The package can be imported as ``erfa`` which has all ERFA_ ufuncs wrapped with
python code that tallies errors and warnings. Also exposed are the constants
defined by ERFA_ in `erfam.h
<https://github.com/liberfa/erfa/blob/master/src/erfam.h>`_, as well
as `numpy.dtype` corresponding to structures used by ERFA_. Examples::
>>> import erfa
>>> erfa.jd2cal(2460000., [0, 1, 2, 3])
(array([2023, 2023, 2023, 2023], dtype=int32),
array([2, 2, 2, 2], dtype=int32),
array([24, 25, 26, 27], dtype=int32),
array([0.5, 0.5, 0.5, 0.5]))
>>> erfa.plan94(2460000., [0, 1, 2, 3], 1)
array([([ 0.09083713, -0.39041392, -0.21797389], [0.02192341, 0.00705449, 0.00149618]),
([ 0.11260694, -0.38275202, -0.21613731], [0.02160375, 0.00826891, 0.00217806]),
([ 0.13401992, -0.37387798, -0.21361622], [0.0212094 , 0.00947838, 0.00286503]),
([ 0.15500031, -0.36379788, -0.21040601], [0.02073822, 0.01068061, 0.0035561 ])],
dtype={'names': ['p', 'v'], 'formats': [('<f8', (3,)), ('<f8', (3,))], 'offsets': [0, 24], 'itemsize': 48, 'aligned': True})
>>> erfa.dt_pv
dtype([('p', '<f8', (3,)), ('v', '<f8', (3,))], align=True)
>>> erfa.dt_eraLDBODY
dtype([('bm', '<f8'), ('dl', '<f8'), ('pv', [('p', '<f8', (3,)), ('v', '<f8', (3,))])], align=True)
>>> erfa.DAYSEC
86400.0
It is also possible to use the ufuncs directly, though then one has to
deal with the warning and error states explicitly. For instance, compare::
>>> erfa.jd2cal(-600000., [0, 1, 2, 3])
Traceback (most recent call last):
...
ErfaError: ERFA function "jd2cal" yielded 4 of "unacceptable date (Note 1)"
>>> erfa.ufunc.jd2cal(-600000., [0, 1, 2, 3])
(array([-1, -1, -1, -1], dtype=int32),
...,
array([-1, -1, -1, -1], dtype=int32))
License
-------
PyERFA is licensed under a 3-clause BSD style license - see the
`LICENSE.rst <LICENSE.rst>`_ file.
.. References
.. _Python: https://www.python.org/
.. _ERFA: https://github.com/liberfa/erfa
.. _Numpy: https://numpy.org/
.. _Astropy: https://www.astropy.org
.. _PyPI: https://pypi.org/project/pyerfa/
.. _Jinja2: https://palletsprojects.com/p/jinja/
.. |PyPI Status| image:: https://img.shields.io/pypi/v/pyerfa.svg
:target: https://pypi.python.org/pypi/pyerfa
:alt: PyPI Status
.. |Zenodo| image:: https://zenodo.org/badge/261332899.svg
:target: https://zenodo.org/badge/latestdoi/261332899
:alt: DOI 10.5281/zenodo.3940699
.. |CI Status| image:: https://github.com/liberfa/pyerfa/workflows/CI/badge.svg
:target: https://github.com/liberfa/pyerfa/actions
:alt: GitHub Actions CI Status
.. |Documentation Status| image:: https://img.shields.io/readthedocs/pyerfa/latest.svg?logo=read%20the%20docs&logoColor=white&label=Docs&version=stable
:target: https://pyerfa.readthedocs.io/en/stable/?badge=stable
:alt: Documentation Status
Raw data
{
"_id": null,
"home_page": "https://github.com/liberfa/pyerfa",
"name": "pyerfa",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "astronomy, astrophysics, cosmology, space, science, coordinate",
"author": "The PyERFA Developers",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/8c/dc/3cf99fccf9ad09999a0d03643e193f0f82b5cdbdb4e930a5017cb48034d5/pyerfa-2.0.1.3.tar.gz",
"platform": null,
"description": "======\nPyERFA\n======\n\n|PyPI Status| |Zenodo| |CI Status| |Documentation Status|\n\nPyERFA is the Python_ wrapper for the ERFA_ library (Essential Routines for\nFundamental Astronomy), a C library containing key algorithms for astronomy,\nwhich is based on the SOFA library published by the International Astronomical\nUnion (IAU). All C routines are wrapped as Numpy_ `universal functions\n<https://numpy.org/devdocs/reference/ufuncs.html>`_, so that they can be\ncalled with scalar or array inputs.\n\nThe project is a split of ``astropy._erfa`` module, developed in the\ncontext of Astropy_ project, into a standalone package. It contains\nthe ERFA_ C source code as a git submodule. The wrapping is done\nwith help of the Jinja2_ template engine.\n\nIf you use this package in your research, please cita it via DOI\n`10.5281/zenodo.3940699 <https://doi.org/10.5281/zenodo.3940699>`_.\n\n.. Installation\n\nInstallation instructions\n-------------------------\n\nThe package can be installed from the package directory using a simple::\n\n $ pip install .\n\nand similarly a wheel_ can be created with::\n\n $ pip wheel .\n\n.. note:: If you already have the C library ``liberfa`` on your\n system, you can use that by setting environment variable\n ``PYERFA_USE_SYSTEM_LIBERFA=1``.\n\n\n.. _wheel: https://github.com/pypa/wheel\n\nThe package can be obtained from PyPI_ or directly from the git repository::\n\n $ git clone --recursive https://github.com/liberfa/pyerfa/\n\nThe package also has nightly wheel that can be obtained as follows::\n\n $ pip install --upgrade --index-url https://pypi.anaconda.org/liberfa/simple pyerfa --pre\n\nTesting\n-------\n\nFor testing, one can install the packages together with its testing\ndependencies and then test it with::\n\n $ pip install .[test]\n $ pytest\n\nAlternatively, one can use ``tox``, which will set up a separate testing\nenvironment for you, with::\n\n $ tox -e test\n\n\nUsage\n-----\n\nThe package can be imported as ``erfa`` which has all ERFA_ ufuncs wrapped with\npython code that tallies errors and warnings. Also exposed are the constants\ndefined by ERFA_ in `erfam.h\n<https://github.com/liberfa/erfa/blob/master/src/erfam.h>`_, as well\nas `numpy.dtype` corresponding to structures used by ERFA_. Examples::\n\n >>> import erfa\n >>> erfa.jd2cal(2460000., [0, 1, 2, 3])\n (array([2023, 2023, 2023, 2023], dtype=int32),\n array([2, 2, 2, 2], dtype=int32),\n array([24, 25, 26, 27], dtype=int32),\n array([0.5, 0.5, 0.5, 0.5]))\n >>> erfa.plan94(2460000., [0, 1, 2, 3], 1)\n array([([ 0.09083713, -0.39041392, -0.21797389], [0.02192341, 0.00705449, 0.00149618]),\n ([ 0.11260694, -0.38275202, -0.21613731], [0.02160375, 0.00826891, 0.00217806]),\n ([ 0.13401992, -0.37387798, -0.21361622], [0.0212094 , 0.00947838, 0.00286503]),\n ([ 0.15500031, -0.36379788, -0.21040601], [0.02073822, 0.01068061, 0.0035561 ])],\n dtype={'names': ['p', 'v'], 'formats': [('<f8', (3,)), ('<f8', (3,))], 'offsets': [0, 24], 'itemsize': 48, 'aligned': True})\n >>> erfa.dt_pv\n dtype([('p', '<f8', (3,)), ('v', '<f8', (3,))], align=True)\n >>> erfa.dt_eraLDBODY\n dtype([('bm', '<f8'), ('dl', '<f8'), ('pv', [('p', '<f8', (3,)), ('v', '<f8', (3,))])], align=True)\n >>> erfa.DAYSEC\n 86400.0\n\nIt is also possible to use the ufuncs directly, though then one has to\ndeal with the warning and error states explicitly. For instance, compare::\n\n >>> erfa.jd2cal(-600000., [0, 1, 2, 3])\n Traceback (most recent call last):\n ...\n ErfaError: ERFA function \"jd2cal\" yielded 4 of \"unacceptable date (Note 1)\"\n >>> erfa.ufunc.jd2cal(-600000., [0, 1, 2, 3])\n (array([-1, -1, -1, -1], dtype=int32),\n ...,\n array([-1, -1, -1, -1], dtype=int32))\n\n\nLicense\n-------\n\nPyERFA is licensed under a 3-clause BSD style license - see the\n`LICENSE.rst <LICENSE.rst>`_ file.\n\n\n.. References\n.. _Python: https://www.python.org/\n.. _ERFA: https://github.com/liberfa/erfa\n.. _Numpy: https://numpy.org/\n.. _Astropy: https://www.astropy.org\n.. _PyPI: https://pypi.org/project/pyerfa/\n.. _Jinja2: https://palletsprojects.com/p/jinja/\n.. |PyPI Status| image:: https://img.shields.io/pypi/v/pyerfa.svg\n :target: https://pypi.python.org/pypi/pyerfa\n :alt: PyPI Status\n.. |Zenodo| image:: https://zenodo.org/badge/261332899.svg\n :target: https://zenodo.org/badge/latestdoi/261332899\n :alt: DOI 10.5281/zenodo.3940699\n.. |CI Status| image:: https://github.com/liberfa/pyerfa/workflows/CI/badge.svg\n :target: https://github.com/liberfa/pyerfa/actions\n :alt: GitHub Actions CI Status\n.. |Documentation Status| image:: https://img.shields.io/readthedocs/pyerfa/latest.svg?logo=read%20the%20docs&logoColor=white&label=Docs&version=stable\n :target: https://pyerfa.readthedocs.io/en/stable/?badge=stable\n :alt: Documentation Status\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": "Python bindings for ERFA",
"version": "2.0.1.3",
"project_urls": {
"Homepage": "https://github.com/liberfa/pyerfa"
},
"split_keywords": [
"astronomy",
" astrophysics",
" cosmology",
" space",
" science",
" coordinate"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c808439c592d1188d269e68d1eb179be0e97b4ace4ad83b426ec59f944c05051",
"md5": "df143108a11586c7bb81bc714bbf73f6",
"sha256": "fc554151de564b567e391b7c9c3b545efac63674ab1954382d38f886254c01fb"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-cp39-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "df143108a11586c7bb81bc714bbf73f6",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 341772,
"upload_time": "2024-04-05T09:43:31",
"upload_time_iso_8601": "2024-04-05T09:43:31.141898Z",
"url": "https://files.pythonhosted.org/packages/c8/08/439c592d1188d269e68d1eb179be0e97b4ace4ad83b426ec59f944c05051/pyerfa-2.0.1.3-cp39-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "55cc77a0b9b8ef6f5422ac3a77de6dc298fe356b8c2b30a4fdba705c83e9adf5",
"md5": "7619b0c56885780c18b9db8e39965022",
"sha256": "359327c88f1e5dea3974b284dabef141824ac54753c5cab6b3f23acd9d52071b"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-cp39-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "7619b0c56885780c18b9db8e39965022",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 329327,
"upload_time": "2024-04-05T09:43:32",
"upload_time_iso_8601": "2024-04-05T09:43:32.540966Z",
"url": "https://files.pythonhosted.org/packages/55/cc/77a0b9b8ef6f5422ac3a77de6dc298fe356b8c2b30a4fdba705c83e9adf5/pyerfa-2.0.1.3-cp39-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "acdbd44fc7d728fbdf1d8a273b0eedc9acfc3d489948d0b2373c043c0d224380",
"md5": "80f9985bab39d0ce1954b8ca2d73abd7",
"sha256": "58c3a971a9fba8663b49dcc54c3419e837837140d81cc6be9f1c21fc56322f7b"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "80f9985bab39d0ce1954b8ca2d73abd7",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 692788,
"upload_time": "2024-04-05T09:43:34",
"upload_time_iso_8601": "2024-04-05T09:43:34.492004Z",
"url": "https://files.pythonhosted.org/packages/ac/db/d44fc7d728fbdf1d8a273b0eedc9acfc3d489948d0b2373c043c0d224380/pyerfa-2.0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "bdc7e3ffaf4f0e92d2ef7e0212899926cda377bb2cdfaf948029d898e85264c9",
"md5": "859d728450eddee433df85f03dbe6eec",
"sha256": "f4472d2a2622e47d220a9436c953a487d8c051157f7b44b1f71964de17ee443b"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "859d728450eddee433df85f03dbe6eec",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 738682,
"upload_time": "2024-04-05T09:43:35",
"upload_time_iso_8601": "2024-04-05T09:43:35.979306Z",
"url": "https://files.pythonhosted.org/packages/bd/c7/e3ffaf4f0e92d2ef7e0212899926cda377bb2cdfaf948029d898e85264c9/pyerfa-2.0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "11de89a41d77cf43ea9ef6a53baf314589b36a187469f1c233a626bd7528f260",
"md5": "5620c839e6d951d0423004bef25b7a4c",
"sha256": "b0f621f26b5f31b3fb6bb113fb48a428e56eb00c7d729a242672dc4f886c8d18"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-cp39-abi3-musllinux_1_1_x86_64.whl",
"has_sig": false,
"md5_digest": "5620c839e6d951d0423004bef25b7a4c",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 749191,
"upload_time": "2024-04-05T09:43:37",
"upload_time_iso_8601": "2024-04-05T09:43:37.829395Z",
"url": "https://files.pythonhosted.org/packages/11/de/89a41d77cf43ea9ef6a53baf314589b36a187469f1c233a626bd7528f260/pyerfa-2.0.1.3-cp39-abi3-musllinux_1_1_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "02939deeec714b48590ad1e803bb4a6a848609bc351a7413d7edc82537c4a829",
"md5": "09e5a59a28b2a3e9239784c777e85f6d",
"sha256": "b7a85ac9d807ea71550e831e873916ed3a44300fe6e20e0b3ca0f2784c0b2757"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-cp39-abi3-win32.whl",
"has_sig": false,
"md5_digest": "09e5a59a28b2a3e9239784c777e85f6d",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 339977,
"upload_time": "2024-04-05T09:43:39",
"upload_time_iso_8601": "2024-04-05T09:43:39.052318Z",
"url": "https://files.pythonhosted.org/packages/02/93/9deeec714b48590ad1e803bb4a6a848609bc351a7413d7edc82537c4a829/pyerfa-2.0.1.3-cp39-abi3-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1bba1fe85bfc145a82a0d8eaf8bc8109348a7a4fab1ec07741bdf6feb9718104",
"md5": "1be319c4bb42dbc367195cb0897d1f01",
"sha256": "60c0a73db5a42927fbafd12c623699c2c1b1233b6e1be1963970a5ad47e463c4"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-cp39-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "1be319c4bb42dbc367195cb0897d1f01",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 347107,
"upload_time": "2024-04-05T09:43:40",
"upload_time_iso_8601": "2024-04-05T09:43:40.725486Z",
"url": "https://files.pythonhosted.org/packages/1b/ba/1fe85bfc145a82a0d8eaf8bc8109348a7a4fab1ec07741bdf6feb9718104/pyerfa-2.0.1.3-cp39-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b311b78cbd54011936b698f0f96362d11a2976b2735b4aeed02020aaaf00616",
"md5": "d68c1c75e1ec3b3f977c34304becee32",
"sha256": "779caac3737da68f4db43b0dec026ac479719e02d25b8c4e7b0756abadbcd416"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "d68c1c75e1ec3b3f977c34304becee32",
"packagetype": "bdist_wheel",
"python_version": "pp39",
"requires_python": ">=3.9",
"size": 321229,
"upload_time": "2024-04-05T09:43:41",
"upload_time_iso_8601": "2024-04-05T09:43:41.919472Z",
"url": "https://files.pythonhosted.org/packages/9b/31/1b78cbd54011936b698f0f96362d11a2976b2735b4aeed02020aaaf00616/pyerfa-2.0.1.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fe81899f3f3b2e78147a86b77c17a4aa9701c8a797dd01a707fb03707a875116",
"md5": "491fc603d62604f24f99f209dc75ab07",
"sha256": "053ed25fdb7deb9d3d7cebecbb3d3dfbeea37c8c0011cc0616293e03d2c308eb"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "491fc603d62604f24f99f209dc75ab07",
"packagetype": "bdist_wheel",
"python_version": "pp39",
"requires_python": ">=3.9",
"size": 343901,
"upload_time": "2024-04-05T09:43:43",
"upload_time_iso_8601": "2024-04-05T09:43:43.051459Z",
"url": "https://files.pythonhosted.org/packages/fe/81/899f3f3b2e78147a86b77c17a4aa9701c8a797dd01a707fb03707a875116/pyerfa-2.0.1.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "416aa291c3de89626e993cc263f76e790f5a74743c4d963dd6028221423296e7",
"md5": "3c08e53513c9e0312b38db9eee894b95",
"sha256": "ef6c5d2206f134bd95329a0c17d46c449c9b68e9828e97e9bc43b29cd8789f5d"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3-pp39-pypy39_pp73-win_amd64.whl",
"has_sig": false,
"md5_digest": "3c08e53513c9e0312b38db9eee894b95",
"packagetype": "bdist_wheel",
"python_version": "pp39",
"requires_python": ">=3.9",
"size": 347221,
"upload_time": "2024-04-05T09:43:44",
"upload_time_iso_8601": "2024-04-05T09:43:44.475400Z",
"url": "https://files.pythonhosted.org/packages/41/6a/a291c3de89626e993cc263f76e790f5a74743c4d963dd6028221423296e7/pyerfa-2.0.1.3-pp39-pypy39_pp73-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8cdc3cf99fccf9ad09999a0d03643e193f0f82b5cdbdb4e930a5017cb48034d5",
"md5": "a31f31d4d2d2fc76af3e6e41b2dc6991",
"sha256": "ba5eb932341beaf222726de8dce2b1645c97b48c321efb2af8a535a7eb90ebfa"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "a31f31d4d2d2fc76af3e6e41b2dc6991",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 816718,
"upload_time": "2024-04-05T09:43:45",
"upload_time_iso_8601": "2024-04-05T09:43:45.805788Z",
"url": "https://files.pythonhosted.org/packages/8c/dc/3cf99fccf9ad09999a0d03643e193f0f82b5cdbdb4e930a5017cb48034d5/pyerfa-2.0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-05 09:43:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "liberfa",
"github_project": "pyerfa",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "pyerfa"
}