Home

Awesome

StarCharter

StarCharter is a versatile command-line tool for producing charts of the night sky. Charts can be generated relative to the local horizon, depicting the sky as seen from a particular location at a particular time, or as a star atlas in equatorial or galactic coordinates. A large array of configuration options are available to allow the charts to be fully customised.

StarCharter can depict the positions of solar system objects - planets, asteroids and comets - retrieving their positions from NASA's DE430 ephemeris, and the paths of these objects across the sky over a specified time period can also be shown.

Charts can be generated in either PNG (bitmap graphics) format for quick viewing and use online, or in PDF/SVG/EPS (vector graphics) formats for subsequent typesetting or editing in a vector graphics package such as Adobe Illustrator or Inkscape.

StarCharter was originally developed to produce star charts for the website https://in-the-sky.org.

Example output

This section shows a small number of examples of the output of StarCharter:

  1. The sky as seen looking south from London on 1 December 2023:

The sky looking south

Generated by this script.

  1. The location and phase of the Moon as it passes Spica and Venus on 1 December 2023:

The path and phase of the Moon

Generated by this script.

  1. A chart of the constellation of Orion:

Orion

Generated by this script.

  1. A chart of the path of Jupiter in the year 2020:

Jupiter in 2020

Generated by this script.

License

This code is distributed under the Gnu General Public License. It is (C) Dominic Ford 2015 - 2024.

Supported operating systems

StarCharter is written in C and runs in Linux, macOS, and other Unix-like operating systems. A Docker container is provided to facilitate running StarCharter in the widest possible range of operating systems. The installation scripts require Python 3. StarCharter uses libcairo to produce its graphical output.

The build process requires a minimum of 4GB RAM. Note that Docker Desktop for macOS imposes a default memory limit of 2GB, which needs to be increased to build StarCharter successfully.

Build process

First make a clone of the code in this GitHub repository:

git clone https://github.com/dcf21/star-charter.git

If you wish to run StarCharter locally (not within a Docker container), then you must run the shell script setup.sh to download the data required by each tool and to compile the software. This script downloads various data from the internet, including the DE430 solar system ephemeris, star catalogues, deep sky catalogues, and an image of the Milky Way to use to shade the background of star charts.

The total download size will be around 500 MB, and it will take around 10-15 minutes to process the downloaded files.

Note that once you have built StarCharter, you must not change its location within your file system. During the build process, the absolute path to the downloaded data files is stored, and the code will be unable to find these data files if their path changes. If you move the code, you must fully rebuild the code:

make clean
./setup.sh

Docker container

If you would rather run StarCharter within a Docker container, then a Dockerfile is provided to build such a container. This automatically installs all the software's dependencies within the containerised environment to make the build process as simple as possible. Additionally, a docker compose script is provided, which automatically build a selection of example star charts.

To build the StarCharter container (this takes 15 minutes):

docker compose build

To generate a selection of example charts, which are placed in the directory examples/output:

docker compose run star-charter

To make other star charts, open a shell within the Docker container as follows:

docker run -it star-charter:v6 /bin/bash

Generating your own star charts

The configuration options for each star chart are specified in a configuration file, where options are specified in the format

<option_name>=<option_value>

The available options include which portion of the sky should be charted, what labels should be placed on the chart, etc. The directory examples within this repository contains numerous example configuration files, and there is a complete list of all the available configuration options below.

There are some examples in the examples directory, and so a good starting point is to generate one of these:

cd examples
../bin/starchart.bin orion.sch

This will generate a chart of the constellation Orion in the output directory. Three files are created, in PNG, SVG and PDF formats.

The file orion.sch reads as follows:

DEFAULTS
ra_central=5.5
dec_central=4.0
angular_width=29.0
mag_min=7
width=15.0
aspect=1.41421356
show_grid_lines=1
constellation_boundaries=1
constellation_sticks=1
coords=ra_dec
projection=stereographic
star_names=1
star_flamsteed_labels=0
constellation_names=1
plot_galaxy_map=1
plot_equator=0
plot_ecliptic=0
plot_galactic_plane=1
font_size=1.2

CHART
output_filename=output/orion.png

CHART
output_filename=output/orion.svg

CHART
output_filename=output/orion.pdf

Settings are arranged in blocks which are headed by the words DEFAULTS or CHART. Settings in a DEFAULTS block do not themselves produce a star chart, but change the default settings which are applied to all subsequent charts. Settings in a CHART relate to a specific chart that is to be rendered, and do not affect any subsequent charts which may be rendered later in the same configuration file.

The file above configures the required parameters to produce a chart of the constellation Orion, and makes these the default settings. It then produces three copies of the star chart, in three different graphic formats.

A complete list of all the configuration settings which are recognised are listed below under 'Configuration settings'.

Configuration settings

The following settings can be included in a StarCharter configuration file:

Paths of solar system objects

The draw_ephemeris option in a configuration file can be used to draw the path of a solar system object across the sky. The syntax is as follows:

draw_ephemeris = <body>,<jd_start>,<jd_end>

where body is the name of the solar system object to plot, and jd_start and jd_end are the Julian day numbers of the beginning and end of the time period for which the object's path should be plotted.

Recognised object names include any of the following:

Note also the setting ephemeris_autoscale, which overrides the specified celestial coordinates for the centre of the star chart, and the specified angular width, and scales the star chart to automatically show the requested ephemerides.

Change history

Version 6.0 (26 Aug 2024) - Removed external dependency on ephemerisCompute to show the positions of solar system objects. This can now be done natively by StarCharter.

Version 5.0 (24 Aug 2024) - Added a huge array of new configuration options. The default projection has been changed to stereographic, which can display fields of view as wide as 360 degrees. A new option for the setting coords - alt_az - allows the local sky to be drawn for a particular location.

Version 4.0 (16 Oct 2022) - Bugfix release.

Version 3.0 (14 Dec 2021) - Initial public release.

Author

This code was developed by Dominic Ford https://dcford.org.uk. It is distributed under the Gnu General Public License V3.