Positional Astronomy Library in MATLAB (partial SLALIB library)
This is a subset of Pat Wallace's SLALIB positional astronomy library used to convert from equatorial to horizontal/spherical coordinates. It is the state-of-the art in conversion routines as it includes precession and nutation and is used as a standard by astronomers. The main routine to use is slaconv.m which uses 24 MATLAB converted SLALIB functions (from Fortran). Also the main routine for tracking planets, the sun and the moon is rdplan.m.
Usage:
% [TH, PH] = slaconv(slatn, slonge, raref, decref, date, time)
% Accurate conversion from equatorial coordinates (RA, DEC) to Spherical
% (TH,PH) coordinates. The code uses 24 functions from the SLALIB Fortran
% library converted to MATLAB functions.
% INPUTS:
% slatn = latitude (decimal degrees)
% slonge = longitude (decimal degrees)
% raref = RA(J2000) (decimal hours)
% decref = Dec(J2000) (decimal degrees)
% date = vector date [iyear, imonth, iday]
% time = vector time [ihour imin isec]
% OUTPUTS:
% [TH, PH] = Theta and Phi angles (degrees)
%
% e.g. [TH, PH] = slaconv(-31.5, 21, 3.5, -37.5, [2018 09 12], [01 00 00]);
% gives TH = 21.9141 deg, PH = 112.7587 deg
%
% Written/converted by Dr. N. Razavi-Ghods (University of Cambridge)
% version 1.0 (11/01/2013)
Cite As
Nima Razavi-Ghods (2024). Positional Astronomy Library in MATLAB (partial SLALIB library) (https://www.mathworks.com/matlabcentral/fileexchange/39874-positional-astronomy-library-in-matlab-partial-slalib-library), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Sciences > Physics > Gravitation, Cosmology & Astrophysics >
- Sciences > Earth, Ocean, and Atmospheric Sciences > Earth and Planetary Science >
Tags
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.