Skyfield Night Sky Explorer
Version 1.0.0 (59 MB) by
Duncan Carlsmith
Live Script illustrating programmatic night-sky simulation and Python integration with Skyfield.
The prediction of what stars and other objects you might see in the sky at your location and time is a standard topic in an introductory course in astronomy with a simple model. For a distant star with negligible motion relative to the Sun, reference catalog celestial coordinate right ascension and declination at the J2000 reference location and time are rotated to observer latitude, longitude, and time and then converted to elevation and azimuth in a local reference frame. A more accurate calculation accounts for Earth's orbital motion and aberration of light, precession and nutation of Earth's axis of rotation, geoid shape affecting the local definition of the vertical direction, atmospheric refraction, the local magnetic field used to sense azimuth, and subtleties related to the definition of time. For planets, moons, asteroids, and Earth satellites, an ephemeris based on solar system modeling is generally needed.
This educational Live Script demonstrates how to synthesize a star catalog, USNO ephemerides for planets and moons, and the Skyfield Python library to estimate the azimuth and elevation of stars, planets, and moons at any terrestrial location and time. It then simulates a night sky image taken with a mobile phone or other camera pointed in any direction at that location and time. This functionality is essentially that of a mobile phone or web-based night sky visualization app but under the user's programmatic control. It can be used to match a user's image to celestial objects programmatically. The script illustrates how it can be used to study the effects of aberration and time delay on observations of the moons of Jupiter, effects that led Ole Rømer to suggest light had a finite speed.
This script may interest students and instructor of physics and astronomy as the curious. 'Try this' suggestions with parameters sliders, coding 'Challenges', hyperlinks and references are included for further exploration. Additional educational Live Scripts by the author are available here. Instructions are provided to download a large (1 GB) ephemeris auxiliary file required for the Jupiter moons analysis.
Cite As
Duncan Carlsmith (2025). Skyfield Night Sky Explorer (https://uk.mathworks.com/matlabcentral/fileexchange/181605-skyfield-night-sky-explorer), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2025a
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
SkyfieldNightSkyExplorer folder
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
