https://github.com/kecnry/astropy-units-iau2015
light wrapper around astropy.units that changes constants and units to match those in the IAU 2015 resolution
https://github.com/kecnry/astropy-units-iau2015
astronomy astropy units
Last synced: over 1 year ago
JSON representation
light wrapper around astropy.units that changes constants and units to match those in the IAU 2015 resolution
- Host: GitHub
- URL: https://github.com/kecnry/astropy-units-iau2015
- Owner: kecnry
- License: gpl-3.0
- Created: 2017-06-17T20:06:39.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-12-11T18:40:34.000Z (over 4 years ago)
- Last Synced: 2025-01-12T13:50:47.902Z (over 1 year ago)
- Topics: astronomy, astropy, units
- Language: Python
- Size: 28.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# astropy-units-IAU2015
light wrapper around astropy.units that changes constants and units to match those in the IAU 2015 resolution.
As of astropy 2.0+, the IAU 2015 constants are adopted by default. This module simply allows an astropy-version-independent way of ensuring that you are dealing with IAU 2015 constants.
See the following discussions on the [astropy](https://www.github.com/astropy/astropy) project:
* [Implement updated IAU B3 2015 constants if approved](https://github.com/astropy/astropy/issues/4026)
* [Organize constants into version modules](https://github.com/astropy/astropy/pull/6083)
* [Implement updated IAU B3 2015 constants](https://github.com/astropy/astropy/pull/4397)
* [astropy updated constants](https://github.com/astropy/astropy/pull/4956)
If you have astropy 2.0+ installed, this does essentially nothing (except introducing a solTeff unit and T_sun constant). If, however, you have a version of astropy older than 2.0, it will hack the internal units to match IAU 2015 conventions.
This is currently only tested with python 2.7 and astropy 1.3.1.
## Dependencies
* [astropy](https://www.github.com/astropy/astropy)
## Installation
Installation is done using the standard python setup.py commands.
To install globally:
```
python setup.py build
sudo python setup.py install
```
Or to install locally:
```
python setup.py build
python setup.py install --user
```
## Basic Usage
```
from unitsiau2015 import u, c
print c.G.value
```
Note that once unitsiau2015 is imported, the values within the astropy package will change as well (for that python session). See [simple.py example](https://github.com/kecnry/astropy-units-IAU2015/blob/master/examples/simple.py) to see this in action.
## Contributing
Contributions are welcome! Feel free to file an issue or fork and create a pull-request.