Visualizing stellar evolution and properties with Python
This repository offers a Python‐based visualization of the Hertzsprung–Russell (H-R) Diagram, a fundamental tool in astrophysics that plots stars by luminosity (or magnitude) vs. temperature (or spectral class). The aim is to provide both educational insight and analytical visualization of stellar populations.
- Plot the positions of stars in the H-R plane.
- Use real or synthetic stellar data (temperature, luminosity, magnitude).
- Generate bilingual (Turkish / English) output images.
- Enable comparison of different stellar populations or evolutionary tracks.
📁 Hertzsprung-Russell-Diagram/ │ ├── Python Doc.py → Main script: data processing & plotting routines ├── HR image_en.png → H-R diagram (English labels) ├── HR image_tr.png → H-R diagram (Turkish labels) └── README.md → This file (with HTML content)
- Ensure you have Python 3.x installed.
- Install required libraries (e.g.
numpy,matplotlib):pip install numpy matplotlib - Run the plotting script:
python "Python Doc.py" - Resulting H-R diagram images are saved in the repo (English and Turkish versions).
- Optionally modify input stellar datasets or add your own data to visualize different groups.
The H-R diagram is a scatter plot where stars are placed according to:
- Surface temperature (or spectral class) on the horizontal axis, usually decreasing leftwards
- Luminosity (or absolute magnitude) on the vertical axis
- More massive, hotter stars tend to lie toward the upper left (high luminosity, high temperature). - Cooler, less luminous stars lie toward the lower right. - Evolutionary tracks move stars across this diagram as they age.