Astropy support for selenocentric (Moon) reference frames and lunar surface observatories.
Project description
lunarsky
An extension to astropy, providing selenocentric and topocentric reference frames
for the Moon and transformations of star positions from the ICRS system to these
frames. This is to describe the sky as observed from the surface of the Moon.
Non-relativistic transformations are calculated using lunar orientation data from JPL SPICE kernel files, read with jplephem.
Dependencies
numpyastropy>=6.0.0jplephem
Installation
lunarsky may be installed with pip:
pip install lunarsky
or from the repository:
git clone https://github.com/aelanman/lunarsky
python setup.py install
The first time lunarsky is used, it will automatically download the JPL DE430 ephemeris
(~150 MB) into astropy's data cache (~/.astropy/cache/). Subsequent uses read from the
cache. To pre-fetch the kernel (e.g. before going offline, or in CI), run:
from lunarsky import spice_utils
spice_utils.download_big_kernels()
Usage
Definition of the MCMF and lunar topocentric frames, from Fig. 2 of [Ye et al.][1]
lunarsky provides the following classes:
MCMF– The "Moon-Centered-Moon-Fixed" frame, this is a cartesian reference frame that rotates with the moon. This is chosen to be the Mean Earth/Polar frame, with a Z axis defined by the mean rotation axis of the Moon and a prime meridian defined by the mean direction to the Earth's center (the X axis is through this meridian 90° from the Z axis, and Y is defined such that XYZ is a right-handed system). This is analogous toastropy.coordinates.builtin.ITRS.- LunarTopo – A topocentric (East/North/Up) frame defined at a position on the Moon's surface. This is analogous to
astropy.coordinates.builtin.AltAz. MoonLocation– Analogous to theastropy.coordinates.EarthLocationclass, this describes positions on the Moon in either selenocentric (x, y, z) or selenodetic (lat, lon, height) coordinates. The cartesian axes of the selenocentric system are those of the MCMF frame. Selenodetic coordinates can be defined relative to a few different ellipsoid models, but the default is just a sphere of radius 1737.1 km.SkyCoord– A replacement forastropy.coordinates.SkyCoord, with modifications that ensure compatibility with theMoonLocationclass.Time– A replacement for theastropy.time.Timeclass, which can accept aMoonLocationinstance as its location parameter, allowing for the calculation of local sidereal times on the Moon. The LST of an observer on the Moon is defined as the right ascension of the zenith.
Credit
This package uses lunar orientation data from SPICE kernel files produced by the NASA Navigation and Ancillary Information Facility (NAIF) [3] [4]. The transformations are defined using data in kernel files pck/moon_pa_de421_1900-2050.bpc, moon_080317.tf, and moon_assoc_me.tf. These may be found at the NAIF website, and were produced by Nat Bachman (NAIF/JPL) in March 2008. Binary kernel files are read using jplephem [5]. Further information may be found in the comments in the kernel files in the data directory.
References
[1]: Ye, Hanlin, et al. "Looking Vector Direction Analysis for the Moon-Based Earth Observation Optical Sensor." IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 11, no. 11, Nov. 2018, pp. 4488–99. IEEE Xplore, doi:10.1109/JSTARS.2018.2870247.
[2]: Annex et al., (2020). SpiceyPy: a Pythonic Wrapper for the SPICE Toolkit. Journal of Open Source Software, 5(46), 2050, https://doi.org/10.21105/joss.02050
[3]: Acton, C.H.; "Ancillary Data Services of NASA's Navigation and Ancillary Information Facility;" Planetary and Space Science, Vol. 44, No. 1, pp. 65-70, 1996.
[4]: Charles Acton, Nathaniel Bachman, Boris Semenov, Edward Wright; A look toward the future in the handling of space science mission geometry; Planetary and Space Science (2017); DOI 10.1016/j.pss.2017.02.013; https://doi.org/10.1016/j.pss.2017.02.013
[5]: Rhodes, Brandon. jplephem: Python module for evaluating JPL ephemerides. https://github.com/brandon-rhodes/python-jplephem
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lunarsky-1.0.1.post2.tar.gz.
File metadata
- Download URL: lunarsky-1.0.1.post2.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60ff5295f836868df381e52f46d234f32c612a5b6b171f58e8ee80f4a1c97b5a
|
|
| MD5 |
05c95e64ae1b7e3cd94131e49c2eb03b
|
|
| BLAKE2b-256 |
6b26ff17d767f1a4e30ca730458df57407e97b80ba3ae89e9a9c04d7aa6c625a
|
Provenance
The following attestation bundles were made for lunarsky-1.0.1.post2.tar.gz:
Publisher:
pypirelease.yaml on aelanman/lunarsky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lunarsky-1.0.1.post2.tar.gz -
Subject digest:
60ff5295f836868df381e52f46d234f32c612a5b6b171f58e8ee80f4a1c97b5a - Sigstore transparency entry: 1872886026
- Sigstore integration time:
-
Permalink:
aelanman/lunarsky@745815977461497598cede6c8b4d797585ad6eee -
Branch / Tag:
refs/tags/v1.0.1.post2 - Owner: https://github.com/aelanman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypirelease.yaml@745815977461497598cede6c8b4d797585ad6eee -
Trigger Event:
release
-
Statement type:
File details
Details for the file lunarsky-1.0.1.post2-py3-none-any.whl.
File metadata
- Download URL: lunarsky-1.0.1.post2-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a6896eaefcc1b9a97b0076a57ed9a874a4d13b6ffcad6c5da607501e0a0e59e
|
|
| MD5 |
70264bbc0b6a200cd8ba4ce9a7ebfc97
|
|
| BLAKE2b-256 |
b9dcd8a872ea19141f55b63fbaec8fa4dfb8108ec6143aae9c3b1ecddda98b89
|
Provenance
The following attestation bundles were made for lunarsky-1.0.1.post2-py3-none-any.whl:
Publisher:
pypirelease.yaml on aelanman/lunarsky
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lunarsky-1.0.1.post2-py3-none-any.whl -
Subject digest:
8a6896eaefcc1b9a97b0076a57ed9a874a4d13b6ffcad6c5da607501e0a0e59e - Sigstore transparency entry: 1872886072
- Sigstore integration time:
-
Permalink:
aelanman/lunarsky@745815977461497598cede6c8b4d797585ad6eee -
Branch / Tag:
refs/tags/v1.0.1.post2 - Owner: https://github.com/aelanman
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypirelease.yaml@745815977461497598cede6c8b4d797585ad6eee -
Trigger Event:
release
-
Statement type: