======
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": null,
"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/71/39/63cc8291b0cf324ae710df41527faf7d331bce573899199d926b3e492260/pyerfa-2.0.1.5.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.5",
"project_urls": {
"Homepage": "https://github.com/liberfa/pyerfa"
},
"split_keywords": [
"astronomy",
" astrophysics",
" cosmology",
" space",
" science",
" coordinate"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7dd93448a57cb5bd19950de6d6ab08bd8fbb3df60baa71726de91d73d76c481b",
"md5": "f32c2a62cd67169b73061cad15d018d5",
"sha256": "b282d7c60c4c47cf629c484c17ac504fcb04abd7b3f4dfcf53ee042afc3a5944"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-cp39-abi3-macosx_10_9_x86_64.whl",
"has_sig": false,
"md5_digest": "f32c2a62cd67169b73061cad15d018d5",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 341818,
"upload_time": "2024-11-11T15:22:16",
"upload_time_iso_8601": "2024-11-11T15:22:16.467138Z",
"url": "https://files.pythonhosted.org/packages/7d/d9/3448a57cb5bd19950de6d6ab08bd8fbb3df60baa71726de91d73d76c481b/pyerfa-2.0.1.5-cp39-abi3-macosx_10_9_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "114a31a363370478b63c6289a34743f2ba2d3ae1bd8223e004d18ab28fb92385",
"md5": "f09efe991b5afd7fadec635eff31f851",
"sha256": "be1aeb70390dd03a34faf96749d5cabc58437410b4aab7213c512323932427df"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-cp39-abi3-macosx_11_0_arm64.whl",
"has_sig": false,
"md5_digest": "f09efe991b5afd7fadec635eff31f851",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 329370,
"upload_time": "2024-11-11T15:22:17",
"upload_time_iso_8601": "2024-11-11T15:22:17.829032Z",
"url": "https://files.pythonhosted.org/packages/11/4a/31a363370478b63c6289a34743f2ba2d3ae1bd8223e004d18ab28fb92385/pyerfa-2.0.1.5-cp39-abi3-macosx_11_0_arm64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cb96b6210fc624123c8ae13e1eecb68fb75e3f3adff216d95eee1c7b05843e3e",
"md5": "6fd2dff6167a8824685a4d328d6dce4c",
"sha256": "b0603e8e1b839327d586c8a627cdc634b795e18b007d84f0cda5500a0908254e"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"has_sig": false,
"md5_digest": "6fd2dff6167a8824685a4d328d6dce4c",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 692794,
"upload_time": "2024-11-11T15:22:19",
"upload_time_iso_8601": "2024-11-11T15:22:19.429496Z",
"url": "https://files.pythonhosted.org/packages/cb/96/b6210fc624123c8ae13e1eecb68fb75e3f3adff216d95eee1c7b05843e3e/pyerfa-2.0.1.5-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e5e0050018d855d26d3c0b4a7d1b2ed692be758ce276d8289e2a2b44ba1014a5",
"md5": "9165a1d6f1538d2a3c2ecb2045a41665",
"sha256": "0e43c7194e3242083f2350b46c09fd4bf8ba1bcc0ebd1460b98fc47fe2389906"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "9165a1d6f1538d2a3c2ecb2045a41665",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 738711,
"upload_time": "2024-11-11T15:22:20",
"upload_time_iso_8601": "2024-11-11T15:22:20.661957Z",
"url": "https://files.pythonhosted.org/packages/e5/e0/050018d855d26d3c0b4a7d1b2ed692be758ce276d8289e2a2b44ba1014a5/pyerfa-2.0.1.5-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b9f5ff91ee77308793ae32fa1e1de95e9edd4551456dd888b4e87c5938657ca5",
"md5": "fee2cfe552fb0e3292f4b9015c9ca551",
"sha256": "07b80cd70701f5d066b1ac8cce406682cfcd667a1186ec7d7ade597239a6021d"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-cp39-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "fee2cfe552fb0e3292f4b9015c9ca551",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 722966,
"upload_time": "2024-11-11T15:22:21",
"upload_time_iso_8601": "2024-11-11T15:22:21.905568Z",
"url": "https://files.pythonhosted.org/packages/b9/f5/ff91ee77308793ae32fa1e1de95e9edd4551456dd888b4e87c5938657ca5/pyerfa-2.0.1.5-cp39-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2c56b22b35c8551d2228ff8d445e63787112927ca13f6dc9e2c04f69d742c95b",
"md5": "18c34b4edc1096948650aabea2ad1ca1",
"sha256": "d30b9b0df588ed5467e529d851ea324a67239096dd44703125072fd11b351ea2"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-cp39-abi3-win32.whl",
"has_sig": false,
"md5_digest": "18c34b4edc1096948650aabea2ad1ca1",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 339955,
"upload_time": "2024-11-11T15:22:23",
"upload_time_iso_8601": "2024-11-11T15:22:23.087856Z",
"url": "https://files.pythonhosted.org/packages/2c/56/b22b35c8551d2228ff8d445e63787112927ca13f6dc9e2c04f69d742c95b/pyerfa-2.0.1.5-cp39-abi3-win32.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b41197233cf23ad5411ac6f13b1d6ee3888f90ace4f974d9bf9db887aa428912",
"md5": "272ccd5c0eea6d6b9332cc61d45601f2",
"sha256": "66292d437dcf75925b694977aa06eb697126e7b86553e620371ed3e48b5e0ad0"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-cp39-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "272ccd5c0eea6d6b9332cc61d45601f2",
"packagetype": "bdist_wheel",
"python_version": "cp39",
"requires_python": ">=3.9",
"size": 349410,
"upload_time": "2024-11-11T15:22:24",
"upload_time_iso_8601": "2024-11-11T15:22:24.817471Z",
"url": "https://files.pythonhosted.org/packages/b4/11/97233cf23ad5411ac6f13b1d6ee3888f90ace4f974d9bf9db887aa428912/pyerfa-2.0.1.5-cp39-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "983202fe8bf940d8ce2cc482c48056ccc6b64628f622a56fa773810199637fa8",
"md5": "4720bd985d010f46344515e5d72b3b87",
"sha256": "4991dee680ff36c87911d8faa4c7d1aa6278ad9b5e0d16158cf22fa7d74ba25c"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-pp39-pypy39_pp73-macosx_10_15_x86_64.whl",
"has_sig": false,
"md5_digest": "4720bd985d010f46344515e5d72b3b87",
"packagetype": "bdist_wheel",
"python_version": "pp39",
"requires_python": ">=3.9",
"size": 321082,
"upload_time": "2024-11-11T15:22:26",
"upload_time_iso_8601": "2024-11-11T15:22:26.773772Z",
"url": "https://files.pythonhosted.org/packages/98/32/02fe8bf940d8ce2cc482c48056ccc6b64628f622a56fa773810199637fa8/pyerfa-2.0.1.5-pp39-pypy39_pp73-macosx_10_15_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "119eee706b5fc5b5a72e31283f66e68730abf802469bbc373ff0d05e68d7e2df",
"md5": "f85040e722cc0462f4382a16b5c6806b",
"sha256": "690e258294202c86f479e78e80fd235cd27bd717f7f60062fccc3dbd6ef0b1a9"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "f85040e722cc0462f4382a16b5c6806b",
"packagetype": "bdist_wheel",
"python_version": "pp39",
"requires_python": ">=3.9",
"size": 343943,
"upload_time": "2024-11-11T15:22:27",
"upload_time_iso_8601": "2024-11-11T15:22:27.996130Z",
"url": "https://files.pythonhosted.org/packages/11/9e/ee706b5fc5b5a72e31283f66e68730abf802469bbc373ff0d05e68d7e2df/pyerfa-2.0.1.5-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5189278ac94f86b6850f0ccee99839103375b665ccf99cb5085515deed4ab2d6",
"md5": "e053de89211f235b1f31082d5dca5793",
"sha256": "171ce9676a448a7eb555f03aa19ad5c749dbced1ce4f9923e4d93443c4a9c612"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5-pp39-pypy39_pp73-win_amd64.whl",
"has_sig": false,
"md5_digest": "e053de89211f235b1f31082d5dca5793",
"packagetype": "bdist_wheel",
"python_version": "pp39",
"requires_python": ">=3.9",
"size": 349515,
"upload_time": "2024-11-11T15:22:29",
"upload_time_iso_8601": "2024-11-11T15:22:29.725753Z",
"url": "https://files.pythonhosted.org/packages/51/89/278ac94f86b6850f0ccee99839103375b665ccf99cb5085515deed4ab2d6/pyerfa-2.0.1.5-pp39-pypy39_pp73-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "713963cc8291b0cf324ae710df41527faf7d331bce573899199d926b3e492260",
"md5": "6cb13d45fb4e391b70e2456760a9add8",
"sha256": "17d6b24fe4846c65d5e7d8c362dcb08199dc63b30a236aedd73875cc83e1f6c0"
},
"downloads": -1,
"filename": "pyerfa-2.0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "6cb13d45fb4e391b70e2456760a9add8",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 818430,
"upload_time": "2024-11-11T15:22:30",
"upload_time_iso_8601": "2024-11-11T15:22:30.852125Z",
"url": "https://files.pythonhosted.org/packages/71/39/63cc8291b0cf324ae710df41527faf7d331bce573899199d926b3e492260/pyerfa-2.0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-11 15:22:30",
"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"
}