Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ The following settings can be included in a `StarCharter` configuration file:
* `chart_edge_line_width` - Line width to use when marking the edge of the chart. Default: 2.5.
* `constellation_boundaries` - Boolean (0 or 1) indicating whether we draw constellation boundaries. Default: 1.
* `constellation_boundary_col` - Colour to use when drawing constellation boundaries
* `constellation_highlight` - Optionally, highlight the boundary of one particular constellation, identified by a three-letter abbreviation.
* `constellation_highlight` - Optionally, highlight the boundary of particular constellations, identified by three-letter abbreviation, comma sepparated list.
* `constellation_label_col` - Colour to use when writing constellation names
* `constellation_label_size` - Relative font size to use when rendering constellation names. Default: 1.
* `constellation_names` - Boolean (0 or 1) indicating whether we label the names of constellations
Expand Down Expand Up @@ -463,6 +463,7 @@ Only the filename is compulsory. The fields have the following meanings:
* `angular_height` - The number of degrees of altitude spanned by the horizon graphic (vertically). By default, this is calculated from the aspect ratio and angular width of the image, assuming the pixels at the centre of the image to be square. So, if the image is twice as wide as it is high, and the angular width is 360 degrees, its angular height will be 180 degrees.

## Change history
FORK version (28 June 2026) - Added the ability to highlight multiple constellations. Fixed bug of generating more than 5 charts in one configuration file

**Version 10.0** (6 June 2026) - Switched default ephemeris from DE430 to DE440. Add support for horizon graphics.

