About
This library encodes all of the information provided in the handouts Coefficient Data and Ephemeris_Meeus from ASEN 6008 (CU Boudler). This library was created in Spring 2021 when the course was taught by Professor Kate Davis.
Installation
pip install asen_6008
API
This library provides 10 classes (the 8 planets, Pluto, and the Sun) and 2 constants, AU and Days_per_year.
The classes are all instances of the class Planet which has the following layout (note this is pseudocode)
class Planet:
L # deg
a # AU
e
i #deg
Omega # deg
Pi # deg
mu # km3/s2
r # km
Elements L, a, e, i, Omega, and Pi are of type OrbitalElement which has the following layout
class OrbitalElement:
a0
a1
a2
a3
Elements mu and r are simply floating point values.
To access any of the data for a planet would look something like this
import asen_6008
print(asen_6008.Mars.L)
print(asen_6008.Earth.e.a1)
print(asen_6008.Sun.mu)
The names of all the classes and constants provided are listed below
AU
Days_per_year
Sun
Mercury
Venus
Earth
Mars
Jupiter
Saturn
Uranus
Neptune
Pluto
Also, both the Planet and OrbitalElement class have overridden the __repr__ class attribute, so they can be printed directly, for example:
>>> import asen_6008
>>> print(asen_6008.Jupiter)
L (deg): 34.351484, 3034.9056746, -8.501e-05, 4e-09
a (AU): 5.202603191, 1.913e-07, 0, 0
e: 0.04849485, 0.000163244, -4.719e-07, -1.97e-09
i (deg): 1.30327, -0.0019872, 3.318e-05, 9.2e-08
Ω (deg): 100.464441, 0.1766828, 0.00090387, -7.032e-06
Π (deg): 14.331309, 0.2155525, 0.00072252, -4.59e-06
μ (km3/s2): 126686536.1
r (km): 71492
Usage
Because the professor requested that no equations be placed in the library, only constants, the user will have to supply their own equations for calculating the ephemeris information as a function of time. There are many ways to do this, but one way which leads to a fairly clean API is to wrap the classes provided in your own class, like this
import asen_6008
class MyPlanet():
def __init__(self, planet):
self.planet = planet
def e(self, t):
return self.planet.e.a0 + self.planet.e.a1 * t + self.planet.e.a2 * t**2 + self.planet.e.a3 * t**3
Earth = MyPlanet(asen_6008.Earth)
Mars = MyPlanet(asen_6008.Mars)
print(Mars.e(some_julian_date))
You'll want to put this class and the instance of it in a separate file that you then import into your main Python project.
This way you can access various properties of the planet with a simple interface that accepts a time value. But you can also reach in directly to the underlying class provided by the asen_6008 library, as follows:
print(Earth.planet.e) # Here Earth is the same instance that was defined above.
Metadata
Release files for asen-6008 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| asen_6008-2.0.0.tar.gz | 4.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| asen_6008-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.3 kB
Release files / asen_6008-2.0.0.tar.gz
| Download URL | asen_6008-2.0.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4997af85e00d734d1909774bd4d21705d44c32e91b6c014fb0f6d6b6a7a47cd
|
|
BLAKE2b-256 checksum How to use checksums |
e9d4c83716a6e455c591dad8c30f0793cdbaf72820a0630bbdf0339b6d59390a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Release files / asen_6008-2.0.0-py3-none-any.whl
| Download URL | asen_6008-2.0.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1b816d630004aca9d5ad08a73622e501094537a97d5ce2712255c7e6942ac6c
|
|
BLAKE2b-256 checksum How to use checksums |
fdc64c0cfe12e65ca235f59ce57eeb69ca6bf9466393011611f69eea03fd9d30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.7
|
Security for asen-6008 2.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.