Skip to content

Commit 86af6e1

Browse files
authored
v0.7.0 (#42)
* crs initial poc * camera rotation * fix bounds * crs * finder charts * relative star sizer * fix star sizer * use geopackage * format * bump version * fix reflector transform * scope test * clean up * update examples * cleanup
1 parent 4710ab7 commit 86af6e1

26 files changed

+420
-12527
lines changed

docs/images/example_03.png

54 Bytes
Loading

docs/images/example_04.png

11 Bytes
Loading

docs/images/example_05.png

4.7 KB
Loading

examples/03_map_orion.png

54 Bytes
Loading

examples/04_map_m45_scope.png

11 Bytes
Loading

examples/05_optic_m45.png

4.7 KB
Loading

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies = [
3232
"PyOngc >= 1.0.1",
3333
"pyarrow >= 14.0.2",
3434
"fastparquet >= 2023.10.1",
35+
"pyogrio >= 0.7.2",
3536
]
3637

3738
[project.urls]

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ PyYAML==6.0.1
1212
PyOngc==1.0.1
1313
pyarrow==14.0.2
1414
fastparquet==2023.10.1
15+
pyogrio==0.7.2

scripts/finder.py

+81-36
Original file line numberDiff line numberDiff line change
@@ -21,46 +21,76 @@
2121

2222
sky_object_style = {
2323
"marker": {
24-
"size": 16,
25-
"symbol": "D",
24+
"size": 15,
25+
"symbol": "^",
2626
"fill": "full",
2727
"color": "#000",
2828
},
2929
"label": {
3030
"font_size": 12,
3131
"font_weight": "bold",
32-
"font_color": "black",
32+
# "font_color": "white",
3333
},
3434
}
3535

3636
sky_objects = [
37-
# SkyObject(
38-
# name="M35",
39-
# ra=6.15,
40-
# dec=24.34,
41-
# style=sky_object_style,
42-
# ),
4337
SkyObject(
44-
name="M45",
45-
ra=3.7836111111,
46-
dec=24.1166666667,
38+
name="M35",
39+
ra=6.15,
40+
dec=24.34,
4741
style=sky_object_style,
4842
),
43+
SkyObject(
44+
name="M44",
45+
ra=8.667,
46+
dec=19.67,
47+
style=sky_object_style,
48+
),
49+
# SkyObject(
50+
# name="M41",
51+
# ra=6.7667,
52+
# dec=-20.75,
53+
# style=sky_object_style,
54+
# ),
55+
# SkyObject(
56+
# name="M46",
57+
# ra=7.7,
58+
# dec=-14.81,
59+
# style=sky_object_style,
60+
# ),
61+
# SkyObject(
62+
# name="M47",
63+
# ra=7.6,
64+
# dec=-14.48,
65+
# style=sky_object_style,
66+
# ),
67+
# SkyObject(
68+
# name="M93",
69+
# ra=7.73,
70+
# dec=-23.85,
71+
# style=sky_object_style,
72+
# ),
73+
# SkyObject(
74+
# name="M45",
75+
# ra=3.7836111111,
76+
# dec=24.1166666667,
77+
# style=sky_object_style,
78+
# ),
4979
]
5080

5181
optics = [
52-
sp.optic.Binoculars(
82+
sp.optics.Binoculars(
5383
magnification=10,
5484
fov=65,
5585
),
56-
sp.optic.Refractor(
57-
focal_length=600,
58-
eyepiece_focal_length=14,
59-
eyepiece_fov=82,
60-
),
61-
sp.optic.Refractor(
86+
# sp.optics.Refractor(
87+
# focal_length=600,
88+
# eyepiece_focal_length=14,
89+
# eyepiece_fov=82,
90+
# ),
91+
sp.optics.Refractor(
6292
focal_length=600,
63-
eyepiece_focal_length=7,
93+
eyepiece_focal_length=9,
6494
eyepiece_fov=100,
6595
),
6696
]
@@ -77,46 +107,57 @@ def create_zenith():
77107
extensions.GRAYSCALE,
78108
extensions.ZENITH,
79109
)
110+
style.dso.marker.visible = False
111+
style.dso.label.visible = False
112+
80113
p = sp.ZenithPlot(
81114
lat=lat,
82115
lon=lon,
83116
dt=dt,
84117
limiting_magnitude=4.6,
85118
style=style,
86119
resolution=4000,
87-
include_info_text=True,
88-
adjust_text=True,
120+
hide_colliding_labels=False,
121+
# include_info_text=True,
122+
# adjust_text=True,
89123
)
90124

91125
for obj in sky_objects:
92126
p.plot_object(obj)
93127

94128
p.refresh_legend()
95-
p.export("temp/finder-01-overview.png", format="png", transparent=True)
129+
p.adjust_labels()
130+
p.export("temp/finder-01-overview.svg", format="svg", padding=0, transparent=True)
96131

97132

98-
def create_map_plot():
99-
print("Creating map chart...")
133+
def create_map_plots():
134+
print("Creating map charts...")
100135
style = PlotStyle().extend(
101136
# extensions.MINIMAL,
102137
extensions.GRAYSCALE,
103138
extensions.MAP,
104139
)
140+
style.legend.location = "lower right"
141+
style.gridlines.line.alpha = 0
142+
style.milky_way.visible = False
143+
style.bayer_labels.visible = False
105144

106-
for obj in sky_objects:
145+
for i, obj in enumerate(sky_objects):
107146
mp = sp.MapPlot(
108147
projection=Projection.MERCATOR,
109-
ra_min=obj.ra - 2,
110-
ra_max=obj.ra + 2,
111-
dec_min=obj.dec - 15,
112-
dec_max=obj.dec + 15,
113-
limiting_magnitude=7.2,
148+
ra_min=obj.ra - 2.5,
149+
ra_max=obj.ra + 2.5,
150+
dec_min=obj.dec - 20,
151+
dec_max=obj.dec + 20,
152+
limiting_magnitude=4.68,
114153
style=style,
115154
resolution=2600,
155+
hide_colliding_labels=False,
116156
)
117157
mp.plot_object(obj)
158+
mp.adjust_labels()
118159

119-
mp.export(f"temp/finder-02-map.png", padding=0.3)
160+
mp.export(f"temp/finder-02-map-{str(i)}.svg", format="svg", padding=0.3)
120161

121162

122163
def create_optic_plots():
@@ -126,9 +167,10 @@ def create_optic_plots():
126167
extensions.GRAYSCALE,
127168
extensions.OPTIC,
128169
)
170+
style.star.marker.size = 30
129171

130-
for obj in sky_objects:
131-
for i, optic in enumerate(optics):
172+
for si, obj in enumerate(sky_objects):
173+
for oi, optic in enumerate(optics):
132174
op = sp.OpticPlot(
133175
ra=obj.ra,
134176
dec=obj.dec,
@@ -141,9 +183,12 @@ def create_optic_plots():
141183
resolution=2000,
142184
include_info_text=True,
143185
)
144-
op.export(f"temp/finder-03-optic-{str(i)}-{optic.label.lower()}.png")
186+
op.export(
187+
f"temp/finder-03-optic-{str(si)}-{str(oi)}-{optic.label.lower()}.svg",
188+
format="svg",
189+
)
145190

146191

147192
create_zenith()
148-
create_map_plot()
193+
create_map_plots()
149194
create_optic_plots()

scripts/geopack.py

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Converts GeoJSON to GeoPackage"""
2+
3+
import geopandas as gpd
4+
5+
from starplot.data import DataFiles
6+
7+
constellation_borders = gpd.read_file(DataFiles.CONSTELLATION_BORDERS.value)
8+
constellation_borders.to_file("temp/constellation_borders.gpkg", driver="GPKG")
9+
10+
constellation_lines = gpd.read_file(DataFiles.CONSTELLATION_LINES.value)
11+
constellation_lines.to_file("temp/constellation_lines.gpkg", driver="GPKG")
12+
13+
milkyway = gpd.read_file(DataFiles.MILKY_WAY.value)
14+
milkyway.to_file("temp/milkyway.gpkg", driver="GPKG")

0 commit comments

Comments
 (0)