Python bindings for ERFA
Project description
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, 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.
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 .
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, 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', '<f8', (2, 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 file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file pyerfa-1.7.0.tar.gz
.
File metadata
- Download URL: pyerfa-1.7.0.tar.gz
- Upload date:
- Size: 490.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58cd5fbc27e31211102568f952fdbac410b184563be4da57743cbe5e5ccebe47 |
|
MD5 | a95e284b1067bedd6971d5375225a44e |
|
BLAKE2b-256 | 865df4cc5804744f7ab14b54059ebd44969e4f6af9eb6909f56d112bf9f0730b |
File details
Details for the file pyerfa-1.7.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 322.9 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3250db04e7f544dcb5a14b697344b647046ff080876876ba89c541a33eb534e1 |
|
MD5 | 437277da92bff56c090970889e86a3d8 |
|
BLAKE2b-256 | 9460f8d305e28d44ac336466013f7ad91c268c9ce0203380411851c70e0a0a51 |
File details
Details for the file pyerfa-1.7.0-cp38-cp38-win32.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp38-cp38-win32.whl
- Upload date:
- Size: 316.6 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8c30d85fdfaf034afa3c70165b88e3c464dd35e8fcfbb0708de49c1ef4122ce |
|
MD5 | 95cc570af4911384d581599a5e0a7dba |
|
BLAKE2b-256 | f5c833b1918ecb9d6b82086fe229dd5197e796e27ea37d96e765489948574645 |
File details
Details for the file pyerfa-1.7.0-cp38-cp38-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp38-cp38-manylinux2010_x86_64.whl
- Upload date:
- Size: 724.3 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93d5e14a19d0a8eb9e58618d6afeeed8cef85d7c16a1da82e5282cf4d7bdfdf6 |
|
MD5 | 4e2b22972293997705101b872c826d0b |
|
BLAKE2b-256 | d86ef04472024d5537c27a042397f7977fb80a70e545ebdb23fa7eb181507ab2 |
File details
Details for the file pyerfa-1.7.0-cp38-cp38-manylinux2010_i686.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp38-cp38-manylinux2010_i686.whl
- Upload date:
- Size: 657.8 kB
- Tags: CPython 3.8, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c4dbf592bdec9f6c4093060dd4978c193d6095802ac88a30b4befe7897d9959 |
|
MD5 | a5f2a42b69f44d469e7c484a3d58d7c4 |
|
BLAKE2b-256 | 4850981615536b1ba8dd49581ff1c376483f9030fe78eee7543f5baf4dd6cfc8 |
File details
Details for the file pyerfa-1.7.0-cp38-cp38-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp38-cp38-manylinux1_x86_64.whl
- Upload date:
- Size: 724.3 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03437c87196c3ca16527203b9d24e9df86aabea1e3f92c91d46a5577d6a6ea06 |
|
MD5 | c7cb2e468003e5c6c524307b0b68afda |
|
BLAKE2b-256 | e801b41d7eea260e6e416b6ee42c61f8a70f627706ef4660f2ee4bde8994da1f |
File details
Details for the file pyerfa-1.7.0-cp38-cp38-manylinux1_i686.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp38-cp38-manylinux1_i686.whl
- Upload date:
- Size: 657.8 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 670119918f2843d9d30adafc59ae2d9e7f32e61fc5f4bc26e11c278abe6ca4b5 |
|
MD5 | f08b4152fbe31b7f8133231230bcc5b9 |
|
BLAKE2b-256 | edaa99e61619a9866e69431d9d670cb04a284b7ec4b98f84d386fdbf00270f57 |
File details
Details for the file pyerfa-1.7.0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 302.0 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 222808d17c7e53f4985e8c4e03a21483643bed969cb16b329715f33d2f3099b6 |
|
MD5 | 8ef19fcb2c4b5bc95236e537609658f5 |
|
BLAKE2b-256 | 356ccc5b11dbc68edc2fd6675e42381491aa0bbd2a3ced7a3f4e992d2ee7a384 |
File details
Details for the file pyerfa-1.7.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 321.9 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d46608a03c952ee5e98413e65a21729bdd9acbb2c80939b2fb3d977c376e4de |
|
MD5 | c2a31cd64c78149134ad25a8e4f3ed38 |
|
BLAKE2b-256 | b28ab2e4982626095347f41b7fd84148028f50298976705c0cffd209b5126089 |
File details
Details for the file pyerfa-1.7.0-cp37-cp37m-win32.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp37-cp37m-win32.whl
- Upload date:
- Size: 316.5 kB
- Tags: CPython 3.7m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 241f0e49e493f89421dc981ab1cc6f6c96c0f6bdb71b0c50c2cf31f382b5dad2 |
|
MD5 | c632cf25c7fdd637b07e927a360bad9b |
|
BLAKE2b-256 | 25f41b2e86fbdf52a88e158c5bed257ee34e2a6094d976e2d7208b110ab620f0 |
File details
Details for the file pyerfa-1.7.0-cp37-cp37m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp37-cp37m-manylinux2010_x86_64.whl
- Upload date:
- Size: 694.8 kB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4ab5d75257ab72b9675e12947d82228bbda56a1f4f19130f6115b10eeb447fa |
|
MD5 | 2aa5274f12246f186f4cb0ac794e41ec |
|
BLAKE2b-256 | 9873f25d282552812ea6611d084152104d2dc5801c9c3c42aa864fd9f56bfdf9 |
File details
Details for the file pyerfa-1.7.0-cp37-cp37m-manylinux2010_i686.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp37-cp37m-manylinux2010_i686.whl
- Upload date:
- Size: 634.1 kB
- Tags: CPython 3.7m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6cf9f93467c9ec2d2cc5d213a916bfe4f3701326f2c1f9004ddc63eb90bb9144 |
|
MD5 | 8f8777f2b9d050c3ab46725913f6975f |
|
BLAKE2b-256 | b44a026e5e504a91b1e29482948aca135d2548fb7356930255aa17599f39dbc2 |
File details
Details for the file pyerfa-1.7.0-cp37-cp37m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp37-cp37m-manylinux1_x86_64.whl
- Upload date:
- Size: 694.8 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7171898dd14475c837cf4a7bc0a5292ff8accc2e1e70a379dae448d0d04286d5 |
|
MD5 | 9a88eab57e8ed4bc8b79a90b91b473f0 |
|
BLAKE2b-256 | acdd18899db84758a429d48f031ace03b842e55ad597f7d70e8f06c067c66bb3 |
File details
Details for the file pyerfa-1.7.0-cp37-cp37m-manylinux1_i686.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp37-cp37m-manylinux1_i686.whl
- Upload date:
- Size: 634.1 kB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a09ecced65e00c6669e2beac8401423ef849fd0c0ef2e3d751da0737a8505a8d |
|
MD5 | 246c4c83e70d99ec4df1aa539439ea66 |
|
BLAKE2b-256 | 985dc4b36cf4e3bc76c4497adae0c2552b77b75cf92a680a4d835f9464c70786 |
File details
Details for the file pyerfa-1.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 301.2 kB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22db74bd4b1ad1fac688541a6e2318ae09b44bd8efa6bebcda366fc4fcd850e6 |
|
MD5 | baf3087ccf1238e018973dfc4bd732aa |
|
BLAKE2b-256 | 74cd1e35c0d0e82e6770b139ffd00edf3c51950ce58df3871088b07e2456eed5 |
File details
Details for the file pyerfa-1.7.0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 321.9 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc6d888e6da6c7a4249787f2fd7edd70d89a32d67c98e860612da67b74c83f98 |
|
MD5 | 6b5395ac31e92303297aa4ad5706951e |
|
BLAKE2b-256 | b220c11d1a647208a2bd0dcefd1e9291378be6ff817bb4162bca4ebb943b3344 |
File details
Details for the file pyerfa-1.7.0-cp36-cp36m-win32.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp36-cp36m-win32.whl
- Upload date:
- Size: 316.5 kB
- Tags: CPython 3.6m, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 993a8783b4eadfc9364120a60bd8c063c2ac853a116ebc5f063b46f43242dc8b |
|
MD5 | 691c1277d624ecd34c5876bd465e9e8f |
|
BLAKE2b-256 | 99cd376942625a9e0fd575ce1ddd7dddac14c4d6ca28d1d229f32bbe32d9a363 |
File details
Details for the file pyerfa-1.7.0-cp36-cp36m-manylinux2010_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp36-cp36m-manylinux2010_x86_64.whl
- Upload date:
- Size: 694.0 kB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 215a004da55768853152b997da7f4d283f6af94bac6248ff2e635ad1b14e8446 |
|
MD5 | 881276567be8c9c14618406a3f65b3dc |
|
BLAKE2b-256 | 0449551dacb0f16c796a9d6a489cf2985329006b5dc96a8b24a8d0f250dbeb67 |
File details
Details for the file pyerfa-1.7.0-cp36-cp36m-manylinux2010_i686.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp36-cp36m-manylinux2010_i686.whl
- Upload date:
- Size: 633.1 kB
- Tags: CPython 3.6m, manylinux: glibc 2.12+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66f83e8766bb5d7e44bc73f7e497ac6df47cd1d3b89db2021910d7d9af3c6b06 |
|
MD5 | 8b41a184ac9f0abe1fecddf2209c6eac |
|
BLAKE2b-256 | b088fd4d4da3a8e7d1034eac599e28641fd9336a9342beceaade1b5c8c86e4c2 |
File details
Details for the file pyerfa-1.7.0-cp36-cp36m-manylinux1_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp36-cp36m-manylinux1_x86_64.whl
- Upload date:
- Size: 694.0 kB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c644ad3ab5bcd7d51ff4cff4b90f3a6c10ad9443b71b0fd33db7a59453507d99 |
|
MD5 | 99827a4ba8995fc5409b16b9822684d4 |
|
BLAKE2b-256 | 237f006249ca6b69fd335d8258e084090a0dd2dc7cb4c82a1ed73c9472eb82d5 |
File details
Details for the file pyerfa-1.7.0-cp36-cp36m-manylinux1_i686.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp36-cp36m-manylinux1_i686.whl
- Upload date:
- Size: 633.1 kB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc719188101eff0f95afd711b1e26e62fe0a7b8790eb85c822638bf804ea5e10 |
|
MD5 | aebcf3fb53d1bdcd43291d6c9b3cfb03 |
|
BLAKE2b-256 | b75702a654525d9ccc60601a1fca2a11df7cffb67aff6308822c6dde6451cb1c |
File details
Details for the file pyerfa-1.7.0-cp36-cp36m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyerfa-1.7.0-cp36-cp36m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 301.2 kB
- Tags: CPython 3.6m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56f4ca4898b3ac9e954b6fe5cadf13b99aff6e9ad0656c3430f5be26b94e6c33 |
|
MD5 | d9e6080746ffafad8d7ab22152d940cd |
|
BLAKE2b-256 | 9bf76eafee6e8028a692a5bf303d3f32f2e3ea289d7c6cf50079d34ad874a7dd |