Skip to content

Commit 8f5562a

Browse files
authored
v0.10.1 (#74)
* calculate apparent position * version * version * hash checks * format
1 parent 6a13766 commit 8f5562a

17 files changed

+292
-63
lines changed

docs/changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
- Adds Pluto as a planet :)
1212
- Fixes clipping issues with polygons
1313
- Fixes a few issues with gridlines
14+
- [**v0.10.1**]
15+
- Fixes bug with plotting planets as true apparent size
16+
- Adds lat/lon kwargs to Sun/Moon/Planet models to allow _apparent_ RA/DEC calculation
17+
1418

1519
## v0.9.x
1620
[Documentation](https://archives.starplot.dev/0.9.1/)

docs/examples.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -36,52 +36,68 @@
3636

3737
<li>
3838
<a href="/examples/optic-m45">
39-
<img src="/images/examples/optic_m45.png" alt="Optic Plot of the Pleiades" class="off-glb"/>
39+
<img src="/images/examples/optic_m45.png" alt="Optic Plot of the Pleiades" class="off-glb" loading="lazy"/>
4040

4141
<p class="example-card-title">Optic Plot of the Pleiades</p>
4242
</a>
4343
</li>
4444

4545
<li>
4646
<a href="/examples/optic-orion">
47-
<img src="/images/examples/optic_orion_nebula.png" alt="Optic Plot of the Orion Nebula" class="off-glb"/>
47+
<img src="/images/examples/optic_orion_nebula.png" alt="Optic Plot of the Orion Nebula" class="off-glb" loading="lazy"/>
4848

4949
<p class="example-card-title">Optic Plot of the Orion Nebula</p>
5050
</a>
5151
</li>
5252

5353
<li>
5454
<a href="/examples/map-big-dipper">
55-
<img src="/images/examples/map_big_dipper.png" alt="Map of the Big Dipper" class="off-glb"/>
55+
<img src="/images/examples/map_big_dipper.png" alt="Map of the Big Dipper" class="off-glb" loading="lazy"/>
5656

5757
<p class="example-card-title">Map of the Big Dipper</p>
5858
</a>
5959
</li>
6060

6161
<li>
6262
<a href="/examples/map-hale-bopp-comet">
63-
<img src="/images/examples/map_hale_bopp.png" alt="Map of Hale-Bopp in 1997" class="off-glb"/>
63+
<img src="/images/examples/map_hale_bopp.png" alt="Map of Hale-Bopp in 1997" class="off-glb" loading="lazy"/>
6464

6565
<p class="example-card-title">Map of Hale-Bopp in 1997</p>
6666
</a>
6767
</li>
6868

6969
<li>
7070
<a href="/examples/map-sagittarius">
71-
<img src="/images/examples/map_sagittarius.png" alt="Map of Sagittarius" class="off-glb"/>
71+
<img src="/images/examples/map_sagittarius.png" alt="Map of Sagittarius" class="off-glb" loading="lazy"/>
7272

7373
<p class="example-card-title">Map of Sagittarius</p>
7474
</a>
7575
</li>
7676

7777
<li>
7878
<a href="/examples/map-orthographic">
79-
<img src="/images/examples/map_orthographic.png" alt="Orthographic Map" class="off-glb"/>
79+
<img src="/images/examples/map_orthographic.png" alt="Orthographic Map" class="off-glb" loading="lazy"/>
8080

8181
<p class="example-card-title">Orthographic Map</p>
8282
</a>
8383
</li>
8484

85+
<li>
86+
<a href="/examples/optic-solar-eclipse">
87+
<img src="/images/examples/optic_solar_eclipse.png" alt="Total Solar Eclipse 2024" class="off-glb" loading="lazy"/>
88+
89+
<p class="example-card-title">Total Solar Eclipse 2024</p>
90+
</a>
91+
</li>
92+
93+
<li>
94+
<a href="/examples/optic-moon-saturn">
95+
<img src="/images/examples/optic_moon_saturn.png" alt="Moon and Saturn Conjunction" class="off-glb" loading="lazy"/>
96+
97+
<p class="example-card-title">Moon and Saturn Conjunction</p>
98+
</a>
99+
</li>
100+
85101
</ul>
86102

87103

docs/examples/optic-moon-saturn.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Moon and Saturn Conjunction
3+
---
4+
[:octicons-arrow-left-24: Back to Examples](/examples)
5+
6+
# Moon and Saturn Conjunction {.example-header}
7+
8+
![optic-moon-saturn](/images/examples/optic_moon_saturn.png)
9+
10+
```python
11+
--8<-- "examples/optic_moon_saturn.py"
12+
```

docs/examples/optic-solar-eclipse.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Total Solar Eclipse 2024
3+
---
4+
[:octicons-arrow-left-24: Back to Examples](/examples)
5+
6+
# Total Solar Eclipse 2024 {.example-header}
7+
8+
![optic-moon-saturn](/images/examples/optic_solar_eclipse.png)
9+
10+
This example shows the Moon and Sun _about 30 minutes before_ the total solar eclipse that occurred on [April 8, 2024](https://en.wikipedia.org/wiki/Solar_eclipse_of_April_8,_2024), as seen from Cleveland, Ohio.
11+
12+
The total eclipse started at 15:13:46 Eastern Time, so if you set that as the time then you'll see the dark moon completely block the Sun (you can confirm the Sun was plotted by accessing the plot's [`objects.sun`][starplot.OpticPlot.objects] property).
13+
14+
```python
15+
--8<-- "examples/optic_solar_eclipse.py"
16+
```

examples/optic_moon_saturn.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from datetime import datetime
2+
from pytz import timezone
3+
4+
from starplot import Moon, optics
5+
from starplot.styles import PlotStyle, extensions
6+
7+
dt = datetime.now(timezone("US/Pacific")).replace(2024, 8, 20, 21, 0, 0)
8+
9+
# Julian, CA
10+
lat = 33.070833
11+
lon = -116.585556
12+
13+
m = Moon.get(dt=dt, lat=lat, lon=lon)
14+
15+
op = m.create_optic(
16+
lat=lat,
17+
lon=lon,
18+
dt=dt,
19+
optic=optics.Binoculars(magnification=15, fov=65),
20+
style=PlotStyle().extend(extensions.GRAYSCALE_DARK, extensions.OPTIC),
21+
resolution=2000,
22+
)
23+
op.moon(
24+
true_size=True,
25+
show_phase=True,
26+
)
27+
op.planets(
28+
true_size=True,
29+
style__marker__color="#ffe785",
30+
style__label__offset_x=14,
31+
style__label__offset_y=-14,
32+
)
33+
op.stars(mag=12)
34+
35+
op.export("optic_moon_saturn.png", padding=0.1, transparent=True)

examples/optic_solar_eclipse.py

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
from datetime import datetime
2+
from pytz import timezone
3+
4+
from starplot import Moon, optics
5+
from starplot.styles import PlotStyle, extensions
6+
7+
# time of partial eclipse. total eclipse started at 15:13:46
8+
eastern = timezone("US/Eastern")
9+
dt = eastern.localize(datetime(2024, 4, 8, 14, 40, 47, 0))
10+
11+
# Cleveland, Ohio
12+
lat = 41.482222
13+
lon = -81.669722
14+
15+
m = Moon.get(dt=dt, lat=lat, lon=lon)
16+
17+
op = m.create_optic(
18+
lat=lat,
19+
lon=lon,
20+
dt=dt,
21+
optic=optics.Binoculars(magnification=20, fov=65),
22+
style=PlotStyle().extend(extensions.BLUE_DARK, extensions.OPTIC),
23+
resolution=2000,
24+
)
25+
op.moon(
26+
true_size=True,
27+
show_phase=True,
28+
label=None,
29+
)
30+
op.sun(
31+
true_size=True,
32+
style__marker__color="#ffd22e",
33+
label=None,
34+
)
35+
36+
op.export("optic_solar_eclipse.png", padding=0.1, transparent=True)

hash_checks/hashlock.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ map_mollweide:
1515
filename: /starplot/hash_checks/data/map-mollweide.png
1616
phash: fa9ae698c0259567
1717
map_moon_phase_waxing_crescent:
18-
dhash: 8884884d4d88808c8884884d4d88808c8884884d4d88808c
18+
dhash: 8884484d4d4884888884484d4d4884888884484d4d488488
1919
filename: /starplot/hash_checks/data/map-moon-phase-waxing-crescent.png
2020
phash: b3cccc3333cccc31
2121
map_orion_base:
@@ -67,15 +67,15 @@ optic_m45_scope:
6767
filename: /starplot/hash_checks/data/optic-m45-scope.png
6868
phash: ae7b84e48393ce92
6969
optic_moon_phase_full:
70-
dhash: 0e2b513333512b0e0e2b513333512b0e0e2b513333512b0e
70+
dhash: 0e2b553333552b0e0e2b553333552b0e0e2b553333552b0e
7171
filename: /starplot/hash_checks/data/optic-moon-phase-full.png
72-
phash: fb3ea02295f09734
72+
phash: fb3ea02295349735
7373
optic_moon_phase_new:
74-
dhash: 0f61cc8e8ecc610f0f61cc8e8ecc610f0f61cc8e8ecc610f
74+
dhash: 17498e96968e491717498e96968e491717498e96968e4917
7575
filename: /starplot/hash_checks/data/optic-moon-phase-new.png
76-
phash: e661998966339e36
76+
phash: e5719e82691d6633
7777
optic_moon_phase_waxing_crescent:
78-
dhash: 0e33454959712b0e0e33454959712b0e0e33454959712b0e
78+
dhash: 0e33454d59712b0e0e33454d59712b0e0e33454d59712b0e
7979
filename: /starplot/hash_checks/data/optic-moon-phase-waxing-crescent.png
8080
phash: bb26e4999166c699
8181
optic_orion_nebula_refractor:
@@ -87,9 +87,9 @@ optic_polaris_binoculars:
8787
filename: /starplot/hash_checks/data/optic-binoculars-polaris.png
8888
phash: aa7b84f186d38e92
8989
optic_solar_eclipse_binoculars:
90-
dhash: 0f71ccccccf069170f71ccccccf069172b61ccccccc06903
90+
dhash: 0769f0cccccc710f1769f0cccccc710f2369c0cccccc610b
9191
filename: /starplot/hash_checks/data/optic-binoculars-eclipse.png
92-
phash: b323cccc3333cccc
92+
phash: b38ccc3333cccc33
9393
optic_wrapping:
9494
dhash: 71e0ac90dae8752a71e0a4aca4e4792a71e0a4aca4c47932
9595
filename: /starplot/hash_checks/data/optic-wrapping.png

hash_checks/map_checks.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
)
1616
RESOLUTION = 3200
1717

