starplot 0.19.0__py2.py3-none-any.whl → 0.19.2__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 +1 -1
- starplot/config.py +11 -0
- starplot/data/catalogs.py +5 -5
- starplot/data/constellations.py +1 -0
- starplot/geod.py +3 -4
- starplot/geometry.py +17 -1
- starplot/mixins.py +11 -0
- starplot/models/constellation.py +13 -2
- starplot/models/moon.py +1 -1
- starplot/models/planet.py +1 -1
- starplot/models/sun.py +1 -1
- starplot/plots/base.py +34 -18
- starplot/plots/map.py +1 -0
- starplot/plots/zenith.py +6 -0
- starplot/plotters/text.py +79 -19
- {starplot-0.19.0.dist-info → starplot-0.19.2.dist-info}/METADATA +1 -1
- {starplot-0.19.0.dist-info → starplot-0.19.2.dist-info}/RECORD +20 -20
- {starplot-0.19.0.dist-info → starplot-0.19.2.dist-info}/WHEEL +0 -0
- {starplot-0.19.0.dist-info → starplot-0.19.2.dist-info}/entry_points.txt +0 -0
- {starplot-0.19.0.dist-info → starplot-0.19.2.dist-info}/licenses/LICENSE +0 -0
starplot/__init__.py
CHANGED
starplot/config.py
CHANGED
|
@@ -13,6 +13,14 @@ def _get_path(var_name, default) -> Path:
|
|
|
13
13
|
return _get
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
def _get_boolean(var_name, default) -> bool:
|
|
17
|
+
def _get():
|
|
18
|
+
value = os.environ.get(var_name)
|
|
19
|
+
return default if not value else bool(value.lower() == "true")
|
|
20
|
+
|
|
21
|
+
return _get
|
|
22
|
+
|
|
23
|
+
|
|
16
24
|
class SvgTextType(str, Enum):
|
|
17
25
|
PATH = "path"
|
|
18
26
|
ELEMENT = "element"
|
|
@@ -64,5 +72,8 @@ class Settings:
|
|
|
64
72
|
**🌐 Want to see another language available? Please help us add it! [Details here](https://github.com/steveberardi/starplot/tree/main/data/raw/translations).**
|
|
65
73
|
"""
|
|
66
74
|
|
|
75
|
+
debug: bool = field(default_factory=_get_boolean("STARPLOT_DEBUG", False))
|
|
76
|
+
"""Global setting for debug mode. When this is enabled, Starplot will log debugging information and plot polygons for debugging text issues"""
|
|
77
|
+
|
|
67
78
|
|
|
68
79
|
settings = Settings()
|
starplot/data/catalogs.py
CHANGED
|
@@ -321,23 +321,23 @@ This is an _abridged_ version of the Big Sky Catalog.
|
|
|
321
321
|
|
|
322
322
|
OPEN_NGC = Catalog(
|
|
323
323
|
path=settings.data_path / "ongc.0.1.2.parquet",
|
|
324
|
-
url="https://github.com/steveberardi/starplot-ongc/releases/download/v0.1.
|
|
324
|
+
url="https://github.com/steveberardi/starplot-ongc/releases/download/v0.1.2/ongc.0.1.2.parquet",
|
|
325
325
|
)
|
|
326
326
|
"""
|
|
327
327
|
[OpenNGC](https://github.com/mattiaverga/OpenNGC) catalog, including nebulae outlines.
|
|
328
328
|
"""
|
|
329
329
|
|
|
330
330
|
CONSTELLATIONS_IAU = Catalog(
|
|
331
|
-
path=settings.data_path / "constellations
|
|
332
|
-
url="https://github.com/steveberardi/starplot-constellations/releases/download/v0.
|
|
331
|
+
path=settings.data_path / "constellations.0.3.3.parquet",
|
|
332
|
+
url="https://github.com/steveberardi/starplot-constellations/releases/download/v0.3.3/constellations.0.3.3.parquet",
|
|
333
333
|
)
|
|
334
334
|
"""
|
|
335
335
|
Constellations recognized by IAU, with lines by Sky & Telescope.
|
|
336
336
|
"""
|
|
337
337
|
|
|
338
338
|
CONSTELLATION_BORDERS = Catalog(
|
|
339
|
-
path=settings.data_path / "constellations-borders-0.
|
|
340
|
-
url="https://github.com/steveberardi/starplot-constellations/releases/download/v0.
|
|
339
|
+
path=settings.data_path / "constellations-borders-0.3.1.parquet",
|
|
340
|
+
url="https://github.com/steveberardi/starplot-constellations/releases/download/v0.3.1/constellations-borders.0.3.1.parquet",
|
|
341
341
|
)
|
|
342
342
|
|
|
343
343
|
MILKY_WAY = Catalog(
|
starplot/data/constellations.py
CHANGED
starplot/geod.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import math
|
|
2
2
|
|
|
3
3
|
import pyproj
|
|
4
|
-
|
|
4
|
+
import numpy as np
|
|
5
5
|
|
|
6
6
|
GEOD = pyproj.Geod("+a=6378137 +f=0.0", sphere=True)
|
|
7
7
|
|
|
@@ -70,11 +70,10 @@ def ellipse(
|
|
|
70
70
|
|
|
71
71
|
height = distance_m(height_degrees / 2) # b
|
|
72
72
|
width = distance_m(width_degrees / 2) # a
|
|
73
|
+
step_size = (end_angle - start_angle) / num_pts
|
|
73
74
|
|
|
74
75
|
points = []
|
|
75
|
-
for angle_pt in
|
|
76
|
-
start_angle, end_angle + 1, int((end_angle - start_angle) / num_pts)
|
|
77
|
-
):
|
|
76
|
+
for angle_pt in np.arange(start_angle, end_angle + step_size, step_size):
|
|
78
77
|
radians = math.radians(angle_pt)
|
|
79
78
|
radius_a = (height * width) / math.sqrt(
|
|
80
79
|
height**2 * (math.sin(radians)) ** 2
|
starplot/geometry.py
CHANGED
|
@@ -2,7 +2,7 @@ import random
|
|
|
2
2
|
import math
|
|
3
3
|
from typing import Union
|
|
4
4
|
|
|
5
|
-
from shapely import transform
|
|
5
|
+
from shapely import transform, union_all
|
|
6
6
|
from shapely.geometry import Point, Polygon, MultiPolygon
|
|
7
7
|
|
|
8
8
|
from starplot import geod
|
|
@@ -96,6 +96,22 @@ def unwrap_polygon_360(polygon: Polygon) -> Polygon:
|
|
|
96
96
|
return polygon
|
|
97
97
|
|
|
98
98
|
|
|
99
|
+
def union_at_zero(a: Polygon, b: Polygon) -> Polygon:
|
|
100
|
+
"""Returns union of two polygons"""
|
|
101
|
+
a_ra = list(a.exterior.coords.xy)[0]
|
|
102
|
+
b_ra = list(b.exterior.coords.xy)[0]
|
|
103
|
+
|
|
104
|
+
if max(a_ra) == 360 and min(b_ra) == 0:
|
|
105
|
+
points = list(zip(*b.exterior.coords.xy))
|
|
106
|
+
b = Polygon([[ra + 360, dec] for ra, dec in points])
|
|
107
|
+
|
|
108
|
+
elif min(a_ra) == 0 and max(b_ra) == 360:
|
|
109
|
+
points = list(zip(*a.exterior.coords.xy))
|
|
110
|
+
a = Polygon([[ra + 360, dec] for ra, dec in points])
|
|
111
|
+
|
|
112
|
+
return union_all([a, b])
|
|
113
|
+
|
|
114
|
+
|
|
99
115
|
def split_polygon_at_zero(polygon: Polygon) -> list[Polygon]:
|
|
100
116
|
"""
|
|
101
117
|
Splits a polygon at the first point of Aries (RA=0)
|
starplot/mixins.py
CHANGED
|
@@ -12,6 +12,17 @@ class ExtentMaskMixin:
|
|
|
12
12
|
|
|
13
13
|
If the extent crosses equinox, then a MultiPolygon will be returned
|
|
14
14
|
"""
|
|
15
|
+
if self._is_global_extent():
|
|
16
|
+
return Polygon(
|
|
17
|
+
[
|
|
18
|
+
(0, -90),
|
|
19
|
+
(360, -90),
|
|
20
|
+
(360, 90),
|
|
21
|
+
(0, 90),
|
|
22
|
+
(0, -90),
|
|
23
|
+
]
|
|
24
|
+
)
|
|
25
|
+
|
|
15
26
|
if self.ra_max <= 360:
|
|
16
27
|
coords = [
|
|
17
28
|
[self.ra_min, self.dec_min],
|
starplot/models/constellation.py
CHANGED
|
@@ -16,7 +16,11 @@ class Constellation(CatalogObject, SkyObject):
|
|
|
16
16
|
"""
|
|
17
17
|
|
|
18
18
|
boundary: Polygon | MultiPolygon
|
|
19
|
-
"""
|
|
19
|
+
"""
|
|
20
|
+
Shapely Polygon of the constellation's boundary. Right ascension coordinates are in degrees (0...360).
|
|
21
|
+
|
|
22
|
+
If the constellation's boundary crosses the 0-meridian, then this will be a MultiPolygon split at the meridian.
|
|
23
|
+
"""
|
|
20
24
|
|
|
21
25
|
star_hip_ids: list[int]
|
|
22
26
|
"""List of HIP ids for stars that are part of the _lines_ for this constellation."""
|
|
@@ -35,6 +39,13 @@ class Constellation(CatalogObject, SkyObject):
|
|
|
35
39
|
Serpens Caput has the `iau_id` of `ser1` and Serpens Cauda is `ser2`
|
|
36
40
|
"""
|
|
37
41
|
|
|
42
|
+
border: LineString = None
|
|
43
|
+
"""
|
|
44
|
+
Shapely LineString of the constellation's border. Right ascension coordinates are in degrees (0...360).
|
|
45
|
+
|
|
46
|
+
Coordinates in this geometry may extend past RA=360, if the border crosses the 0-meridian. This makes it ready to plot with the `line` function.
|
|
47
|
+
"""
|
|
48
|
+
|
|
38
49
|
def __repr__(self) -> str:
|
|
39
50
|
return f"Constellation(iau_id={self.iau_id}, name={self.name}, ra={self.ra}, dec={self.dec})"
|
|
40
51
|
|
|
@@ -125,7 +136,7 @@ class Constellation(CatalogObject, SkyObject):
|
|
|
125
136
|
Returns the uppercase name of the constellation.
|
|
126
137
|
|
|
127
138
|
"""
|
|
128
|
-
return constellation.name.upper()
|
|
139
|
+
return constellation.name.upper().replace(" ", "\n")
|
|
129
140
|
|
|
130
141
|
|
|
131
142
|
def from_tuple(c: tuple) -> Constellation:
|
starplot/models/moon.py
CHANGED
starplot/models/planet.py
CHANGED
|
@@ -72,7 +72,7 @@ class Planet(SkyObject):
|
|
|
72
72
|
"""Date/time of planet's position"""
|
|
73
73
|
|
|
74
74
|
apparent_size: float = 0
|
|
75
|
-
"""Apparent
|
|
75
|
+
"""Apparent diameter (degrees)"""
|
|
76
76
|
|
|
77
77
|
geometry: Polygon = None
|
|
78
78
|
"""Shapely Polygon of the planet's extent. Right ascension coordinates are in degrees (0...360)."""
|
starplot/models/sun.py
CHANGED
|
@@ -22,7 +22,7 @@ class Sun(SkyObject):
|
|
|
22
22
|
"""Date/time of Sun's position"""
|
|
23
23
|
|
|
24
24
|
apparent_size: float = 0
|
|
25
|
-
"""Apparent
|
|
25
|
+
"""Apparent diameter (degrees)"""
|
|
26
26
|
|
|
27
27
|
geometry: Polygon = None
|
|
28
28
|
"""Shapely Polygon of the Sun's extent. Right ascension coordinates are in degrees (0...360)."""
|
starplot/plots/base.py
CHANGED
|
@@ -8,7 +8,7 @@ from matplotlib import pyplot as plt, patheffects
|
|
|
8
8
|
from matplotlib.axes import Axes
|
|
9
9
|
from matplotlib.figure import Figure
|
|
10
10
|
from matplotlib.lines import Line2D
|
|
11
|
-
from shapely import Polygon
|
|
11
|
+
from shapely import Polygon, LineString
|
|
12
12
|
|
|
13
13
|
from starplot.coordinates import CoordinateSystem
|
|
14
14
|
from starplot import geod, models, warnings
|
|
@@ -122,7 +122,9 @@ class BasePlot(TextPlotterMixin, ABC):
|
|
|
122
122
|
self._legend = None
|
|
123
123
|
self._legend_handles = {}
|
|
124
124
|
|
|
125
|
-
self.
|
|
125
|
+
self.debug = StarplotSettings.debug or bool(kwargs.get("debug"))
|
|
126
|
+
self.debug_text = StarplotSettings.debug or bool(kwargs.get("debug_text"))
|
|
127
|
+
self.log_level = logging.DEBUG if self.debug else logging.ERROR
|
|
126
128
|
self.logger = LOGGER
|
|
127
129
|
self.logger.setLevel(self.log_level)
|
|
128
130
|
|
|
@@ -332,9 +334,9 @@ class BasePlot(TextPlotterMixin, ABC):
|
|
|
332
334
|
polygon_style = style.marker.to_polygon_style()
|
|
333
335
|
polygon_style.edge_color = None
|
|
334
336
|
self.circle(
|
|
335
|
-
(p.ra, p.dec),
|
|
336
|
-
p.apparent_size,
|
|
337
|
-
polygon_style,
|
|
337
|
+
center=(p.ra, p.dec),
|
|
338
|
+
radius_degrees=p.apparent_size / 2,
|
|
339
|
+
style=polygon_style,
|
|
338
340
|
gid="planet-marker",
|
|
339
341
|
)
|
|
340
342
|
self._add_legend_handle_marker(legend_label, style.marker)
|
|
@@ -404,10 +406,11 @@ class BasePlot(TextPlotterMixin, ABC):
|
|
|
404
406
|
polygon_style.edge_color = None
|
|
405
407
|
|
|
406
408
|
self.circle(
|
|
407
|
-
(s.ra, s.dec),
|
|
408
|
-
s.apparent_size,
|
|
409
|
+
center=(s.ra, s.dec),
|
|
410
|
+
radius_degrees=s.apparent_size / 2,
|
|
409
411
|
style=polygon_style,
|
|
410
412
|
gid="sun-marker",
|
|
413
|
+
num_pts=200,
|
|
411
414
|
)
|
|
412
415
|
|
|
413
416
|
style.marker.symbol = MarkerSymbolEnum.CIRCLE
|
|
@@ -631,14 +634,27 @@ class BasePlot(TextPlotterMixin, ABC):
|
|
|
631
634
|
)
|
|
632
635
|
|
|
633
636
|
@use_style(LineStyle)
|
|
634
|
-
def line(
|
|
637
|
+
def line(
|
|
638
|
+
self,
|
|
639
|
+
style: LineStyle,
|
|
640
|
+
coordinates: list[tuple[float, float]] = None,
|
|
641
|
+
geometry: LineString = None,
|
|
642
|
+
**kwargs,
|
|
643
|
+
):
|
|
635
644
|
"""Plots a line
|
|
636
645
|
|
|
637
646
|
Args:
|
|
638
647
|
coordinates: List of coordinates, e.g. `[(ra, dec), (ra, dec)]`
|
|
648
|
+
geometry: A shapely LineString. If this value is passed, then the `coordinates` kwarg will be ignored.
|
|
639
649
|
style: Style of the line
|
|
640
650
|
"""
|
|
641
|
-
|
|
651
|
+
|
|
652
|
+
if coordinates is None and geometry is None:
|
|
653
|
+
raise ValueError("Must pass coordinates or geometry when plotting lines.")
|
|
654
|
+
|
|
655
|
+
coords = geometry.coords if geometry is not None else coordinates
|
|
656
|
+
|
|
657
|
+
x, y = zip(*[self._prepare_coords(*p) for p in coords])
|
|
642
658
|
|
|
643
659
|
self.ax.plot(
|
|
644
660
|
x,
|
|
@@ -698,9 +714,9 @@ class BasePlot(TextPlotterMixin, ABC):
|
|
|
698
714
|
|
|
699
715
|
if show_phase:
|
|
700
716
|
self._moon_with_phase(
|
|
701
|
-
m.phase_description,
|
|
702
|
-
(m.ra, m.dec),
|
|
703
|
-
m.apparent_size,
|
|
717
|
+
moon_phase=m.phase_description,
|
|
718
|
+
center=(m.ra, m.dec),
|
|
719
|
+
radius_degrees=m.apparent_size / 2,
|
|
704
720
|
style=polygon_style,
|
|
705
721
|
dark_side_color=style.marker.edge_color,
|
|
706
722
|
)
|
|
@@ -795,8 +811,8 @@ class BasePlot(TextPlotterMixin, ABC):
|
|
|
795
811
|
# Plot left side
|
|
796
812
|
self.ellipse(
|
|
797
813
|
center,
|
|
798
|
-
radius_degrees * 2,
|
|
799
|
-
radius_degrees * 2,
|
|
814
|
+
height_degrees=radius_degrees * 2,
|
|
815
|
+
width_degrees=radius_degrees * 2,
|
|
800
816
|
style=left,
|
|
801
817
|
num_pts=num_pts,
|
|
802
818
|
angle=0,
|
|
@@ -806,8 +822,8 @@ class BasePlot(TextPlotterMixin, ABC):
|
|
|
806
822
|
# Plot right side
|
|
807
823
|
self.ellipse(
|
|
808
824
|
center,
|
|
809
|
-
radius_degrees * 2,
|
|
810
|
-
radius_degrees * 2,
|
|
825
|
+
height_degrees=radius_degrees * 2,
|
|
826
|
+
width_degrees=radius_degrees * 2,
|
|
811
827
|
style=right,
|
|
812
828
|
num_pts=num_pts,
|
|
813
829
|
angle=180,
|
|
@@ -817,8 +833,8 @@ class BasePlot(TextPlotterMixin, ABC):
|
|
|
817
833
|
# Plot middle
|
|
818
834
|
self.ellipse(
|
|
819
835
|
center,
|
|
820
|
-
radius_degrees * 2,
|
|
821
|
-
radius_degrees,
|
|
836
|
+
height_degrees=radius_degrees * 2,
|
|
837
|
+
width_degrees=radius_degrees,
|
|
822
838
|
style=middle,
|
|
823
839
|
gid="moon-marker",
|
|
824
840
|
)
|
starplot/plots/map.py
CHANGED
starplot/plots/zenith.py
CHANGED
|
@@ -128,6 +128,12 @@ class ZenithPlot(MapPlot):
|
|
|
128
128
|
**style.label.matplot_kwargs(self.scale),
|
|
129
129
|
)
|
|
130
130
|
|
|
131
|
+
def _adjust_radec_minmax(self):
|
|
132
|
+
self.ra_min = 0
|
|
133
|
+
self.ra_max = 360
|
|
134
|
+
self.dec_min = -90
|
|
135
|
+
self.dec_max = 90
|
|
136
|
+
|
|
131
137
|
def _set_extent(self):
|
|
132
138
|
theta = np.linspace(0, 2 * np.pi, 100)
|
|
133
139
|
center, radius = [0.5, 0.5], 0.45
|
starplot/plotters/text.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
-
from random import randrange
|
|
3
2
|
|
|
4
3
|
import numpy as np
|
|
5
4
|
import rtree
|
|
6
5
|
from shapely import Point
|
|
6
|
+
from shapely.errors import GEOSException
|
|
7
7
|
from matplotlib.text import Text
|
|
8
8
|
|
|
9
9
|
from starplot.config import settings as StarplotSettings, SvgTextType
|
|
10
10
|
from starplot.styles import AnchorPointEnum, LabelStyle
|
|
11
11
|
from starplot.styles.helpers import use_style
|
|
12
12
|
from starplot.geometry import (
|
|
13
|
-
unwrap_polygon_360,
|
|
14
13
|
random_point_in_polygon_at_distance,
|
|
14
|
+
union_at_zero,
|
|
15
15
|
)
|
|
16
16
|
|
|
17
17
|
"""
|
|
@@ -322,31 +322,69 @@ class TextPlotterMixin:
|
|
|
322
322
|
if StarplotSettings.svg_text_type == SvgTextType.PATH:
|
|
323
323
|
kwargs["path_effects"] = kwargs.get("path_effects", [self.text_border])
|
|
324
324
|
|
|
325
|
-
padding =
|
|
326
|
-
max_distance =
|
|
325
|
+
padding = 0
|
|
326
|
+
max_distance = 2_000
|
|
327
327
|
distance_step_size = 2
|
|
328
328
|
attempts = 0
|
|
329
329
|
height = None
|
|
330
330
|
width = None
|
|
331
331
|
bbox = None
|
|
332
|
-
|
|
333
|
-
[p for p in area.geoms] if "MultiPolygon" == str(area.geom_type) else [area]
|
|
334
|
-
)
|
|
335
|
-
new_areas = []
|
|
332
|
+
|
|
336
333
|
origin = Point(ra, dec)
|
|
337
334
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
335
|
+
total_area = (
|
|
336
|
+
area
|
|
337
|
+
if area.geom_type != "MultiPolygon"
|
|
338
|
+
else union_at_zero(area.geoms[0], area.geoms[1])
|
|
339
|
+
)
|
|
340
|
+
original_size = total_area.area
|
|
341
|
+
buffer = -0.05 if original_size < 400 else -1
|
|
342
|
+
|
|
343
|
+
# Intersect with extent
|
|
344
|
+
extent = self._extent_mask()
|
|
345
|
+
|
|
346
|
+
try:
|
|
347
|
+
area = area.intersection(extent)
|
|
348
|
+
except GEOSException:
|
|
349
|
+
# TODO : handle this better
|
|
350
|
+
pass
|
|
351
|
+
|
|
352
|
+
area = (
|
|
353
|
+
area
|
|
354
|
+
if area.geom_type != "MultiPolygon"
|
|
355
|
+
else union_at_zero(area.geoms[0], area.geoms[1])
|
|
356
|
+
)
|
|
357
|
+
area = area.buffer(buffer, cap_style="square", join_style="mitre")
|
|
358
|
+
|
|
359
|
+
if not area.contains(origin) or area.area < (original_size * 0.9):
|
|
360
|
+
origin = area.centroid
|
|
361
|
+
|
|
362
|
+
if self.debug_text and area.is_valid and not origin.is_empty:
|
|
363
|
+
"""Plots marker at origin and polygon of area"""
|
|
364
|
+
self.marker(
|
|
365
|
+
origin.x,
|
|
366
|
+
origin.y,
|
|
367
|
+
style={
|
|
368
|
+
"marker": {
|
|
369
|
+
"symbol": "triangle",
|
|
370
|
+
"color": "red",
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
)
|
|
374
|
+
self.polygon(
|
|
375
|
+
geometry=area,
|
|
376
|
+
style={
|
|
377
|
+
"edge_color": "red",
|
|
378
|
+
"edge_width": 2,
|
|
379
|
+
},
|
|
380
|
+
)
|
|
344
381
|
|
|
345
382
|
for d in range(0, max_distance, distance_step_size):
|
|
346
|
-
|
|
347
|
-
|
|
383
|
+
if not area.contains(origin):
|
|
384
|
+
continue
|
|
385
|
+
distance = d / 25
|
|
348
386
|
point = random_point_in_polygon_at_distance(
|
|
349
|
-
|
|
387
|
+
area,
|
|
350
388
|
origin_point=origin,
|
|
351
389
|
distance=distance,
|
|
352
390
|
max_iterations=10,
|
|
@@ -438,7 +476,7 @@ class TextPlotterMixin:
|
|
|
438
476
|
style.offset_y = 0
|
|
439
477
|
|
|
440
478
|
if kwargs.get("area"):
|
|
441
|
-
|
|
479
|
+
label = self._text_area(
|
|
442
480
|
ra,
|
|
443
481
|
dec,
|
|
444
482
|
text,
|
|
@@ -451,7 +489,7 @@ class TextPlotterMixin:
|
|
|
451
489
|
**kwargs,
|
|
452
490
|
)
|
|
453
491
|
else:
|
|
454
|
-
|
|
492
|
+
label = self._text_point(
|
|
455
493
|
ra,
|
|
456
494
|
dec,
|
|
457
495
|
text,
|
|
@@ -462,3 +500,25 @@ class TextPlotterMixin:
|
|
|
462
500
|
textcoords="offset points",
|
|
463
501
|
**kwargs,
|
|
464
502
|
)
|
|
503
|
+
|
|
504
|
+
if self.debug_text and label:
|
|
505
|
+
"""Plots bounding box around label"""
|
|
506
|
+
from matplotlib.patches import Rectangle
|
|
507
|
+
|
|
508
|
+
bbox = label.get_window_extent(renderer=self.fig.canvas.get_renderer())
|
|
509
|
+
bbox = bbox.transformed(self.ax.transAxes.inverted())
|
|
510
|
+
rect = Rectangle(
|
|
511
|
+
(bbox.x0, bbox.y0), # (x, y) position in display pixels
|
|
512
|
+
width=bbox.width,
|
|
513
|
+
height=bbox.height,
|
|
514
|
+
transform=self.ax.transAxes,
|
|
515
|
+
fill=False,
|
|
516
|
+
facecolor="none",
|
|
517
|
+
edgecolor="red",
|
|
518
|
+
linewidth=1,
|
|
519
|
+
alpha=1,
|
|
520
|
+
zorder=100_000,
|
|
521
|
+
)
|
|
522
|
+
self.ax.add_patch(rect)
|
|
523
|
+
|
|
524
|
+
return label
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
starplot/__init__.py,sha256=
|
|
1
|
+
starplot/__init__.py,sha256=bHPp8kjV-1kjqngkE4G5ms_NgLCgpD1Vr1NvkpD8sg8,964
|
|
2
2
|
starplot/callables.py,sha256=k8Ra0nmNfc8vjOpNPdQfAqpNaM2ajCPB3XkgzCqrcQ0,4039
|
|
3
3
|
starplot/cli.py,sha256=Tjkc_5khvb1mL_Ai_met__zViINvtL4SgbYc0_mB2_U,622
|
|
4
|
-
starplot/config.py,sha256=
|
|
4
|
+
starplot/config.py,sha256=8IbQTlQP-e7Yvv63zS9z5Ifcumr696MvdGT3JDvV-ik,2919
|
|
5
5
|
starplot/coordinates.py,sha256=7LDz32VTKa8H-4F67-XvzmjpcTVojZwYVJzXZkBaZ3U,136
|
|
6
|
-
starplot/geod.py,sha256=
|
|
7
|
-
starplot/geometry.py,sha256=
|
|
8
|
-
starplot/mixins.py,sha256=
|
|
6
|
+
starplot/geod.py,sha256=au25V21-sexxIPXUbN02nfd9pxOzwjdCxyUXDDsUIZc,2611
|
|
7
|
+
starplot/geometry.py,sha256=NYhfaNJtl-Cbtyq1IfrQimaqKChm9ZNQNsRdpYLR0PU,7248
|
|
8
|
+
starplot/mixins.py,sha256=PoSn8QfLS-P8dUF8rNrFOvhs9yb4D-ZRV2R1-1DSiaA,12536
|
|
9
9
|
starplot/profile.py,sha256=V5LOZFDdnGo-P8ikWvV3jmUVJIKO3gd4H2bjBlk7aUM,300
|
|
10
10
|
starplot/projections.py,sha256=6mj8uJkWE-79giXF-OVS8ixUbbojOHuwI51C-ovHyIo,5101
|
|
11
11
|
starplot/utils.py,sha256=49m8QXJl188Pgpef_82gyykly7ZjfAuHVEcSA5QFITA,3720
|
|
12
12
|
starplot/warnings.py,sha256=uKvGSAVpWKZIHMKxxegO5owFJnKvBYLyq3pJatD0qQ4,594
|
|
13
13
|
starplot/data/__init__.py,sha256=GBJw579v-5ZNsKk1RxE7Fdnjf4hDIW2gevQJAZ7-6b0,550
|
|
14
|
-
starplot/data/catalogs.py,sha256=
|
|
15
|
-
starplot/data/constellations.py,sha256
|
|
14
|
+
starplot/data/catalogs.py,sha256=Izf2XjKDIcLA-sM9TEL8Csg5CSizYxmvhHq_UXSHMt0,12010
|
|
15
|
+
starplot/data/constellations.py,sha256=-fjneGcLTIxZMxrTQRRoHaMKWy1taW6rQQ3RQ7LWgnE,2330
|
|
16
16
|
starplot/data/db.py,sha256=8SMDx6IkWqhnS2QobL5bp6qD0yze7P05C7b0ls_dbXk,669
|
|
17
17
|
starplot/data/dsos.py,sha256=8rp_Heme3bYFFWUuAPlWMHlfzsMsZ2W_Lq2jwgSWlQ8,2377
|
|
18
18
|
starplot/data/ecliptic.py,sha256=Qre9YdFbTC9mAx-vd2C0Ou4CsnRehIScnTpmEUDDYcM,4638
|
|
@@ -26,23 +26,23 @@ starplot/data/library/star_designations.parquet,sha256=WJLiv73VoVfptWT1oK1zzgio5
|
|
|
26
26
|
starplot/models/__init__.py,sha256=jypNZ_41BtVbV4xS7QDAwwey7rTxUTXNKuXIAV3HhE8,468
|
|
27
27
|
starplot/models/base.py,sha256=wIoxP96wPc8glIFUgFhSeCtzU_pz597vWBdveqSoBNY,2175
|
|
28
28
|
starplot/models/comet.py,sha256=pG_yNVmWCNCaAEZGhAoeRtDe8FaDKWmsqt9-6BCicUo,11210
|
|
29
|
-
starplot/models/constellation.py,sha256=
|
|
29
|
+
starplot/models/constellation.py,sha256=aDoh1wWB4za92gHSCwxl86aVhOtXZdcrYblVSAVhrog,4908
|
|
30
30
|
starplot/models/dso.py,sha256=Iehc1VGkpQsZDEVIft7KZyjXUevesg3FgBUsWU_Gc3E,9019
|
|
31
31
|
starplot/models/milky_way.py,sha256=8ll-JV_PH9J0xOUL7R-t3vdcHTrynU0fuZD-R8LiVWI,889
|
|
32
|
-
starplot/models/moon.py,sha256=
|
|
32
|
+
starplot/models/moon.py,sha256=QLzANZ59ghG0fK0RJXjg8vdegJHPcAA8DgQPUBpHBUw,4628
|
|
33
33
|
starplot/models/objects.py,sha256=BXwUMT-zPiOYBWYV7L-TRDfPo6lsx_AIk3yxJ3qi0ck,683
|
|
34
34
|
starplot/models/observer.py,sha256=x55ZaW4sSRtdM1prNo2bCiAfM4mdAlTf-xh00GVnKAE,2048
|
|
35
35
|
starplot/models/optics.py,sha256=6quf3Cxga5pjTunchtGe2OKCU6hgsm5yg7NfYWIfoNA,9314
|
|
36
|
-
starplot/models/planet.py,sha256=
|
|
36
|
+
starplot/models/planet.py,sha256=G-MpJGydmakCqSnXu6G3MdjyFXNtfWI51ST8ewYJh6w,4749
|
|
37
37
|
starplot/models/satellite.py,sha256=X5StTyVjpWQ94FT21OU8ArzxrdIDGB581bstWFNvT3k,5228
|
|
38
38
|
starplot/models/star.py,sha256=0EkqS-i2ErLVPFY7GYqEWWIqhaiZU0RwDDJiIVABua4,6970
|
|
39
|
-
starplot/models/sun.py,sha256=
|
|
39
|
+
starplot/models/sun.py,sha256=L93DKFFgfzVuwESA-8C6g7-gUC4D5tix41SabZ-WP84,2414
|
|
40
40
|
starplot/plots/__init__.py,sha256=YtvBn2ClaGrmnOfFKdXs9duOZNBmRDvZwNJYF_7TTPU,143
|
|
41
|
-
starplot/plots/base.py,sha256=
|
|
41
|
+
starplot/plots/base.py,sha256=ZabMdrdoiSQ08KlzwHileWaFv1PRCD9RZBPm5vVU9qo,33606
|
|
42
42
|
starplot/plots/horizon.py,sha256=a2a78DPnlmnYyp1xucsQdAR7SepPp2Q6SCPAlu2ygsk,20374
|
|
43
|
-
starplot/plots/map.py,sha256=
|
|
43
|
+
starplot/plots/map.py,sha256=gyCU5mIm_prUg7gtsKjKO7ppBuwhJNwQoJ1vIEK93TQ,19454
|
|
44
44
|
starplot/plots/optic.py,sha256=0kgj6UC_MouoG5hrywW9zseCR5TtpYlPsoT-XGoqwyo,17305
|
|
45
|
-
starplot/plots/zenith.py,sha256=
|
|
45
|
+
starplot/plots/zenith.py,sha256=i_83cXpNk2KB81hFhqUw6ConLzUKyrzb2NxoWxjZCwk,7792
|
|
46
46
|
starplot/plotters/__init__.py,sha256=RzsH2t4PbdsEMBjcgIhQ_ng7fIgjW4CobQcwtGo9oTc,315
|
|
47
47
|
starplot/plotters/arrow.py,sha256=hI2-WGSWjMwK5rax4cMDsjorX2ILylnn1RbWNHbPq5g,6583
|
|
48
48
|
starplot/plotters/constellations.py,sha256=xT_QXHIbUvRKztLe1tjju5BWjfE9ro3Mi5YilHgTQtc,11787
|
|
@@ -52,7 +52,7 @@ starplot/plotters/gradients.py,sha256=ZonNeIEmbcZZWjFtlPahGtGCgeTCeimp84PZnqj8dX
|
|
|
52
52
|
starplot/plotters/legend.py,sha256=PwqhSQkYsxPNLMabL0Ox5eo0F3jMS4Ekhm2aHaHS3W4,8761
|
|
53
53
|
starplot/plotters/milkyway.py,sha256=U5uRE4teoWk2v65RC2SkMKPX1LurR6zw7vzLK5mVxJE,1605
|
|
54
54
|
starplot/plotters/stars.py,sha256=rM8LJxCC1mwZjKr-OpcH6g4SlOwUlm-8yI1DSzaLbCQ,11660
|
|
55
|
-
starplot/plotters/text.py,sha256=
|
|
55
|
+
starplot/plotters/text.py,sha256=r1_G4Oe487RxEl0Tjv_8964YfD644H-sdIvqPbK1Eck,16907
|
|
56
56
|
starplot/styles/__init__.py,sha256=HmIDU0cFu4ar8zKet_FEJoNdButQHJMprHnL_4JE2Mc,123
|
|
57
57
|
starplot/styles/base.py,sha256=9xeU0lhTO3eaqVMz1QmS7HMtRQ-OdtUwBP96kzQ7cO4,40881
|
|
58
58
|
starplot/styles/extensions.py,sha256=qVNE9DaSvG8BPr6vPfT8v5vyZNBYB0AjkR-e9oPMk1I,2707
|
|
@@ -90,8 +90,8 @@ starplot/styles/fonts-library/inter/Inter-Regular.ttf,sha256=ZPi-blXDfjLvA9qZcUv
|
|
|
90
90
|
starplot/styles/fonts-library/inter/Inter-SemiBold.ttf,sha256=DcmOiqWVhTlIgPJauJ5tkVrVE0Ui6WGwRspR-tOhglU,413976
|
|
91
91
|
starplot/styles/fonts-library/inter/Inter-SemiBoldItalic.ttf,sha256=HhKJRT16iVz7c1adSFFjTIsOSdFQxN1S1Ev10gaQgnI,418520
|
|
92
92
|
starplot/styles/fonts-library/inter/LICENSE.txt,sha256=JiSB6ERSGzJvXs0FPlm5jIstp4yO4b27boF0MF5Uk1o,4380
|
|
93
|
-
starplot-0.19.
|
|
94
|
-
starplot-0.19.
|
|
95
|
-
starplot-0.19.
|
|
96
|
-
starplot-0.19.
|
|
97
|
-
starplot-0.19.
|
|
93
|
+
starplot-0.19.2.dist-info/entry_points.txt,sha256=Sm6jC6h_RcaMGC8saLnYmT0SdhcF9_rMeQIiHneLHyc,46
|
|
94
|
+
starplot-0.19.2.dist-info/licenses/LICENSE,sha256=jcjClHF4BQwhz-kDgia-KphO9Zxu0rCa2BbiA7j1jeU,1070
|
|
95
|
+
starplot-0.19.2.dist-info/WHEEL,sha256=Dyt6SBfaasWElUrURkknVFAZDHSTwxg3PaTza7RSbkY,100
|
|
96
|
+
starplot-0.19.2.dist-info/METADATA,sha256=RiagUiM6UY4PQd2kYrSEOqDjURoTlV6z04vJbJYvwu4,5497
|
|
97
|
+
starplot-0.19.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|