Expand Down
4 changes: 2 additions & 2 deletions dataFetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,12 @@ def fetch_required_files(refresh: bool = False, never_refresh: bool = False,
{
'url': 'https://ftp.lowell.edu/pub/elgb/astorb.dat.gz',
'destination': 'data/astorb.dat',
'force_refresh': True
'force_refresh': refresh # was True
},
{
'url': 'https://www.minorplanetcenter.net/iau/MPCORB/AllCometEls.txt',
'destination': 'data/Soft00Cmt.txt',
'force_refresh': True
'force_refresh': refresh # was True
},

# Definitions of constellation boundaries
Expand Down
18 changes: 8 additions & 10 deletions data_processing/milky_way_map/src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,18 @@
#include <stdio.h>

// Output 1 is for starcharts_svg
#define SMOOTH 16 /* Median smoothing of Axel Mellinger's panorama */
#define RESOLUTION_1 (360./8000*(SMOOTH)/16) /* resolution of grid in degrees */
#define SMOOTH 16 /* Median smoothing of Axel Mellinger's panorama */
#define RESOLUTION_1 (360./8000*(SMOOTH)/16) /* resolution of grid in degrees */

#define H_SIZE_MAP1 ((int)(360/(RESOLUTION_1)))
#define V_SIZE_MAP1 ((int)(180/(RESOLUTION_1)))
#define H_SIZE_MAP1 8000
#define V_SIZE_MAP1 4000

// Output2 is for HTML5 planetarium
#define RESOLUTION_2 (360./4096) /* resolution of grid in degrees */

#define H_SIZE_MAP2 ((int)(360/(RESOLUTION_2)))
#define V_SIZE_MAP2 ((int)(100/(RESOLUTION_2)))
#define RESOLUTION_2 (360./4096) /* resolution of grid in degrees */
#define H_SIZE_MAP2 4096
#define V_SIZE_MAP2 1137

typedef struct {
unsigned char C[V_SIZE_MAP1][H_SIZE_MAP1];
unsigned char C[V_SIZE_MAP1][H_SIZE_MAP1]; /* 4000 x 8000 = 32 MB */
} dataArray;

#endif
Expand Down
4 changes: 2 additions & 2 deletions data_processing/star_catalogue_merged/main_catalogue_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1247,11 +1247,11 @@ def read_english_names() -> Tuple[StarList, str]:
star: StarDescriptor = StarDescriptor()
try:
star.names_hip_num = int(line[90:].split()[0])
except ValueError:
except (ValueError, IndexError):
pass
try:
star.names_hd_num = int(line[97:].split()[0])
except ValueError:
except (ValueError, IndexError):
pass
star.add_english_name(new_name=line[18:36].strip(), prepend=True)

Expand Down
6 changes: 3 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ cd ${cwd} || exit 1

# Make some test charts of the paths of solar system objects, to ensure all ASCII input ephemeris files are converted
# to binary for rapid access on subsequent queries
echo "[`date`] Generating test charts"
cd ${cwd} || exit 1
./runExamples.py "$@" || exit 1
# echo "[`date`] Generating test charts"
#cd ${cwd} || exit 1
#./runExamples.py "$@" || exit 1

# Finished
cd ${cwd} || exit 1
Expand Down
40 changes: 34 additions & 6 deletions src/astroGraphics/constellations.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,27 @@ void plot_constellation_boundaries(chart_config *s, line_drawer *ld) {
double x_first = 0, y_first = 0;
char line[FNAME_LENGTH], *scan, constellation[6] = "@@@@";

// This must be set to true initially, to ensure that colour is set when we start tracing the first constellation
int was_highlighted = 1;
// Parse constellation_highlight into a list of 3-letter abbreviations, comma-separated
// e.g. "Ori,Tau,Gem"
// char highlight_buf[FNAME_LENGTH];
// strncpy(highlight_buf, s->constellation_highlight, FNAME_LENGTH - 1);
// highlight_buf[FNAME_LENGTH - 1] = '\0';

char highlight_buf[FNAME_LENGTH];
snprintf(highlight_buf, FNAME_LENGTH, "%s", s->constellation_highlight);

char highlights[64][4]; // up to 64 highlighted constellations, 3 chars + null
int highlight_count = 0;

char *token = strtok(highlight_buf, ",");
while (token != NULL && highlight_count < 64) {
// Strip leading/trailing spaces
while (token[0] == ' ') token++;
strncpy(highlights[highlight_count], token, 3);
highlights[highlight_count][3] = '\0';
highlight_count++;
token = strtok(NULL, ",");
}

// Set up line-drawing class
ld_pen_up(ld, GSL_NAN, GSL_NAN, NULL, 1);
Expand Down Expand Up @@ -137,22 +156,30 @@ void plot_constellation_boundaries(chart_config *s, line_drawer *ld) {
x_first = x;
y_first = y;

// Check if this constellation is in the highlight list
int is_highlighted = 0;
for (int i = 0; i < highlight_count; i++) {
if (strncasecmp(constellation, highlights[i], 3) == 0) {
is_highlighted = 1;
break;
}
}

// Set the line colour and width for the boundary of this constellation
if (strncmp(constellation, s->constellation_highlight, 3) == 0) {
if (is_highlighted) {
cairo_set_source_rgba(s->cairo_draw,
s->star_col.red, s->star_col.grn, s->star_col.blu,
s->star_col.alpha);
cairo_set_line_width(s->cairo_draw, 2 * s->line_width_base);
was_highlighted = 1;
} else if (was_highlighted) {
} else {
cairo_set_source_rgba(s->cairo_draw,
s->constellation_boundary_col.red,
s->constellation_boundary_col.grn,
s->constellation_boundary_col.blu,
s->constellation_boundary_col.alpha);
cairo_set_line_width(s->cairo_draw, 0.8 * s->line_width_base);
was_highlighted = 0;
}

}

ld_point(ld, x, y, NULL);
Expand All @@ -162,6 +189,7 @@ void plot_constellation_boundaries(chart_config *s, line_drawer *ld) {
ld_pen_up(ld, GSL_NAN, GSL_NAN, NULL, 1);
}


//! plot_constellation_sticks - Draw stick figures to represent the constellations.
//! \param s - A <chart_config> structure defining the properties of the star chart to be drawn.
//! \param ld - A <line_drawer> structure used to draw lines on a cairo surface.
Expand Down
Loading