18+
POWAY = {"lat": 32.97, "lon": -117.038611}
19+
1820
dt_dec_16 = datetime.now(timezone("US/Pacific")).replace(2023, 12, 16, 21, 0, 0)
1921

2022

@@ -319,13 +321,12 @@ def check_map_gridlines():
319321

320322

321323
def check_map_moon_phase_waxing_crescent():
322-
m = Moon.get(dt=dt_dec_16)
324+
m = Moon.get(dt=dt_dec_16, **POWAY)
323325
p = m.create_map(
324326
height_degrees=4,
325327
width_degrees=4,
326328
projection=Projection.MILLER,
327-
lat=32.97,
328-
lon=-117.038611,
329+
**POWAY,
329330
dt=dt_dec_16,
330331
style=STYLE,
331332
)
@@ -334,6 +335,13 @@ def check_map_moon_phase_waxing_crescent():
334335
show_phase=True,
335336
label=None,
336337
)
338+
p.gridlines(
339+
ra_locations=list(np.arange(0, 24, 0.05)),
340+
ra_formatter_fn=lambda d: None,
341+
dec_formatter_fn=lambda d: None,
342+
dec_locations=list(np.arange(-90, 90, 0.25)),
343+
style__line__alpha=0.2,
344+
)
337345
filename = DATA_PATH / "map-moon-phase-waxing-crescent.png"
338346
p.export(filename)
339347
p.close_fig()

