Skip to content

Commit

Permalink
workflow for supported python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Mar 7, 2024
1 parent b4e49be commit 8d5e7a8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/pytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,23 @@ jobs:

runs-on: ubuntu-20.04 # specifically calls the version number instead of lastest to work on 'act'

strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ['3.9', '3.10', '3.11', '3.12']

name: Python (${{ matrix.python-version }} on ${{ matrix.os }})
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
export SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True
pip install -r requirements.txt
- name: Test with pytest
run: |
python3 -m pytest
python -m pytest
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ A Python package to generate circular astronomy star charts (past, present, and
* **Add a New Star to Plot**
* newStar()

The first step to plot the celestial sphere onto a 2D plot is to map the star's right ascension as hours along the plot (matplotlib polar plot's theta value) and declination as the distance from the center of the circle (matplotlib polar plot's radius value). However, attempting to map the right ascension and declination directly will cause distortion since the angles between the stars along the declination are no longer conserved. On the left, the constellation of the Big Dipper is stretched into an unfamiliar shape due to this distortion. By accounting for the spherical transformation, the star chart can be corrected as seen on the right.

| Without Correction | With Correction |
| ------------- | ------------- |
| ![without_correction](https://user-images.githubusercontent.com/22159116/202333014-a53f1176-182f-43c7-ab92-266d15d8c563.jpg) | ![with_correction](https://user-images.githubusercontent.com/22159116/202333015-493619f4-a5b8-4614-8b32-54225d7fad02.png) |

The sphere is projected from the South Pole (via [Stereographic projection](https://gisgeography.com/azimuthal-projection-orthographic-stereographic-gnomonic/)):
<p align="center">
<img src="https://gisgeography.com/wp-content/uploads/2016/12/Stereographic-Projection-768x421.png" />
</p>

## Quickstart: Star-Chart-Spherical-Projection
Plot stars in the Southern Hemisphere for the year 2023 (without stars labels)
```python
Expand Down Expand Up @@ -81,15 +70,19 @@ PyPi pip install at [pypi.org/project/star-chart-spherical-projection/](https://
pip install star-chart-spherical-projection
```

## Requirements
## Overview

Python 3.7+
```
pip install -r requirements.txt
```
Requirements will also be downloaded as part of the pip download
The first step to plot the celestial sphere onto a 2D plot is to map the star's right ascension as hours along the plot (matplotlib polar plot's theta value) and declination as the distance from the center of the circle (matplotlib polar plot's radius value). However, attempting to map the right ascension and declination directly will cause distortion since the angles between the stars along the declination are no longer conserved. On the left, the constellation of the Big Dipper is stretched into an unfamiliar shape due to this distortion. By accounting for the spherical transformation, the star chart can be corrected as seen on the right.

| Without Correction | With Correction |
| ------------- | ------------- |
| ![without_correction](https://user-images.githubusercontent.com/22159116/202333014-a53f1176-182f-43c7-ab92-266d15d8c563.jpg) | ![with_correction](https://user-images.githubusercontent.com/22159116/202333015-493619f4-a5b8-4614-8b32-54225d7fad02.png) |

The sphere is projected from the South Pole (via [Stereographic projection](https://gisgeography.com/azimuthal-projection-orthographic-stereographic-gnomonic/)):
<p align="center">
<img src="https://gisgeography.com/wp-content/uploads/2016/12/Stereographic-Projection-768x421.png" />
</p>

## Overview

From the perspective of an observer on the Earth's surface, the stars appear to sit along the surface of the celestial sphere--an imaginary sphere of arbitrary radius with the Earth at its center. All objects in the sky will appear projected on the celestial sphere regardless of their true distance from Earth. Each star's position is given by two values. Declination is the angular distance from the celestial equator and right ascension is the distance from the position of the vernal equinox. During the course of a full 24-hour day, stars will appear to rotate across the sky as a result of the Earth's rotation, but their position is fixed. A star’s actual position does change over time as the combined result of the star’s small movement (proper motion) as well as the changing rotational axis of the Earth (precession).

Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Physics",
Expand All @@ -46,5 +47,5 @@
"pandas>=1.3.5",
"pytest>=7.2.2"
],
python_requires='>=3.7'
python_requires='>=3.9'
)

0 comments on commit 8d5e7a8

Please sign in to comment.