A Python package to generate an astronomy star chart based on spherical projection that corrects for distortions with stereographic projection
Project description
Star-Chart-Spherical-Projection
A Python package to generate an astronomy star chart based on spherical projection with +90/-90° in the center (orignally based on this Astrolabe work) based on a star's position (declination and right ascension): past, present, and future (proper motion and *precession)
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 (polar plot's theta value) and declination as the distance from the center of the circle (polar plot's radius value). However, attempting to map the right ascension and declination directly will cause a distinct amount of 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. By accounting for the spherical transformation, the star chart can be corrected as seen on the right.
Without Correction | With Correction |
---|---|
The sphere is projected from the South Pole (via Sterographic projection):
Example outputs:
Star Chart in the Northern Hemisphere (centered on 90°) without Precession
Star Chart in the Southern Hemisphere (centered on -90°) without Precession
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 arbitery 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. The 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).
Spherical projection can overcome this difficulty by converting the position of the declination to:
# Projected from South Pole (Northern Hemisphere)
north_hemisphere_declination = tan(45° + (original_declination / 2))
# Projected from North Pole (Southern Hemisphere)
south_hemisphere_declination = tan(45° - (original_declination / 2))
Where in the Northern Hemsiphere, projections are formed from the South Pole:
Documentation
plotStereographicProjection(userListOfStars=[],
northOrSouth=None,
declination_min=None,
yearSince2000=0,
displayStarNamesLabels=True,
displayDeclinationNumbers=True,
incrementBy=10,
isPrecessionIncluded=True,
maxMagnitudeFilter=None,
showPlot=True,
fig_plot_title=None,
fig_plot_color="C0",
figsize_n=12,
figsize_dpi=100,
save_plot_name=None)
- [REQUIRED] northOrSouth: (string) map for either the "North" or "South" hemisphere
- [OPTIONAL] userListOfStar: (list) a list of star names to include, by default = [] includes all stars (in star_data.csv). Example: ["Vega", "Merak", "Dubhe"]
- [OPTIONAL] declination_min: (int) outer declination value, defaults to -30° in Northern hemisphere and 30° in Southern hemisphere
- [OPTIONAL] yearSince2000: (float) years since 2000 (-50 = 1950 and +50 = 2050) to calculate proper motion and precession, defaults = 0 years
- [OPTIONAL] displayStarNamesLabels: (boolean) display the star name labels, defaults to True
- [OPTIONAL] displayDeclinationNumbers: (boolean) display declination values, defaults to True
- [OPTIONAL] incrementBy: (int) increment values for declination (either 1, 5, 10), defaults to 10
- [OPTIONAL] isPrecessionIncluded: (boolean) when calculating star positions include predictions for precession, defaults to True
- [OPTIONAL] maxMagnitudeFilter: (float) filter existing stars by magnitude by setting the max magnitude for the chart to include, defaults to None (shows all stars)
- [OPTIONAL] showPlot: (boolean) show plot (triggers plt.show()) when finished running, defaults to True
- [OPTIONAL] fig_plot_title: (string) figure title, defaults to "<North/South>ern Hemisphere [ Years Since 2000 (YYYY)]: +/-90° to °"
- [OPTIONAL] fig_plot_color: (string) scatter plot star color, defaults to C0
- [OPTIONAL] figsize_n: (int) figure size, default to 12
- [OPTIONAL] figsize_dpi: (int) figure DPI, default to 100
- [OPTIONAL] save_plot_name: (string) save plot with a string name, defaults to not saving
Current list of stars (to access via userListOfStar): ['Acamar', 'Achernar', 'Acrab', 'Acrux', 'Adhara', 'Aldebaran', 'Alderamin', 'Algieba', 'Algol', 'Alhena', 'Alioth', 'Alkaid', 'Almach', 'Alnilam', 'Alnitak', 'Alphard', 'Alphecca', 'Alpheratz', 'Altair', 'Aludra', 'Ankaa', 'Antares', 'Arcturus', 'Arneb', 'Ascella', 'Aspidiske', 'Atria', 'Avior', 'Bellatrix', 'Beta Hydri', 'Beta cdPhoenicis', 'Betelgeuse', 'Canopus', 'Capella', 'Caph', 'Castor', 'Cebalrai', 'Celaeno', 'Chara', 'Cor-Caroli', 'Cursa', 'Delta Crucis', 'Deneb', 'Denebola', 'Diphda', 'Dschubba', 'Dubhe', 'Elnath', 'Eltanin', 'Enif', 'Formalhaut', 'Gacrux', 'Gamma Phoenicis', 'Gienah', 'Hadar', 'Hamal', 'Kochab', 'Kornephoros', 'Lesath', 'Markab', 'Megrez', 'Meissa', 'Menkalinan', 'Menkar', 'Menkent', 'Merak', 'Miaplacidus', 'Mimosa', 'Mintaka', 'Mirach', 'Mirfak', 'Mirzam', 'Mizar', 'Muphrid', 'Naos', 'Navi', 'Nunki', 'Peacock', 'Phact', 'Phecda', 'Polaris', 'Pollux', 'Procyon', 'Rasalhague', 'Rastaban', 'Regulus', 'Rigel', 'Ruchbah', 'Sabik', 'Sadr', 'Saiph', 'Sargas', 'Scheat', 'Schedar', 'Segin', 'Seginus', 'Shaula', 'Sheratan', 'Sirius', 'Spica', 'Suhail', 'Tarazed', 'Unukalhai', 'Vega', 'Wezen', 'Zosma', 'Zubeneschamali']
Dependencies
Python 3.7
pip3 install -r requirements.txt
Install
PyPi pip install at pypi.org/project/star-chart-spherical-projection/
pip install star-chart-spherical-projection
Examples
import star_chart_spherical_projection as scsp
scsp.plotStereographicProjection(northOrSouth="North")
Tests
Bibliography
Star position (right ascension and declination) as well as the angle and speed of proper motion taken from in-the-sky.org
Precession model code adapted to Python3 from github.com/dreamalligator/vondrak
TODO:
Add README badges: tests
Pypi tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file star-chart-spherical-projection-1.3.4.tar.gz
.
File metadata
- Download URL: star-chart-spherical-projection-1.3.4.tar.gz
- Upload date:
- Size: 25.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c00833b80075a3284d52a86002fdca24e18c747c65ca021df3becde0e8e6050d |
|
MD5 | 740b2f9985ad4c66e39ff25beb5b0ef9 |
|
BLAKE2b-256 | 71bd5666d0cdf60069ab2a7f43a2fa9988bdd96d6ca6b8179e54114d2fcc1786 |
Provenance
File details
Details for the file star_chart_spherical_projection-1.3.4-py3-none-any.whl
.
File metadata
- Download URL: star_chart_spherical_projection-1.3.4-py3-none-any.whl
- Upload date:
- Size: 25.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce6f57f8d35a73a42d43967fdd75c77dd5c6438a2bebaa32c44ca2326e006117 |
|
MD5 | 9e7655bc4a04a2b10485c668fd477330 |
|
BLAKE2b-256 | e84d7e3de5f70fa0c59713bb16760266c4685216f42279450cc01851ec2a34ae |