A python package for querying NASA's JPL HORIZONS API
Project description
Author: Behrouz Safari
License: MIT
hypatie
A python package for querying NASA's JPL HORIZONS API
Installation
You can install the latest version of hypatie from PyPI:
pip install hypatie
The only requirement is numpy.
How to use
Let's get the positions of the sun between two times:
import hypatie as hp
t1 = '2021-03-20 08:00:00'
t2 = '2021-03-20 10:00:00'
If you want the apparent RA and DEC of the Sun with respect to Earth (geocentric):
obs = hp.Observer('sun', t1, t2, step=5)
Now you can access the time intervals with .time attribute:
print(obs.time)
[datetime.datetime(2021, 3, 20, 8, 0)
datetime.datetime(2021, 3, 20, 8, 24)
datetime.datetime(2021, 3, 20, 8, 48)
datetime.datetime(2021, 3, 20, 9, 12)
datetime.datetime(2021, 3, 20, 9, 36)
datetime.datetime(2021, 3, 20, 10, 0)]
To acces the position you can use obs.pos, obs.ra, or obs.dec:
print(obs.pos)
[[ 3.59938235e+02 -2.66803120e-02]
[ 3.59953431e+02 -2.00920520e-02]
[ 3.59968627e+02 -1.35038600e-02]
[ 3.59983823e+02 -6.91573600e-03]
[ 3.59999018e+02 -3.27680000e-04]
[ 1.42132560e-02 6.26030600e-03]]
The first column in the above array is RA and the second column is DEC.
You can request the cartesian positions (x,y,z) of a target with Vector class.
vec = hp.Vector('sun', t1, t2, step=5)
As with the Observer class, there are two attributes .time and .pos for Vector class. Note the when creating a Vector class, you have .x, .y and .z attributes instead of .ra and .des.
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 Distribution
File details
Details for the file hypatie-0.0.5.tar.gz
.
File metadata
- Download URL: hypatie-0.0.5.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36ad1eeb0d3f937e29c7c3ff8a0916c4787b351cbad9178dbc40ac7d37cf7154 |
|
MD5 | 1fe2884cca44f34434f036e074377788 |
|
BLAKE2b-256 | 638e3d571d4f901c5c46f032693312b18f6969b835f13091dd0442e2029b7ac8 |
File details
Details for the file hypatie-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: hypatie-0.0.5-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05f4179be2ba0bbee71ba46b5d59fbcd022ba6783c09e1e182529f5d216f370b |
|
MD5 | a2ca99a0c5ead0512671c8ef6646e2d1 |
|
BLAKE2b-256 | f4ade786f4c281f0132ebcb8780a915eaf2ac0a57707616cd20c2289d442fc99 |