Python-based tool for calculating cosmic redshift and astronomical distances
Cosmic-Redshift-Distance-Tracker is a Python project that calculates and visualizes the relationship between cosmic redshift (z) and astronomical distances. This tool is intended for students, researchers, and enthusiasts in cosmology to understand universe expansion and estimate distances to distant celestial objects.
- Calculate redshift (z) from observed spectral data using relativistic Doppler formula.
- Compute various cosmological distances: comoving distance, luminosity distance, and light travel distance.
- Visualize redshift-distance relationships.
- Optional bilingual graph outputs (Turkish / English).
📁 Cosmic-Redshift-Distance-Tracker/ │ ├── tracker.py → English script: calculates redshift and distances, produces graphs ├── tracker.py → Turkish script: calculates redshift and distances, produces graphs └── README.md → This file
- Make sure you have Python 3.x installed.
- Install dependencies:
pip install numpy matplotlib - Run the tracker:
python tracker.py - Graphs are saved as
.pngfiles and displayed automatically.
Redshift is computed using the standard relativistic Doppler formula:
z = (λ_observed - λ_emitted) / λ_emitted
where:
λ_observed: wavelength measured at Earthλ_emitted: wavelength emitted by the source
Distances are computed based on standard cosmology:
- Comoving Distance:
D_C = c ∫(0 → z) dz' / H(z')
- Luminosity Distance:
D_L = (1 + z) · D_C
- Light Travel Distance:
D_T = ∫(0 → z) c dz' / H(z')
where H(z) is the Hubble parameter at redshift z, and c is the speed of light.
The script generates plots of redshift vs. distance. Users can easily compare different cosmological models and visualize how the universe’s expansion affects observed distances.
- Python Documentation: https://www.python.org/doc/
- Matplotlib Documentation: https://matplotlib.org
- Cosmology Reference: Hogg, D. W. (1999). Distance measures in cosmology. arXiv:astro-ph/9905116