Skip to content

Commit 616e63f

Browse files
authored
v0.8.0 (#45)
* new milky way outline * docs * dso sizing initial * gallery about placeholders * work in progress * stash * tycho geopack script * ongc geopack script * parse ongc csv * some progress * adjust * ongc outlines * return early if empty * update hashes * style adjustments and new example * gallery * version * no zoom * included by mistake * handle wrapping * mollweide * handle dso wrapping * handle wrapping in optic plots * normalize legend marker size * adjust right ascension * format * about page
1 parent 90974ef commit 616e63f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1259
-249
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ hip_main.dat
1919
hip8.dat
2020

2121
temp*
22+
raw/
2223

2324
*.prof
2425

2526
# test-generated data
26-
tests/data/actual*.png
27+
tests/data/*.png
2728

2829
# Distribution / packaging
2930
.Python

docs/about.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
![Starplot](images/favicon.svg){ align=right width="200" }
2+
3+
**Starplot** is a Python library for creating star charts and maps. It lets you create zenith plots that show the whole sky from a time/place, map plots that show more detail of an area, and optic plots that simulate the field of view from a particular optic (e.g. telescope, binoculars, or a camera).
4+
5+
---
6+
7+
### _Note from the author..._
8+
9+
Like many amateur astronomers, when I first started looking up at the sky through a scope I bought the wonderful book [_Turn Left at Orion_](https://www.amazon.com/Turn-Left-Orion-Hundreds-Telescope-dp-1108457568/dp/1108457568/), and it was such a useful book for learning how to find stuff in the sky. The thing that helped me the most were all the finder charts that show an object in various ways: first a general overview of where the object is in the sky (useful for finding the object with your naked eye), and then vector drawings of what the object looks like through a medium/high power scope (including any transformations to the image from mirrors in the scope). These really helped me confirm I found the object.
10+
11+
After finding most of the sky objects in _Turn Left at Orion_, I tried finding another book or software that would create those finder charts in the book for any spot in the sky, but I couldn't find anything. That was my main motivation for creating Starplot.
12+
13+
I also just really love any kind of map of the stars, including more abstract/artistic types of maps. So, one of my goals with Starplot is to make it customizable for many different purposes.
14+
15+
Starplot is still very much a work in progress, so I appreciate any feedback! Please feel free to [contact me](https://steveberardi.com/contact/) or [open an issue](https://github.com/steveberardi/starplot/issues) on the GitHub repo.
16+
17+
Thanks!
18+
19+
[Steve Berardi](https://steveberardi.com)

docs/css/extra.css

+31-1
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,34 @@
101101
code.raw {
102102
display: block;
103103
white-space: pre-wrap
104-
}
104+
}
105+
106+
.cards ul li {
107+
display: flex !important;
108+
align-items: center;
109+
}
110+
.cards ul li img {
111+
align-self: center;
112+
/* object-fit: cover;
113+
width: 360px;
114+
height: 360px; */
115+
116+
}
117+
118+
.cards figure {
119+
display: flex !important;
120+
justify-content:space-between;
121+
flex-grow: 1;
122+
flex-direction: column;
123+
align-items: center;
124+
border: 1px solid #c6c6c6;
125+
margin-right: 1em;
126+
padding: 0.6rem;
127+
}
128+
.cards figure p {
129+
align-self: center;
130+
}
131+
132+
.md-nav--integrated>.md-nav__list>.md-nav__item--active:not(.md-nav__item--nested) {
133+
padding: 0 !important;
134+
}

