Skip to content

Commit 6488e6b

Browse files
authored
v0.9.0 (#57)
- Added perspective projections (Orthographic, Stereographic) to map plots - many thanks to @bathoorn - Zenith plots are now a type of projection for map plots, to support plotting the milky way, constellation borders and more - many thanks to @bathoorn - Removed the visible style property and instead now you control what is plotted by calling functions on the plot (e.g. p.stars(mag=8)) to be more consistent with other plotting frameworks and allow more control over what's plotted and how. For example, now you can do things like plotting very bright stars with a different marker (and sizes, etc) than dimmer stars. - Optional callables for calculating star size/alpha/color when plotting stars - Nebula outlines! via OpenNGC - Stars are now plotted in order of their calculated size, which prevents "bigger" stars from hiding "smaller" stars - Added more marker symbols and style extensions Co-authored-by: Ronnie Bathoorn
1 parent 12226e7 commit 6488e6b

Some content is hidden

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

101 files changed

+4815
-6544
lines changed

.github/workflows/docs.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@ jobs:
1212
id-token: 'write'
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616

1717
- name: Build Docker image
1818
run: make build
1919

20+
- name: Build Examples
21+
run: make examples
22+
23+
- name: Build Gallery
24+
run: make gallery
25+
26+
- name: Build OpenNGC Data Reference
27+
run: make scripts SCRIPT=ongc_docdata
28+
2029
- name: Build Docs
2130
run: make docs-build
2231

@@ -25,12 +34,12 @@ jobs:
2534
with:
2635
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
2736

28-
- name: 'Set up Cloud SDK'
37+
- name: 'Set up Google Cloud SDK'
2938
uses: 'google-github-actions/setup-gcloud@v1'
3039
with:
3140
version: '>= 363.0.0'
3241

33-
- name: 'Use gcloud CLI'
42+
- name: 'Sync docs to Cloud Storage Bucket'
3443
run: 'gsutil -m rsync -R -d site gs://starplot.dev'
3544

3645

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
publish:
1010
runs-on: ubuntu-22.04
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
- name: Build Docker Image
1414
run: make build
1515
- name: Check Lint

.github/workflows/test.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
test-lint-build:
1212
runs-on: ubuntu-22.04
1313
steps:
14-
- uses: actions/checkout@v3
14+
- uses: actions/checkout@v4
1515
- name: Build Docker Image
1616
run: make build
1717
- name: Check Lint
@@ -25,24 +25,24 @@ jobs:
2525
test-python-3-9:
2626
runs-on: ubuntu-22.04
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
- name: Run Tests - Python 3.9
3030
run: make test-3.9 CI=true
3131
test-python-3-10:
3232
runs-on: ubuntu-22.04
3333
steps:
34-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3535
- name: Run Tests - Python 3.10
3636
run: make test-3.10 CI=true
3737
test-python-3-11:
3838
runs-on: ubuntu-22.04
3939
steps:
40-
- uses: actions/checkout@v3
40+
- uses: actions/checkout@v4
4141
- name: Run Tests - Python 3.11
4242
run: make test-3.11 CI=true
4343
test-python-3-12:
4444
runs-on: ubuntu-22.04
4545
steps:
46-
- uses: actions/checkout@v3
46+
- uses: actions/checkout@v4
4747
- name: Run Tests - Python 3.12
4848
run: make test-3.12 CI=true

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ CometEls.txt
2222
temp*
2323
raw/
2424
examples/*.png
25+
docs/images/examples/*.png
26+
docs/images/gallery/*.png
27+
docs/data/*.json
2528

2629
*.prof
2730

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM python:${PYTHON_VERSION}-bookworm AS base
33

44
WORKDIR /starplot
55

6-
RUN apt-get update -y && apt-get install -y libgeos-dev libgdal-dev
6+
RUN apt-get clean && apt-get update -y && apt-get install -y libgeos-dev libgdal-dev
77

88
# Install fonts
99
# not required, but make the maps look better (especially greek letters)

Makefile

+8-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ docker-multi-arch:
3232
docker buildx build --push --platform linux/arm64/v8,linux/amd64 --tag sberardi/starplot-base:latest --target base .
3333

3434
lint:
35-
$(DOCKER_RUN) "ruff check src/ tests/"
35+
$(DOCKER_RUN) "ruff check src/ tests/ $(ARGS)"
3636

3737
format:
3838
$(DOCKER_RUN) "python -m black src/ tests/ scripts/ examples/ $(ARGS)"
@@ -44,14 +44,17 @@ bash:
4444
$(DOCKER_RUN) bash
4545

4646
shell:
47-
$(DOCKER_RUN) python
47+
$(DOCKER_RUN) ipython
4848

4949
scratchpad:
5050
$(DOCKER_RUN) "python $(SCRATCH_ARGS) scripts/scratchpad.py"
5151

5252
examples:
5353
$(DOCKER_RUN) "cd examples && python examples.py"
5454

55+
gallery:
56+
$(DOCKER_RUN) "python scripts/gallery.py"
57+
5558
# ------------------------------------------------------------------
5659
# Python version testing
5760
# ------------------------------------------------------------------
@@ -79,7 +82,7 @@ test-3.12:
7982
# Docs
8083
docs-serve: DR_ARGS=-it -p 8000:8000
8184
docs-serve:
82-
$(DOCKER_RUN) "mkdocs serve -a 0.0.0.0:8000 --watch src/"
85+
$(DOCKER_RUN) "mkdocs serve -a 0.0.0.0:8000 -q --watch src/"
8386

8487
docs-build:
8588
$(DOCKER_RUN) "mkdocs build"
@@ -113,5 +116,6 @@ clean:
113116
rm -rf dist
114117
rm -rf site
115118
rm -rf htmlcov
119+
rm -f tests/data/*.png
116120

117-
.PHONY: install test shell flit-build flit-publish clean ephemeris hip8 scratchpad examples scripts
121+
.PHONY: build test shell flit-build flit-publish clean ephemeris hip8 scratchpad examples scripts

README.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,19 @@ import starplot as sp
3535

3636
tz = timezone("America/Los_Angeles")
3737

38-
p = sp.ZenithPlot(
39-
lat=33.363484,
38+
p = sp.MapPlot(
39+
projection=Projection.ZENITH,
40+
lat=33.363484,
4041
lon=-116.836394,
4142
dt=datetime.now(tz).replace(hour=22),
42-
limiting_magnitude=4.6,
43+
style=sp.styles.PlotStyle().extend(
44+
sp.styles.extensions.BLUE_MEDIUM,
45+
sp.styles.extensions.ZENITH,
46+
),
4347
resolution=2000,
4448
)
49+
p.constellations()
50+
p.stars(mag=4.6, mag_labels=2.1)
4551
p.export("starchart.png")
4652
```
4753

@@ -67,10 +73,9 @@ For a demo of Starplot's zenith plots, check out:
6773
- adjustText
6874

6975
## Coming Soon
70-
- ⚙️ Callables for star sizes/colors/alpha
7176
- ✴️ Custom markers
72-
- 📐 Nebula outlines
73-
- 🌐 More map projection options
77+
- 📋 List of objects plotted
78+
- 📐 More Nebula outline levels
7479
- ⚖️ Better auto font-size adjustment
7580
- ☄️ Better label collision detection and handling
7681

docs/about.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### _Note from the author..._
88

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.
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 really helped me learn 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.
1010

1111
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.
1212

0 commit comments

Comments
 (0)