A skychart for Matlab: display the sky view
Updated 22 Jul 2020

Editor's Note: This file was selected as MATLAB Central Pick of the Week

SKYCHART: a class to plot a sky chart with stars/objects
This class computes and plots the sky seen at given location and time. About
43000 stars and 13000 deep sky objects are considered, as well as the Sun, the
Moon and 7 planets. The actual number of rendered objects depends on the zoom
level in the sky chart.

You may zoom the plot using the Zoom tool (in the Toolbar). You may as well
use the drag tool to move the visible area. Right-click shows a contextual
menu with the under-lying object properties (coordinates, type, ...).

To use this code, type

>> sc = skychart

displays the view at the current UTC and location.

skychart: create the view
date: set/get the date (UTC)
getplace: get the current GPS location from the network
plot: plot/replot the view.
connect: connect to a scope controler
goto: send connected scope to selected location
findobj: search for a named object and select it

You may force a re-computation and replot of the sky view with:

>> compute(sc, 'force')
>> plot(sc, 1)

Connecting to a Scope

You may connect to a telescope mount using e.g.

>> connect(sc, scope)

where 'scope' should be an object with methods:

getstatus: read the mount status, and update the scope properties:
scope.ra.h, scope.ra.min, scope.dec.deg, scope.dec.min
gotoradec(RA,DEC): send the mount to location (RA,DEC)

when scope is omitted, a connection with a Vixen StarBook is attempted. This
controler can be set in 'simulate' mode.

E. Ofek MAAT GPL3 2004
F. Glineur parse_json BSD 2009
P. Tenenbaum Local Time to UTC, BSD 2008
Stars (~46000) data base from
Deep sky objects (~13000) from
StarBook (Vixen)

Cite As

Emmanuel Farhi (2024). skychart (, GitHub. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: local_time_to_utc, (another) JSON Parser

Community Treasure Hunt

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

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

update to grid feature, and mouse wheel zoom.

added mount control (Vixen StarBook) and observation planning/list

now has contextual menu to display right-click menu, and display names

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.