docs/data-sources.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
- [OpenNGC](https://github.com/mattiaverga/OpenNGC)
1717

1818
### **Milky Way Outline**
19-
- Milky Way Outline Catalog, Jose R. Vieira (via [d3-celestial](https://github.com/ofrohn/d3-celestial))
19+
- Created by Steve Berardi with QGIS + GDAL from NASA's [Deep Star Maps](https://svs.gsfc.nasa.gov/4851)

docs/examples.md

+18-6
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ This page has a few examples to get you familiar with Starplot and how it works.
55
3. [Map of Orion](#map-of-orion)
66
4. [Map of The Pleiades with a Scope Field of View](#map-of-the-pleiades-with-a-scope-field-of-view)
77
5. [Optic plot of The Pleiades with a Refractor Telescope](#optic-plot-of-the-pleiades-with-a-refractor-telescope)
8+
6. [Map plot of The Big Dipper with Custom Markers](#map-plot-of-the-big-dipper-with-custom-markers)
89

910

1011

1112
## Star Chart for Time/Location
1213
To create a star chart for the sky as seen from [Palomar Mountain](https://en.wikipedia.org/wiki/Palomar_Mountain) in California on July 13, 2023 at 10pm PT:
1314

1415
```python
15-
{% include 'examples/example_01.py' %}
16+
--8<-- "examples/example_01.py"
1617
```
1718

1819
The created file should look like this:
@@ -25,7 +26,7 @@ The created file should look like this:
2526
Building on the first example, you can also plot additional objects and even customize their style. Here's an example that plots the [Coma Star Cluster](https://en.wikipedia.org/wiki/Coma_Star_Cluster) (Melotte 111) as a red star and also changes the plot style to `GRAYSCALE`:
2627

2728
```python
28-
{% include 'examples/example_02.py' %}
29+
--8<-- "examples/example_02.py"
2930
```
3031

3132
![zenith-coma](images/example_02.png)
@@ -36,7 +37,7 @@ Building on the first example, you can also plot additional objects and even cus
3637
The following code will create a simple map plot that shows the area around the constellation Orion, including a legend and an extra marker for M42 - [The Great Orion Nebula](https://en.wikipedia.org/wiki/Orion_Nebula):
3738

3839
```python
39-
{% include 'examples/example_03.py' %}
40+
--8<-- "examples/example_03.py"
4041
```
4142

4243
The result should look like this:
@@ -49,7 +50,7 @@ The result should look like this:
4950
The following code will create a minimal map plot that shows the field of view (red dashed circle) of [The Pleiades (M45)](https://en.wikipedia.org/wiki/Pleiades) when looking through a [Tele Vue 85](https://www.televue.com/engine/TV3b_page.asp?id=26) telescope with a 14mm eyepiece that has a 82 degree FOV:
5051

5152
```python
52-
{% include 'examples/example_04.py' %}
53+
--8<-- "examples/example_04.py"
5354
```
5455

5556
The result should look like this:
@@ -65,19 +66,30 @@ The result should look like this:
6566
```
6667

6768

68-
## Optic plot of The Pleiades with a Refractor Telescope
69+
## Optic Plot of The Pleiades with a Refractor Telescope
6970

7071
The following code will create an optic plot that shows what The Pleiades looked like through a refractor telescope on December 16, 2023 at 9pm PT from Palomar Mountain in California.
7172

7273
```python
73-
{% include 'examples/example_05.py' %}
74+
--8<-- "examples/example_05.py"
7475
```
7576

7677
The result should look like this:
7778

7879
![optic-m45](images/example_05.png)
7980

8081

82+
## Map of The Big Dipper with Custom Markers
83+
84+
Here's a fun one 😃 Let's create a small plot of the big dipper ([Ursa Major](https://en.wikipedia.org/wiki/Ursa_Major)), but with custom star-shaped markers:
85+
86+
```python
87+
--8<-- "examples/example_06.py"
88+
```
89+
90+
The result should look like this:
91+
92+
![stars-m45](images/example_06.png)
8193

8294
---
8395

docs/gallery.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div class="grid cards" markdown>
2+
3+
- ![starchart-blue](images/example_01.png)
4+
- ![map-orion](images/map-orion.png)
5+
- ![map-sgr](images/map-sgr.png)
6+
- ![optic-p2](images/optic-p2.png)
7+
- ![map-lyra](images/map-lyra.png)
8+
- ![big-dipper](images/example_06.png)
9+
- ![map-mollweide](images/map-mollweide.png)
10+
- ![scope-fov](images/example_04.png)
11+
12+
</div>

docs/images/example_01.png

-2.1 KB
Loading

docs/images/example_02.png

-1.02 KB
Loading

docs/images/example_03.png

-10 KB
Loading

docs/images/example_04.png

26.6 KB
Loading

docs/images/example_05.png

-4.41 KB
Loading

docs/images/example_06.png

17.6 KB
Loading

docs/images/example_4.png

-58 KB
Binary file not shown.

docs/images/map-lyra.png

362 KB
Loading

docs/images/map-mollweide.png

966 KB
Loading

docs/images/map-orion.png

697 KB
Loading

docs/images/map-sgr.png

-71.1 KB
Loading

docs/images/optic-p2.png

192 KB
Loading

docs/reference-data.md

+11
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@
55
show_root_heading: true
66
show_docstring_attributes: true
77

8+
9+
::: starplot.data.dsos.DsoType
10+
options:
11+
show_root_heading: true
12+
show_docstring_attributes: true
13+
members: true
14+
15+
::: starplot.data.dsos.DEFAULT_DSO_TYPES
16+
options:
17+
show_root_heading: true
18+
show_docstring_attributes: true

docs/reference-mapplot.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
**Map plots are general purpose maps of the sky.** They're not dependent on an observer's location, but they are dependent on time if you want to include the planets and/or the moon in the plot.
22

3-
There are three supported projections for map plots: mercator (the default), stereographic north, and stereographic south.
3+
There are four supported projections for map plots:
4+
5+
- Mercator (the default)
6+
- Stereographic North
7+
- Stereographic South
8+
- Mollweide
49

510
::: starplot.MapPlot
611
options:

docs/reference-styling.md

+20-30
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,8 @@ Starplot has a bunch of built-in style extensions (all imported from `starplot.s
286286
<div class="indent" markdown>
287287
Optimized for printing in grayscale
288288

289-
**Source**
290-
```yaml
291-
{% include 'src/starplot/styles/ext/grayscale.yml' %}
289+
```yaml title="Source"
290+
--8<-- "src/starplot/styles/ext/grayscale.yml"
292291
```
293292
</div>
294293

@@ -298,9 +297,8 @@ Optimized for printing in grayscale
298297
<div class="indent" markdown>
299298
Like `GRAYSCALE`, but inverted (white stars, black background)
300299

301-
**Source**
302-
```yaml
303-
{% include 'src/starplot/styles/ext/grayscale_dark.yml' %}
300+
```yaml title="Source"
301+
--8<-- "src/starplot/styles/ext/grayscale_dark.yml"
304302
```
305303
</div>
306304

@@ -310,9 +308,8 @@ Like `GRAYSCALE`, but inverted (white stars, black background)
310308
<div class="indent" markdown>
311309
Light and bright colors
312310

313-
**Source**
314-
```yaml
315-
{% include 'src/starplot/styles/ext/blue_light.yml' %}
311+
```yaml title="Source"
312+
--8<-- "src/starplot/styles/ext/blue_light.yml"
316313
```
317314
</div>
318315

@@ -322,9 +319,8 @@ Light and bright colors
322319
<div class="indent" markdown>
323320
Medium brightness bluish gray colors
324321

325-
**Source**
326-
```yaml
327-
{% include 'src/starplot/styles/ext/blue_medium.yml' %}
322+
```yaml title="Source"
323+
--8<-- "src/starplot/styles/ext/blue_medium.yml"
328324
```
329325
</div>
330326

@@ -334,9 +330,8 @@ Medium brightness bluish gray colors
334330
<div class="indent" markdown>
335331
Dark bluish gray colors
336332

337-
**Source**
338-
```yaml
339-
{% include 'src/starplot/styles/ext/blue_dark.yml' %}
333+
```yaml title="Source"
334+
--8<-- "src/starplot/styles/ext/blue_dark.yml"
340335
```
341336
</div>
342337

@@ -346,9 +341,8 @@ Dark bluish gray colors
346341
<div class="indent" markdown>
347342
Basic styling tailored for optic plots
348343

349-
**Source**
350-
```yaml
351-
{% include 'src/starplot/styles/ext/optic.yml' %}
344+
```yaml title="Source"
345+
--8<-- "src/starplot/styles/ext/optic.yml"
352346
```
353347
</div>
354348

@@ -358,9 +352,8 @@ Basic styling tailored for optic plots
358352
<div class="indent" markdown>
359353
Basic styling tailored for map plots
360354

361-
**Source**
362-
```yaml
363-
{% include 'src/starplot/styles/ext/map.yml' %}
355+
```yaml title="Source"
356+
--8<-- "src/starplot/styles/ext/map.yml"
364357
```
365358
</div>
366359

@@ -370,9 +363,8 @@ Basic styling tailored for map plots
370363
<div class="indent" markdown>
371364
Basic styling tailored for zenith plots
372365

373-
**Source**
374-
```yaml
375-
{% include 'src/starplot/styles/ext/zenith.yml' %}
366+
```yaml title="Source"
367+
--8<-- "src/starplot/styles/ext/zenith.yml"
376368
```
377369
</div>
378370

@@ -382,9 +374,8 @@ Basic styling tailored for zenith plots
382374
<div class="indent" markdown>
383375
Hides all the labels
384376

385-
**Source**
386-
```yaml
387-
{% include 'src/starplot/styles/ext/hide_labels.yml' %}
377+
```yaml title="Source"
378+
--8<-- "src/starplot/styles/ext/hide_labels.yml"
388379
```
389380
</div>
390381

@@ -395,8 +386,7 @@ Hides all the labels
395386
<div class="indent" markdown>
396387
Hides everything except stars and DSOs. Good for plotting scope fields of view.
397388

398-
**Source**
399-
```yaml
400-
{% include 'src/starplot/styles/ext/minimal.yml' %}
389+
```yaml title="Source"
390+
--8<-- "src/starplot/styles/ext/minimal.yml"
401391
```
402392
</div>

docs/roadmap.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11

22
<!-- Here are some planned features coming soon to Starplot: -->
33

4-
- 🚀 Faster plotting and exporting
5-
- 📷 Rotation angles for camera optic plots
4+
- ⚙️ Callables for star sizes/colors/alpha
5+
- ✴️ Custom markers
6+
- 📐 Better DSO outlines
7+
- 🌐 More map projection options
68
- ⚖️ Better auto font-size adjustment
79
- ☄️ Better label collision detection and handling
8-
- 🌌 More accurate DSO outlines
910

1011
✨ Clear Skies! ✨

examples/01_star_chart.png

-2.1 KB
Loading

examples/02_star_chart_extra.png

-1.02 KB
Loading

examples/03_map_orion.png

-10 KB
Loading

examples/04_map_m45_scope.png

26.6 KB
Loading

examples/05_optic_m45.png

-4.41 KB
Loading

examples/06_big_dipper_stars.png

17.6 KB
Loading

examples/example_04.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
star_catalog="tycho-1",
2020
)
2121
p.plot_scope_fov(
22-
ra=3.7836111111,
23-
dec=24.1166666667,
22+
ra=3.7912777778,
23+
dec=24.1052777778,
2424
scope_focal_length=600,
2525
eyepiece_focal_length=14,
2626
eyepiece_fov=82,

examples/example_05.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
p = OpticPlot(
1616
# M45
17-
ra=3.783611,
18-
dec=24.11667,
17+
ra=3.7912777778,
18+
dec=24.1052777778,
1919
lat=33.363484,
2020
lon=-116.836394,
2121
# Refractor Telescope

examples/example_06.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from starplot import MapPlot, Projection
2+
from starplot.styles import PlotStyle, extensions, MarkerSymbolEnum
3+
4+
style = PlotStyle().extend(
5+
extensions.MINIMAL,
6+
extensions.GRAYSCALE,
7+
extensions.MAP,
8+
)
9+
10+
style.star.marker.symbol = MarkerSymbolEnum.STAR
11+
12+
# Star sizes are calculated based on their magnitude first,
13+
# but then that result will be multiplied by the star's marker size in the PlotStyle
14+
# so, adjusting the star marker size is a way to make all stars bigger or smaller
15+
style.star.marker.size = 50
16+
17+
p = MapPlot(
18+
projection=Projection.STEREO_NORTH,
19+
ra_min=10.8,
20+
ra_max=14,
21+
dec_min=48,
22+
dec_max=64,
23+
limiting_magnitude=3.6,
24+
style=style,
25+
resolution=1400,
26+
dso_types=[], # this is one way to hide all deep sky objects
27+
)
28+
29+
p.export("06_big_dipper_stars.png", padding=0.2)

examples/examples.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import subprocess
44

5-
for n in range(1, 6):
5+
for n in range(1, 7):
66
subprocess.call(f"python example_{n:02}.py", shell=True)
77
subprocess.call(f"cp {n:02}*.png ../docs/images/example_{n:02}.png", shell=True)
88

0 commit comments

Comments
 (0)