Skip to main content

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.

Copyright and licence

  • Copyright: 2019-2025 Marc van der Sluys, Department of Physics, Utrecht University and Nikhef (institute for high-energy physics and gravitational waves), Amsterdam (NL)
  • Contact: https://marc.vandersluys.nl
  • Website: Github, PyPI
  • Licence: EUPL 1.2

Acknowledgements

  • Thanks to A. Vähäkangas for bug reports!

References

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

elp_mpp02-0.0.6.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elp_mpp02-0.0.6-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file elp_mpp02-0.0.6.tar.gz.

File metadata

  • Download URL: elp_mpp02-0.0.6.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for elp_mpp02-0.0.6.tar.gz
Algorithm Hash digest
SHA256 6f32d37f707e6accca17515d11205ca7494fcdbe1228519cb25f7c908ec13d56
MD5 7dd294ddf04dc526b628ca85483d1fb1
BLAKE2b-256 d8855f58c22a80c90cdf6944a816a99720dc26359f770c0483bb749217d14147

See more details on using hashes here.

File details

Details for the file elp_mpp02-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: elp_mpp02-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for elp_mpp02-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 42188a68e5e3761bcf887972309afd7da166846d8e7b0385f5dcab99efb13fc4
MD5 f19a978a5ad19c2386cadb49023dafc3
BLAKE2b-256 4002bbc1bb6b9b3fc54e0d6f7bc78bc85939017e28441a32d9fda17715e21999

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page