Accurate Moon positions using the Lunar solution ELP/MPP02 in Python
Project description
ELP_MPP02: accurate Moon positions using the lunar solution ELP/MPP02 in Python
Compute accurate Moon positions using the semi-analytical lunar solution ELP2000/MPP02 by Chapront & Francou (2003) in Python.
Installation
This package can be installed using pip install elp-mpp02
. You will need to manually download the six data
files ELP_MAIN/PERT.S1/2/3
from
ftp://cyrano-se.obspm.fr/pub/2_lunar_solutions/2_elpmpp02
and save them in a directory of your choice.
Using the package
You can import the package as follows:
from elp_mpp02 import mpp02 as mpp
Then, make sure you define the directory where the data files are located (if not in the current dir).
For the subdir data/
of the current directory, do:
mpp.dataDir = 'data' # Set the dir where the ELP_*.S* data files can be found
Choose whether to run the code in LLR (mode=0
; default) or DE405 (mode=1
; 'historical') mode, select a
Julian day and compute the Moon position for that instance:
mode = 1 # Historical mode
jd = 2451545
lon,lat,dist = mpp.compute_lbr(jd, mode)
print('jd =',jd, ': lon =',lon,'rad, lat =',lat, 'rad, dist =',dist,'km.')
The result should be
jd = 2451545 : lon = -2.385534575256455 rad, lat = 0.09024868423130429 rad, dist = 402448.6385830673 km
The ecliptical longitude and latitude are expressed in radians, the distance is in kilometres. The
coordinates are valid for the mean equinox of J2000. Note that on the first call, the constants must be
initialised and the data files need to be read, which can take ~10s. If mode
is changed between calls, the
data must be reinitialised.
Author and licence
- Author: Marc van der Sluys
- Contact: http://astro.ru.nl/~sluys/
- Website: Github, PyPI
- Licence: GPLv3+
References
- Chapront & Francou (2003)
- FTP data files — in case FTP urls don't work in Markdown: ftp://cyrano-se.obspm.fr/pub/2_lunar_solutions/2_elpmpp02
- This Python code is adapted from the Fortran implementation in libTheSky
Project details
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 elp_mpp02-0.0.4.tar.gz
.
File metadata
- Download URL: elp_mpp02-0.0.4.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e52bb5927d989ef9ec5fa5ac2903642e95cdb89ec9198379026f3c9f6d8668f |
|
MD5 | 7c88b3a4ccdb312ad2176d63ee10f7a5 |
|
BLAKE2b-256 | 5e57e54fa19bc2ea9051f2ea552bfa1cc26297322982d069c89366f13df0607d |
File details
Details for the file elp_mpp02-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: elp_mpp02-0.0.4-py3-none-any.whl
- Upload date:
- Size: 22.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ee0c123f6d0d751aee13ab0b3e54c18f8a7e5b87edf34535fa3ae8364b30ea5 |
|
MD5 | a9a3803a7ad8fed0e3c588bc6c21cb18 |
|
BLAKE2b-256 | c758747c7681f0b9ba48668aa30e9ace7be05278b4c2959bb573298ca6975587 |