Repository navigation
Expand file tree
/
Copy pathmarkers.py
More file actions
80 lines (67 loc) · 2.05 KB
/
Copy pathmarkers.py
File metadata and controls
80 lines (67 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""
Renders every marker symbol available
"""
from pathlib import Path
from typing import get_args
from starplot import MapPlot, Miller
from starplot.styles import MarkerStyle, ObjectStyle, PlotStyle, extensions
from starplot.styles.types import MarkerSymbol
OUTPUT_DIR = Path(__file__).resolve().parent.parent / "images" / "reference"
OUTPUT_DIR.mkdir(parents=True, exist_ok=True)
style_medium = PlotStyle().extend(
extensions.BLUE_MEDIUM,
extensions.MAP,
extensions.FIGURE_TRANSPARENT,
)
style_medium.axes.border = None
style_medium.axes.background.fill = None
style_night = PlotStyle().extend(
extensions.BLUE_NIGHT,
extensions.MAP,
extensions.FIGURE_TRANSPARENT,
)
CENTER_RA = 180
CENTER_DEC = 0
default_style = MarkerStyle(
fill="#b7d9f1",
stroke="#053659",
stroke_width=2,
)
marker_styles = {
"circle": style_medium.dso_open_cluster.marker,
"circle_cross": style_medium.dso_globular_cluster.marker,
"circle_crosshair": style_medium.dso_nebula.marker,
"circle_line": style_medium.dso_double_star.marker,
"comet": default_style,
"diamond": default_style,
"ellipse": style_medium.dso_galaxy.marker,
"plus": default_style,
"satellite": default_style,
"square": style_medium.dso_nebula.marker,
"star": default_style,
"star_4": default_style,
"star_8": default_style,
"triangle": default_style,
}
for symbol_str in get_args(MarkerSymbol):
marker_style = default_style
marker_style.size = 64
marker_style.symbol = symbol_str
marker_style.stroke_width = default_style.stroke_width
object_style = ObjectStyle(marker=marker_style)
p = MapPlot(
projection=Miller(),
ra_min=CENTER_RA - 10,
ra_max=CENTER_RA + 10,
dec_min=CENTER_DEC - 10,
dec_max=CENTER_DEC + 10,
style=style_medium,
resolution=64 if symbol_str != "circle_line" else 100,
scale=0.6,
)
p.marker(
ra=CENTER_RA,
dec=CENTER_DEC,
style=object_style,
)
p.export(str(OUTPUT_DIR / f"marker_{symbol_str}.svg"))