hash_checks/optic_checks.py

+11-15
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
HERE = Path(__file__).resolve().parent
99
DATA_PATH = HERE / "data"
1010

11-
dt_dec_16 = datetime.now(timezone("US/Pacific")).replace(2023, 12, 16, 21, 0, 0)
12-
dt_april_8 = datetime.now(timezone("US/Pacific")).replace(2024, 4, 8, 11, 7, 0)
11+
dt_dec_16 = datetime.now(timezone("US/Pacific")).replace(2023, 12, 16, 21, 0, 0, 0)
12+
dt_april_8 = datetime.now(timezone("US/Pacific")).replace(2024, 4, 8, 11, 7, 0, 0)
1313

1414
style_light = styles.PlotStyle().extend(
1515
styles.extensions.GRAYSCALE,
@@ -24,6 +24,8 @@
2424
styles.extensions.OPTIC,
2525
)
2626

27+
POWAY = {"lat": 32.97, "lon": -117.038611}
28+
2729

2830
def check_optic_polaris_binoculars():
2931
optic_plot = OpticPlot(
@@ -278,11 +280,9 @@ def check_optic_solar_eclipse_binoculars():
278280

279281

280282
def check_optic_moon_phase_waxing_crescent():
281-
m = Moon.get(dt=dt_dec_16)
283+
m = Moon.get(dt=dt_dec_16, **POWAY)
282284
optic_plot = m.create_optic(
283-
lat=32.97,
284-
lon=-117.038611,
285-
# 10x binoculars
285+
**POWAY,
286286
optic=optics.Binoculars(
287287
magnification=20,
288288
fov=65,
@@ -303,13 +303,11 @@ def check_optic_moon_phase_waxing_crescent():
303303

304304

305305
def check_optic_moon_phase_new():
306-
m = Moon.get(dt=dt_april_8)
306+
m = Moon.get(dt=dt_april_8, **POWAY)
307307
optic_plot = m.create_optic(
308-
lat=32.97,
309-
lon=-117.038611,
310-
# 10x binoculars
308+
**POWAY,
311309
optic=optics.Binoculars(
312-
magnification=20,
310+
magnification=30,
313311
fov=65,
314312
),
315313
dt=dt_april_8,
@@ -329,11 +327,9 @@ def check_optic_moon_phase_new():
329327

330328
def check_optic_moon_phase_full():
331329
dt_full_moon = datetime.now(timezone("US/Pacific")).replace(2024, 4, 23, 11, 7, 0)
332-
m = Moon.get(dt=dt_full_moon)
330+
m = Moon.get(dt=dt_full_moon, **POWAY)
333331
optic_plot = m.create_optic(
334-
lat=32.97,
335-
lon=-117.038611,
336-
# 10x binoculars
332+
**POWAY,
337333
optic=optics.Binoculars(
338334
magnification=20,
339335
fov=65,

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ numpy==1.26.2
33
pandas==2.0.3
44
pydantic==2.0.3
55
shapely==2.0.1
6-
skyfield==1.46
6+
skyfield==1.48
77
adjustText==1.0
88
cartopy==0.22.0
99
geopandas==0.13.2

src/starplot/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Star charts and maps"""
22

3-
__version__ = "0.10.0"
3+
__version__ = "0.10.1"
44

55
from .base import BasePlot # noqa: F401
66
from .map import MapPlot, Projection # noqa: F401

0 commit comments

Comments
 (0)