starplot 0.14.0__py2.py3-none-any.whl → 0.15.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- starplot/__init__.py +3 -1
- starplot/base.py +149 -37
- starplot/cli.py +33 -0
- starplot/data/__init__.py +6 -24
- starplot/data/bigsky.py +58 -40
- starplot/data/constellation_lines.py +827 -0
- starplot/data/constellation_stars.py +1501 -0
- starplot/data/constellations.py +43 -32
- starplot/data/db.py +17 -0
- starplot/data/dsos.py +24 -141
- starplot/data/stars.py +45 -24
- starplot/geod.py +0 -6
- starplot/geometry.py +105 -6
- starplot/horizon.py +118 -107
- starplot/map.py +45 -96
- starplot/mixins.py +75 -14
- starplot/models/__init__.py +1 -1
- starplot/models/base.py +10 -128
- starplot/models/constellation.py +55 -32
- starplot/models/dso.py +132 -67
- starplot/models/moon.py +57 -78
- starplot/models/planet.py +44 -69
- starplot/models/star.py +91 -60
- starplot/models/sun.py +32 -53
- starplot/optic.py +14 -17
- starplot/plotters/constellations.py +81 -78
- starplot/plotters/dsos.py +49 -68
- starplot/plotters/experimental.py +1 -1
- starplot/plotters/milkyway.py +18 -20
- starplot/plotters/stars.py +91 -116
- starplot/profile.py +16 -0
- starplot/settings.py +26 -0
- starplot/styles/__init__.py +2 -0
- starplot/styles/base.py +7 -17
- starplot/styles/ext/blue_gold.yml +135 -0
- starplot/styles/ext/blue_light.yml +5 -4
- starplot/styles/ext/blue_medium.yml +11 -7
- starplot/styles/extensions.py +1 -0
- starplot/warnings.py +5 -0
- {starplot-0.14.0.dist-info → starplot-0.15.0.dist-info}/METADATA +11 -11
- {starplot-0.14.0.dist-info → starplot-0.15.0.dist-info}/RECORD +44 -54
- starplot-0.15.0.dist-info/entry_points.txt +3 -0
- starplot/data/bayer.py +0 -3499
- starplot/data/flamsteed.py +0 -2682
- starplot/data/library/constellation_borders_inv.gpkg +0 -0
- starplot/data/library/constellation_lines_hips.json +0 -709
- starplot/data/library/constellation_lines_inv.gpkg +0 -0
- starplot/data/library/constellations.gpkg +0 -0
- starplot/data/library/constellations_hip.fab +0 -88
- starplot/data/library/milkyway.gpkg +0 -0
- starplot/data/library/milkyway_inv.gpkg +0 -0
- starplot/data/library/ongc.gpkg.zip +0 -0
- starplot/data/library/stars.bigsky.mag11.parquet +0 -0
- starplot/data/library/stars.hipparcos.parquet +0 -0
- starplot/data/messier.py +0 -111
- starplot/data/prep/__init__.py +0 -0
- starplot/data/prep/constellations.py +0 -108
- starplot/data/prep/dsos.py +0 -299
- starplot/data/prep/utils.py +0 -16
- starplot/models/geometry.py +0 -44
- {starplot-0.14.0.dist-info → starplot-0.15.0.dist-info}/LICENSE +0 -0
- {starplot-0.14.0.dist-info → starplot-0.15.0.dist-info}/WHEEL +0 -0
starplot/plotters/stars.py
CHANGED
|
@@ -1,53 +1,26 @@
|
|
|
1
1
|
from typing import Callable, Mapping
|
|
2
|
-
from functools import cache
|
|
3
2
|
|
|
4
3
|
import rtree
|
|
5
|
-
from skyfield.api import Star as SkyfieldStar
|
|
6
|
-
|
|
7
4
|
import numpy as np
|
|
5
|
+
from skyfield.api import Star as SkyfieldStar, wgs84
|
|
8
6
|
|
|
9
7
|
from starplot import callables
|
|
10
|
-
from starplot.
|
|
11
|
-
from starplot.data import
|
|
12
|
-
from starplot.data.stars import StarCatalog, STAR_NAMES
|
|
8
|
+
from starplot.data import stars
|
|
9
|
+
from starplot.data.stars import StarCatalog
|
|
13
10
|
from starplot.models.star import Star, from_tuple
|
|
14
11
|
from starplot.styles import ObjectStyle, use_style
|
|
12
|
+
from starplot.profile import profile
|
|
15
13
|
|
|
16
14
|
|
|
17
15
|
class StarPlotterMixin:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
stardata = stardata[(stardata["magnitude"] <= limiting_magnitude)]
|
|
27
|
-
|
|
28
|
-
stardata = stardata[
|
|
29
|
-
(stardata["dec_degrees"] < self.dec_max + dec_buffer)
|
|
30
|
-
& (stardata["dec_degrees"] > self.dec_min - dec_buffer)
|
|
31
|
-
]
|
|
32
|
-
|
|
33
|
-
if self.ra_max <= 24 and self.ra_min >= 0:
|
|
34
|
-
stardata = stardata[
|
|
35
|
-
(stardata["ra_hours"] < self.ra_max + ra_buffer)
|
|
36
|
-
& (stardata["ra_hours"] > self.ra_min - ra_buffer)
|
|
37
|
-
]
|
|
38
|
-
elif self.ra_max > 24:
|
|
39
|
-
# handle wrapping
|
|
40
|
-
stardata = stardata[
|
|
41
|
-
(stardata["ra_hours"] > self.ra_min - ra_buffer)
|
|
42
|
-
| (stardata["ra_hours"] < self.ra_max - 24 + ra_buffer)
|
|
43
|
-
]
|
|
44
|
-
elif self.ra_min < 0:
|
|
45
|
-
stardata = stardata[
|
|
46
|
-
(stardata["ra_hours"] > 24 + self.ra_min - ra_buffer)
|
|
47
|
-
| (stardata["ra_hours"] < self.ra_max + ra_buffer)
|
|
48
|
-
]
|
|
49
|
-
|
|
50
|
-
return stardata
|
|
16
|
+
def _load_stars(self, catalog, filters=None):
|
|
17
|
+
extent = self._extent_mask()
|
|
18
|
+
|
|
19
|
+
return stars.load(
|
|
20
|
+
extent=extent,
|
|
21
|
+
catalog=catalog,
|
|
22
|
+
filters=filters,
|
|
23
|
+
)
|
|
51
24
|
|
|
52
25
|
def _scatter_stars(self, ras, decs, sizes, alphas, colors, style=None, **kwargs):
|
|
53
26
|
style = style or self.style.star
|
|
@@ -83,7 +56,7 @@ class StarPlotterMixin:
|
|
|
83
56
|
self,
|
|
84
57
|
star_objects: list[Star],
|
|
85
58
|
star_sizes: list[float],
|
|
86
|
-
|
|
59
|
+
label_row_ids: list,
|
|
87
60
|
style: ObjectStyle,
|
|
88
61
|
labels: Mapping[str, str],
|
|
89
62
|
bayer_labels: bool,
|
|
@@ -95,7 +68,7 @@ class StarPlotterMixin:
|
|
|
95
68
|
|
|
96
69
|
# Plot all star common names first
|
|
97
70
|
for i, s in enumerate(star_objects):
|
|
98
|
-
if
|
|
71
|
+
if s._row_id not in label_row_ids:
|
|
99
72
|
continue
|
|
100
73
|
|
|
101
74
|
if (
|
|
@@ -110,9 +83,15 @@ class StarPlotterMixin:
|
|
|
110
83
|
elif s.tyc:
|
|
111
84
|
self._labeled_stars.append(s.tyc)
|
|
112
85
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
86
|
+
if label_fn is not None:
|
|
87
|
+
label = label_fn(s)
|
|
88
|
+
elif s.hip in labels:
|
|
89
|
+
label = labels.get(s.hip)
|
|
90
|
+
else:
|
|
91
|
+
label = s.name
|
|
92
|
+
|
|
93
|
+
bayer_desig = s.bayer
|
|
94
|
+
flamsteed_num = s.flamsteed
|
|
116
95
|
|
|
117
96
|
if label:
|
|
118
97
|
self.text(
|
|
@@ -129,13 +108,13 @@ class StarPlotterMixin:
|
|
|
129
108
|
)
|
|
130
109
|
|
|
131
110
|
if bayer_labels and bayer_desig:
|
|
132
|
-
_bayer.append((bayer_desig, s.ra, s.dec, star_sizes[i]
|
|
111
|
+
_bayer.append((bayer_desig, s.ra, s.dec, star_sizes[i]))
|
|
133
112
|
|
|
134
|
-
if flamsteed_labels and flamsteed_num:
|
|
135
|
-
_flamsteed.append((flamsteed_num, s.ra, s.dec, star_sizes[i]
|
|
113
|
+
if flamsteed_labels and flamsteed_num and not bayer_desig:
|
|
114
|
+
_flamsteed.append((flamsteed_num, s.ra, s.dec, star_sizes[i]))
|
|
136
115
|
|
|
137
116
|
# Plot bayer/flamsteed
|
|
138
|
-
for bayer_desig, ra, dec, star_size
|
|
117
|
+
for bayer_desig, ra, dec, star_size in _bayer:
|
|
139
118
|
self.text(
|
|
140
119
|
bayer_desig,
|
|
141
120
|
ra,
|
|
@@ -149,9 +128,7 @@ class StarPlotterMixin:
|
|
|
149
128
|
gid="stars-label-bayer",
|
|
150
129
|
)
|
|
151
130
|
|
|
152
|
-
for flamsteed_num, ra, dec, star_size
|
|
153
|
-
if hip in bayer.hip:
|
|
154
|
-
continue
|
|
131
|
+
for flamsteed_num, ra, dec, star_size in _flamsteed:
|
|
155
132
|
self.text(
|
|
156
133
|
flamsteed_num,
|
|
157
134
|
ra,
|
|
@@ -165,27 +142,26 @@ class StarPlotterMixin:
|
|
|
165
142
|
gid="stars-label-flamsteed",
|
|
166
143
|
)
|
|
167
144
|
|
|
168
|
-
def _prepare_star_coords(self, df):
|
|
145
|
+
def _prepare_star_coords(self, df, limit_by_altaz=False):
|
|
169
146
|
df["x"], df["y"] = (
|
|
170
147
|
df["ra"],
|
|
171
148
|
df["dec"],
|
|
172
149
|
)
|
|
173
150
|
return df
|
|
174
151
|
|
|
152
|
+
@profile
|
|
175
153
|
@use_style(ObjectStyle, "star")
|
|
176
154
|
def stars(
|
|
177
155
|
self,
|
|
178
|
-
|
|
179
|
-
|
|
156
|
+
where: list = None,
|
|
157
|
+
where_labels: list = None,
|
|
158
|
+
catalog: StarCatalog = StarCatalog.BIG_SKY_MAG11,
|
|
180
159
|
style: ObjectStyle = None,
|
|
181
|
-
rasterize: bool = False,
|
|
182
160
|
size_fn: Callable[[Star], float] = callables.size_by_magnitude,
|
|
183
|
-
alpha_fn: Callable[[Star], float] =
|
|
161
|
+
alpha_fn: Callable[[Star], float] = None,
|
|
184
162
|
color_fn: Callable[[Star], str] = None,
|
|
185
163
|
label_fn: Callable[[Star], str] = None,
|
|
186
|
-
|
|
187
|
-
where_labels: list = None,
|
|
188
|
-
labels: Mapping[int, str] = STAR_NAMES,
|
|
164
|
+
labels: Mapping[int, str] = None,
|
|
189
165
|
legend_label: str = "Star",
|
|
190
166
|
bayer_labels: bool = False,
|
|
191
167
|
flamsteed_labels: bool = False,
|
|
@@ -195,23 +171,26 @@ class StarPlotterMixin:
|
|
|
195
171
|
"""
|
|
196
172
|
Plots stars
|
|
197
173
|
|
|
174
|
+
Labels for stars are determined in this order:
|
|
175
|
+
|
|
176
|
+
1. Return value from `label_fn`
|
|
177
|
+
2. Value for star's HIP id in `labels`
|
|
178
|
+
3. IAU-designated name, as listed in the [data reference](/data/star-designations/)
|
|
179
|
+
|
|
198
180
|
Args:
|
|
199
|
-
|
|
200
|
-
|
|
181
|
+
where: A list of expressions that determine which stars to plot. See [Selecting Objects](/reference-selecting-objects/) for details.
|
|
182
|
+
where_labels: A list of expressions that determine which stars are labeled on the plot (this includes all labels: name, Bayer, and Flamsteed). If you want to hide **all** labels, then set this arg to `[False]`. See [Selecting Objects](/reference-selecting-objects/) for details.
|
|
183
|
+
catalog: The catalog of stars to use: "big-sky-mag11", or "big-sky" -- see [`StarCatalog`](/reference-data/#starplot.data.stars.StarCatalog) for details
|
|
201
184
|
style: If `None`, then the plot's style for stars will be used
|
|
202
|
-
rasterize: If True, then the stars will be rasterized when plotted, which can speed up exporting to SVG and reduce the file size but with a loss of image quality
|
|
203
185
|
size_fn: Callable for calculating the marker size of each star. If `None`, then the marker style's size will be used.
|
|
204
186
|
alpha_fn: Callable for calculating the alpha value (aka "opacity") of each star. If `None`, then the marker style's alpha will be used.
|
|
205
187
|
color_fn: Callable for calculating the color of each star. If `None`, then the marker style's color will be used.
|
|
206
188
|
label_fn: Callable for determining the label of each star. If `None`, then the names in the `labels` kwarg will be used.
|
|
207
|
-
|
|
208
|
-
where_labels: A list of expressions that determine which stars are labeled on the plot. See [Selecting Objects](/reference-selecting-objects/) for details.
|
|
209
|
-
labels: A dictionary that maps a star's HIP id to the label that'll be plotted for that star. If you want to hide name labels, then set this arg to `None`.
|
|
189
|
+
labels: A dictionary that maps a star's HIP id to the label that'll be plotted for that star. If `None`, then the star's IAU-designated name will be used.
|
|
210
190
|
legend_label: Label for stars in the legend. If `None`, then they will not be in the legend.
|
|
211
191
|
bayer_labels: If True, then Bayer labels for stars will be plotted.
|
|
212
192
|
flamsteed_labels: If True, then Flamsteed number labels for stars will be plotted.
|
|
213
193
|
"""
|
|
214
|
-
self.logger.debug("Plotting stars...")
|
|
215
194
|
|
|
216
195
|
# fallback to style if callables are None
|
|
217
196
|
color_hex = (
|
|
@@ -222,45 +201,47 @@ class StarPlotterMixin:
|
|
|
222
201
|
color_fn = color_fn or (lambda d: color_hex)
|
|
223
202
|
|
|
224
203
|
where = where or []
|
|
204
|
+
where_labels = where_labels or []
|
|
225
205
|
stars_to_index = []
|
|
206
|
+
labels = labels or {}
|
|
226
207
|
|
|
227
|
-
|
|
228
|
-
mag = None
|
|
208
|
+
star_results = self._load_stars(catalog, filters=where)
|
|
229
209
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
labels = {**STAR_NAMES, **labels}
|
|
234
|
-
|
|
235
|
-
nearby_stars_df = self._load_stars(catalog, mag)
|
|
236
|
-
nearby_stars = SkyfieldStar.from_dataframe(nearby_stars_df)
|
|
237
|
-
astrometric = self.ephemeris["earth"].at(self.timescale).observe(nearby_stars)
|
|
238
|
-
stars_ra, stars_dec, _ = astrometric.radec()
|
|
239
|
-
nearby_stars_df["ra"], nearby_stars_df["dec"] = (
|
|
240
|
-
stars_ra.hours * 15,
|
|
241
|
-
stars_dec.degrees,
|
|
242
|
-
)
|
|
243
|
-
self._prepare_star_coords(nearby_stars_df)
|
|
210
|
+
star_results_labeled = star_results
|
|
211
|
+
for f in where_labels:
|
|
212
|
+
star_results_labeled = star_results_labeled.filter(f)
|
|
244
213
|
|
|
245
|
-
|
|
246
|
-
ctr = 0
|
|
214
|
+
label_row_ids = star_results_labeled.to_pandas()["rowid"].tolist()
|
|
247
215
|
|
|
248
|
-
|
|
249
|
-
obj = from_tuple(star, catalog)
|
|
250
|
-
ctr += 1
|
|
216
|
+
stars_df = star_results.to_pandas()
|
|
251
217
|
|
|
252
|
-
|
|
253
|
-
|
|
218
|
+
if getattr(self, "projection", None) == "zenith":
|
|
219
|
+
# filter stars for zenith plots to only include those above horizon
|
|
220
|
+
self.location = self.earth + wgs84.latlon(self.lat, self.lon)
|
|
221
|
+
stars_apparent = (
|
|
222
|
+
self.location.at(self.timescale)
|
|
223
|
+
.observe(SkyfieldStar.from_dataframe(stars_df))
|
|
224
|
+
.apparent()
|
|
225
|
+
)
|
|
226
|
+
# we only need altitude
|
|
227
|
+
stars_alt, _, _ = stars_apparent.altaz()
|
|
228
|
+
stars_df["alt"] = stars_alt.degrees
|
|
229
|
+
stars_df = stars_df[stars_df["alt"] > 0]
|
|
230
|
+
else:
|
|
231
|
+
nearby_stars = SkyfieldStar.from_dataframe(stars_df)
|
|
232
|
+
astrometric = self.earth.at(self.timescale).observe(nearby_stars)
|
|
233
|
+
stars_ra, stars_dec, _ = astrometric.radec()
|
|
234
|
+
stars_df["ra"], stars_df["dec"] = (
|
|
235
|
+
stars_ra.hours * 15,
|
|
236
|
+
stars_dec.degrees,
|
|
237
|
+
)
|
|
254
238
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
)
|
|
259
|
-
elif self._coordinate_system == CoordinateSystem.AZ_ALT:
|
|
260
|
-
data_xy = self._proj.transform_point(star.x, star.y, self._crs)
|
|
261
|
-
else:
|
|
262
|
-
raise ValueError("Unrecognized coordinate system")
|
|
239
|
+
stars_df = self._prepare_star_coords(stars_df)
|
|
240
|
+
starz = []
|
|
241
|
+
rtree_id = 1
|
|
263
242
|
|
|
243
|
+
for star in stars_df.itertuples():
|
|
244
|
+
data_xy = self._proj.transform_point(star.x, star.y, self._crs)
|
|
264
245
|
display_x, display_y = self.ax.transData.transform(data_xy)
|
|
265
246
|
|
|
266
247
|
if (
|
|
@@ -272,14 +253,15 @@ class StarPlotterMixin:
|
|
|
272
253
|
):
|
|
273
254
|
continue
|
|
274
255
|
|
|
256
|
+
obj = from_tuple(star)
|
|
275
257
|
size = size_fn(obj) * self.scale**2
|
|
276
258
|
alpha = alpha_fn(obj)
|
|
277
259
|
color = color_fn(obj) or style.marker.color.as_hex()
|
|
278
260
|
|
|
279
261
|
if obj.magnitude < 5:
|
|
262
|
+
rtree_id += 1
|
|
280
263
|
# radius = ((size**0.5 / 2) / self.scale) #/ 3.14
|
|
281
264
|
radius = size**0.5 / 5
|
|
282
|
-
|
|
283
265
|
bbox = np.array(
|
|
284
266
|
(
|
|
285
267
|
display_x - radius,
|
|
@@ -288,11 +270,6 @@ class StarPlotterMixin:
|
|
|
288
270
|
display_y + radius,
|
|
289
271
|
)
|
|
290
272
|
)
|
|
291
|
-
# if obj.name == "Sirius":
|
|
292
|
-
# print(bbox)
|
|
293
|
-
# if obj.name == "Electra":
|
|
294
|
-
# print(bbox)
|
|
295
|
-
|
|
296
273
|
if self._stars_rtree.get_size() > 0:
|
|
297
274
|
self._stars_rtree.insert(
|
|
298
275
|
0,
|
|
@@ -301,7 +278,7 @@ class StarPlotterMixin:
|
|
|
301
278
|
)
|
|
302
279
|
else:
|
|
303
280
|
# if the index has no stars yet, then wait until end to load for better performance
|
|
304
|
-
stars_to_index.append((
|
|
281
|
+
stars_to_index.append((rtree_id, bbox, None))
|
|
305
282
|
|
|
306
283
|
starz.append((star.x, star.y, size, alpha, color, obj))
|
|
307
284
|
|
|
@@ -329,7 +306,6 @@ class StarPlotterMixin:
|
|
|
329
306
|
edgecolors=style.marker.edge_color.as_hex()
|
|
330
307
|
if style.marker.edge_color
|
|
331
308
|
else "none",
|
|
332
|
-
rasterized=rasterize,
|
|
333
309
|
)
|
|
334
310
|
|
|
335
311
|
self._add_legend_handle_marker(legend_label, style.marker)
|
|
@@ -337,14 +313,13 @@ class StarPlotterMixin:
|
|
|
337
313
|
if stars_to_index:
|
|
338
314
|
self._stars_rtree = rtree.index.Index(stars_to_index)
|
|
339
315
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
)
|
|
316
|
+
self._star_labels(
|
|
317
|
+
star_objects,
|
|
318
|
+
sizes,
|
|
319
|
+
label_row_ids,
|
|
320
|
+
style,
|
|
321
|
+
labels,
|
|
322
|
+
bayer_labels,
|
|
323
|
+
flamsteed_labels,
|
|
324
|
+
label_fn,
|
|
325
|
+
)
|
starplot/profile.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
def profile(func):
|
|
5
|
+
def wrapper(*args, **kwargs):
|
|
6
|
+
start = time.time()
|
|
7
|
+
|
|
8
|
+
result = func(*args, **kwargs)
|
|
9
|
+
|
|
10
|
+
duration = round(time.time() - start, 4)
|
|
11
|
+
|
|
12
|
+
args[0].logger.debug(f"{func.__name__} = {str(duration)} sec")
|
|
13
|
+
|
|
14
|
+
return result
|
|
15
|
+
|
|
16
|
+
return wrapper
|
starplot/settings.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def env(name, default):
|
|
7
|
+
return os.environ.get(name) or default
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
STARPLOT_PATH = Path(__file__).resolve().parent
|
|
11
|
+
"""Path of starplot source"""
|
|
12
|
+
|
|
13
|
+
DATA_PATH = STARPLOT_PATH / "data" / "library"
|
|
14
|
+
"""Path of starplot data"""
|
|
15
|
+
|
|
16
|
+
DOWNLOAD_PATH = Path(env("STARPLOT_DOWNLOAD_PATH", str(DATA_PATH / "downloads")))
|
|
17
|
+
"""Path for downloaded data"""
|
|
18
|
+
|
|
19
|
+
DUCKDB_EXTENSION_PATH = Path(
|
|
20
|
+
env("STARPLOT_DUCKDB_EXTENSIONS_PATH", str(DATA_PATH / "duckdb-extensions"))
|
|
21
|
+
)
|
|
22
|
+
"""Path for DuckDB extensions"""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
RAW_DATA_PATH = STARPLOT_PATH.parent.parent / "raw"
|
|
26
|
+
BUILD_PATH = STARPLOT_PATH.parent.parent / "build"
|
starplot/styles/__init__.py
CHANGED
starplot/styles/base.py
CHANGED
|
@@ -12,7 +12,7 @@ from pydantic.functional_serializers import PlainSerializer
|
|
|
12
12
|
from matplotlib import patheffects
|
|
13
13
|
from typing_extensions import Annotated
|
|
14
14
|
|
|
15
|
-
from starplot.
|
|
15
|
+
from starplot.models.dso import DsoType
|
|
16
16
|
from starplot.styles.helpers import merge_dict
|
|
17
17
|
from starplot.styles.markers import (
|
|
18
18
|
ellipse,
|
|
@@ -807,13 +807,7 @@ class PlotStyle(BaseStyle):
|
|
|
807
807
|
edge_width=1.3,
|
|
808
808
|
zorder=ZOrderEnum.LAYER_3 - 1,
|
|
809
809
|
),
|
|
810
|
-
label=LabelStyle(
|
|
811
|
-
# font_weight=FontWeightEnum.LIGHT,
|
|
812
|
-
# offset_x=7,
|
|
813
|
-
# offset_y=-6,
|
|
814
|
-
offset_x="auto",
|
|
815
|
-
offset_y="auto",
|
|
816
|
-
),
|
|
810
|
+
label=LabelStyle(offset_x="auto", offset_y="auto"),
|
|
817
811
|
)
|
|
818
812
|
"""Styling for open star clusters"""
|
|
819
813
|
|
|
@@ -825,11 +819,7 @@ class PlotStyle(BaseStyle):
|
|
|
825
819
|
edge_width=1.3,
|
|
826
820
|
zorder=ZOrderEnum.LAYER_3 - 1,
|
|
827
821
|
),
|
|
828
|
-
label=LabelStyle(
|
|
829
|
-
font_weight=FontWeightEnum.LIGHT,
|
|
830
|
-
offset_x=7,
|
|
831
|
-
offset_y=-6,
|
|
832
|
-
),
|
|
822
|
+
label=LabelStyle(offset_x="auto", offset_y="auto"),
|
|
833
823
|
)
|
|
834
824
|
"""Styling for associations of stars"""
|
|
835
825
|
|
|
@@ -842,7 +832,7 @@ class PlotStyle(BaseStyle):
|
|
|
842
832
|
edge_width=1.2,
|
|
843
833
|
zorder=ZOrderEnum.LAYER_3 - 1,
|
|
844
834
|
),
|
|
845
|
-
label=LabelStyle(offset_x=
|
|
835
|
+
label=LabelStyle(offset_x="auto", offset_y="auto"),
|
|
846
836
|
)
|
|
847
837
|
"""Styling for globular star clusters"""
|
|
848
838
|
|
|
@@ -852,7 +842,7 @@ class PlotStyle(BaseStyle):
|
|
|
852
842
|
fill=FillStyleEnum.FULL,
|
|
853
843
|
zorder=ZOrderEnum.LAYER_3 - 1,
|
|
854
844
|
),
|
|
855
|
-
label=LabelStyle(offset_x=
|
|
845
|
+
label=LabelStyle(offset_x="auto", offset_y="auto"),
|
|
856
846
|
)
|
|
857
847
|
"""Styling for galaxies"""
|
|
858
848
|
|
|
@@ -862,7 +852,7 @@ class PlotStyle(BaseStyle):
|
|
|
862
852
|
fill=FillStyleEnum.FULL,
|
|
863
853
|
zorder=ZOrderEnum.LAYER_3 - 1,
|
|
864
854
|
),
|
|
865
|
-
label=LabelStyle(offset_x=
|
|
855
|
+
label=LabelStyle(offset_x="auto", offset_y="auto"),
|
|
866
856
|
)
|
|
867
857
|
"""Styling for nebulas"""
|
|
868
858
|
|
|
@@ -874,7 +864,7 @@ class PlotStyle(BaseStyle):
|
|
|
874
864
|
size=26,
|
|
875
865
|
zorder=ZOrderEnum.LAYER_3 - 1,
|
|
876
866
|
),
|
|
877
|
-
label=LabelStyle(offset_x=
|
|
867
|
+
label=LabelStyle(offset_x="auto", offset_y="auto"),
|
|
878
868
|
)
|
|
879
869
|
"""Styling for planetary nebulas"""
|
|
880
870
|
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# blue_gold
|
|
2
|
+
|
|
3
|
+
background_color: rgb(46, 61, 74)
|
|
4
|
+
figure_background_color: '#fff'
|
|
5
|
+
|
|
6
|
+
text_border_color: rgb(46, 61, 74)
|
|
7
|
+
|
|
8
|
+
border_bg_color: hsl(212, 27%, 56%)
|
|
9
|
+
border_font_color: '#f1f6ff'
|
|
10
|
+
border_line_color: '#2f4358'
|
|
11
|
+
|
|
12
|
+
title:
|
|
13
|
+
font_color: '#f1f6ff'
|
|
14
|
+
star:
|
|
15
|
+
marker:
|
|
16
|
+
color: rgb(244, 233, 203)
|
|
17
|
+
edge_color: rgb(46, 61, 74)
|
|
18
|
+
label:
|
|
19
|
+
font_color: rgb(244, 233, 203)
|
|
20
|
+
bayer_labels:
|
|
21
|
+
font_alpha: 1
|
|
22
|
+
font_color: rgb(244, 233, 203)
|
|
23
|
+
flamsteed_labels:
|
|
24
|
+
font_color: rgb(244, 233, 203)
|
|
25
|
+
|
|
26
|
+
# Constellations
|
|
27
|
+
constellation_labels:
|
|
28
|
+
font_alpha: 0.75
|
|
29
|
+
font_color: rgb(244, 233, 203)
|
|
30
|
+
constellation_lines:
|
|
31
|
+
alpha: 0.8
|
|
32
|
+
color: rgb(34, 124, 130)
|
|
33
|
+
constellation_borders:
|
|
34
|
+
color: hsl(208, 23%, 2%)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
celestial_equator:
|
|
38
|
+
label:
|
|
39
|
+
font_color: '#2d5ec2'
|
|
40
|
+
line:
|
|
41
|
+
color: hsl(220, 62%, 47%)
|
|
42
|
+
alpha: 0.8
|
|
43
|
+
ecliptic:
|
|
44
|
+
label:
|
|
45
|
+
font_color: hsl(4, 60%, 54%)
|
|
46
|
+
line:
|
|
47
|
+
color: hsl(4, 60%, 54%)
|
|
48
|
+
alpha: 0.9
|
|
49
|
+
|
|
50
|
+
planets:
|
|
51
|
+
marker:
|
|
52
|
+
alpha: 1
|
|
53
|
+
color: hsl(37, 78%, 80%)
|
|
54
|
+
fill: full
|
|
55
|
+
milky_way:
|
|
56
|
+
alpha: 0.14
|
|
57
|
+
fill_color: '#94c5e3'
|
|
58
|
+
edge_width: 0
|
|
59
|
+
gridlines:
|
|
60
|
+
label:
|
|
61
|
+
font_alpha: 1
|
|
62
|
+
font_color: '#f1f6ff'
|
|
63
|
+
line:
|
|
64
|
+
alpha: 0.6
|
|
65
|
+
color: '#888'
|
|
66
|
+
style: solid
|
|
67
|
+
sun:
|
|
68
|
+
marker:
|
|
69
|
+
color: '#ffd22e'
|
|
70
|
+
edge_color: 'hsl(47, 100%, 29%)'
|
|
71
|
+
|
|
72
|
+
horizon:
|
|
73
|
+
line:
|
|
74
|
+
color: hsl(208, 23%, 14%)
|
|
75
|
+
edge_color: hsl(208, 23%, 14%)
|
|
76
|
+
label:
|
|
77
|
+
font_color: hsl(208, 23%, 84%)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
# DSOs
|
|
81
|
+
|
|
82
|
+
dso_galaxy:
|
|
83
|
+
marker:
|
|
84
|
+
alpha: 1
|
|
85
|
+
color: hsl(328, 23%, 54%)
|
|
86
|
+
edge_color: hsl(328, 23%, 24%)
|
|
87
|
+
label:
|
|
88
|
+
font_color: hsl(328, 23%, 54%)
|
|
89
|
+
|
|
90
|
+
dso_nebula: &DSO-NEB
|
|
91
|
+
marker:
|
|
92
|
+
alpha: 1
|
|
93
|
+
color: hsl(118, 23%, 54%)
|
|
94
|
+
edge_color: hsl(118, 23%, 24%)
|
|
95
|
+
label:
|
|
96
|
+
font_color: hsl(118, 23%, 54%)
|
|
97
|
+
dso_planetary_nebula: *DSO-NEB
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
dso_open_cluster: &DSO-OC
|
|
101
|
+
marker:
|
|
102
|
+
alpha: 1
|
|
103
|
+
color: hsl(44deg 70% 64%)
|
|
104
|
+
edge_color: rgb(46, 61, 74)
|
|
105
|
+
label:
|
|
106
|
+
font_color: hsl(44deg 70% 64%)
|
|
107
|
+
dso_association_stars: *DSO-OC
|
|
108
|
+
|
|
109
|
+
dso_globular_cluster:
|
|
110
|
+
marker:
|
|
111
|
+
alpha: 1
|
|
112
|
+
color: hsl(44deg 70% 64%)
|
|
113
|
+
edge_color: rgb(46, 61, 74)
|
|
114
|
+
label:
|
|
115
|
+
font_color: '#989400'
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
# other DSOs
|
|
119
|
+
dso_unknown: &DSO
|
|
120
|
+
marker:
|
|
121
|
+
alpha: 1
|
|
122
|
+
color: hsl(91, 62%, 82%)
|
|
123
|
+
edge_color: hsl(91, 53%, 40%)
|
|
124
|
+
label:
|
|
125
|
+
font_color: hsl(91, 53%, 40%)
|
|
126
|
+
dso_dark_nebula: *DSO
|
|
127
|
+
dso_hii_ionized_region: *DSO
|
|
128
|
+
dso_supernova_remnant: *DSO
|
|
129
|
+
dso_nova_star: *DSO
|
|
130
|
+
dso_nonexistant: *DSO
|
|
131
|
+
dso_unknown: *DSO
|
|
132
|
+
dso_duplicate: *DSO
|
|
133
|
+
|
|
134
|
+
legend:
|
|
135
|
+
background_color: '#f1f6ff'
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
background_color: '#fff'
|
|
1
|
+
# background_color: '#fff'
|
|
2
|
+
background_color: hsl(218, 88%, 99%)
|
|
2
3
|
|
|
3
|
-
text_border_color: '#fff'
|
|
4
|
+
text_border_color: hsl(218, 88%, 99%) #'#fff'
|
|
4
5
|
|
|
5
6
|
border_bg_color: '#b5cbe3'
|
|
6
7
|
border_font_color: '#2f4358'
|
|
@@ -110,8 +111,8 @@ ecliptic:
|
|
|
110
111
|
alpha: 1
|
|
111
112
|
style: [0, [0.14, 2]]
|
|
112
113
|
milky_way:
|
|
113
|
-
alpha: 0.
|
|
114
|
-
fill_color: hsl(203, 70%,
|
|
114
|
+
alpha: 0.25
|
|
115
|
+
fill_color: hsl(203, 70%, 81%)
|
|
115
116
|
edge_width: 0
|
|
116
117
|
planets:
|
|
117
118
|
marker:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# blue_medium
|
|
2
2
|
|
|
3
|
-
background_color: hsl(218,
|
|
3
|
+
background_color: hsl(218, 88%, 97%)
|
|
4
4
|
figure_background_color: '#fff'
|
|
5
5
|
|
|
6
6
|
text_border_color: '#f1f6ff'
|
|
@@ -30,14 +30,16 @@ celestial_equator:
|
|
|
30
30
|
label:
|
|
31
31
|
font_color: '#2d5ec2'
|
|
32
32
|
line:
|
|
33
|
-
color: hsl(220,
|
|
33
|
+
color: hsl(220, 52%, 56%)
|
|
34
34
|
alpha: 0.8
|
|
35
35
|
ecliptic:
|
|
36
36
|
label:
|
|
37
|
-
font_color:
|
|
37
|
+
font_color: hsl(207, 75%, 53%)
|
|
38
38
|
line:
|
|
39
|
-
color: hsl(
|
|
40
|
-
alpha:
|
|
39
|
+
color: hsl(207, 75%, 48%)
|
|
40
|
+
alpha: 1
|
|
41
|
+
style: [2, [2, 2]]
|
|
42
|
+
dash_capstyle: butt
|
|
41
43
|
|
|
42
44
|
planets:
|
|
43
45
|
marker:
|
|
@@ -79,8 +81,10 @@ zenith:
|
|
|
79
81
|
dso_galaxy:
|
|
80
82
|
marker:
|
|
81
83
|
alpha: 1
|
|
82
|
-
color: hsl(330, 80%, 85%)
|
|
83
|
-
edge_color: hsl(330, 34%, 33%)
|
|
84
|
+
# color: hsl(330, 80%, 85%)
|
|
85
|
+
# edge_color: hsl(330, 34%, 33%)
|
|
86
|
+
color: hsl(330, 90%, 82%)
|
|
87
|
+
edge_color: hsl(330, 84%, 23%)
|
|
84
88
|
label:
|
|
85
89
|
font_color: hsl(330, 34%, 33%)
|
|
86
90
|
|
starplot/styles/extensions.py
CHANGED
|
@@ -22,6 +22,7 @@ GRAYSCALE_DARK = load("grayscale_dark.yml")
|
|
|
22
22
|
BLUE_LIGHT = load("blue_light.yml")
|
|
23
23
|
BLUE_MEDIUM = load("blue_medium.yml")
|
|
24
24
|
BLUE_DARK = load("blue_dark.yml")
|
|
25
|
+
BLUE_GOLD = load("blue_gold.yml")
|
|
25
26
|
ANTIQUE = load("antique.yml")
|
|
26
27
|
NORD = load("nord.yml")
|
|
27
28
|
CB_WONG = load("cb_wong.yml")
|