Repository navigation
Expand file tree
/
Copy pathtutorial_06.py
More file actions
59 lines (54 loc) · 1.44 KB
/
Copy pathtutorial_06.py
File metadata and controls
59 lines (54 loc) · 1.44 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
from starplot import MapPlot, Miller, _
from starplot.styles import PlotStyle, extensions
style = PlotStyle().extend(
extensions.BLUE_NIGHT,
extensions.MAP,
)
p = MapPlot(
projection=Miller(),
ra_min=15 * 15,
ra_max=20 * 15,
dec_min=-45.2,
dec_max=-3,
style=style,
resolution=3600,
scale=0.9,
)
p.constellations()
p.constellation_borders()
p.stars(
# select the brightest stars:
where=[_.magnitude <= 3],
# here we make the stars bigger by passing in a custom size function (i.e. a callable)
# you'll learn more about this later in the tutorial...
size_fn=lambda star: (20 - star.magnitude) * 4,
# use an 8-pointed star for bright star markers:
style__marker__symbol="star_4",
style__label__offset_x=8,
style__label__offset_y=-8,
style__label__stroke_width=2,
)
p.stars(
where=[
_.magnitude > 3, # select the dimmer stars
_.magnitude < 8,
],
bayer_labels=True,
)
p.nebula(
# select nebulae which have no defined magnitude or less than 7
where=[_.magnitude.isnull() | (_.magnitude < 7)],
where_true_size=[_.size > 1], # only plot large nebula as their true size
)
p.open_clusters(
where=[_.magnitude.isnull() | (_.magnitude < 7)],
where_true_size=[False],
)
p.globular_clusters(
where=[_.magnitude.isnull() | (_.magnitude < 7)],
where_true_size=[False],
)
p.ecliptic()
p.milky_way()
p.constellation_labels()
p.export("tutorial_06.svg")