Predicting Rise and Set of the Sun, Moon and Planets

Predict the times of rise and set of celestial bodies. Compute and display topocentric coordinates (azimuth and elevation) of these events.
663 Downloads
Updated 25 Dec 2024

View License

This submission is a MATLAB script named rise_set that can be used to determine the topocentric rise and set conditions of the Sun, Moon and planets. This software uses a combination of one-dimensional minimization and root-finding to predict visibility of celestial bodies. The rise_set MATLAB script will also display the calendar date, time and topocentric conditions at maximum elevation along with the total duration of the rise-set event. The source ephemeris for this routine is a JPL DE430 binary ephemeris file.
This application uses several functions ported to MATLAB from the Fortran version of the NOVAS (Naval Observatory Vector Astrometry Subroutines) source code developed at the United States Naval Observatory. Information about the NOVAS software suite can be found at https://aa.usno.navy.mil/software/novas_info.
The rise_set MATLAB script also uses routines from the MICE software suite to read and evaluate the DE430 ephemeris data. Ephemeris files, platform dependent versions of the MICE mex file and other useful MATLAB functions are available at naif.jpl.nasa.gov/naif/toolkit_MATLAB.html. MICE is a MATLAB implementation of the SPICE library created by JPL.

Cite As

David Eagle (2025). Predicting Rise and Set of the Sun, Moon and Planets (https://www.mathworks.com/matlabcentral/fileexchange/39326-predicting-rise-and-set-of-the-sun-moon-and-planets), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2024b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Gravitation, Cosmology & Astrophysics in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.3.0.0

Updated several MATLAB functions and the PDF documentation.

1.2.0.0

Updated to use DE421.bsp ephemeris (included in the zip file). Updated data files and MICE/NOVAS routines.

1.1.0.0

A MICE version of this script can be found in the riseset_mice.zip archive.

1.0.0.0