This is a student project focused on the analysis of Type Ia Supernovae (SNIA) data to study cosmological parameters and the expansion of the universe.
The primary analysis is conducted in the SNIA_analysis.ipynb Jupyter Notebook.
The notebook covers the following key steps:
- Data Loading: Imports supernova data, including redshift, apparent magnitude, and other parameters.
-
Cosmological Model: Defines a function to calculate the apparent magnitude based on a
LambdaCDMcosmological model usingastropy. - Hubble Diagram: Plots the initial Hubble diagram (apparent magnitude vs. redshift).
-
Model Fitting: Uses
scipy.optimize.curve_fitto find the best-fit cosmological parameters ($\Omega_m^0$ ,$\Omega_\Lambda^0$ ) and the absolute magnitude ($M_B$ ). - Residual Analysis: Calculates and plots the residuals of the fit to assess its quality.
-
Magnitude Correction: Investigates and applies corrections to the apparent magnitude based on supernova color (
color) and stretch (x1) to reduce systematic biases. -
Likelihood Analysis: Explores the parameter space by computing and plotting the likelihood function for cosmological parameters, including 2D contour plots for
$\Omega_m^0$ vs.$\Omega_\Lambda^0$ .
To run this analysis, you'll need Python 3 and the libraries listed in requirements.txt.
-
Clone the repository:
git clone https://github.com/binhola/cosmo_SNIA.git cd cosmic_SNIA -
Create a virtual environment:
python3 -m venv venv source venv/bin/activate -
Install the required packages:
pip install -r requirements.txt
Once the setup is complete, you can run the analysis using Jupyter:
-
Start the Jupyter server:
jupyter notebook
or
jupyter lab
-
Open the notebook: In the Jupyter interface in your browser, open the
SNIA_analysis.ipynbfile and run the cells.
The data for this project is located in data/sne_data_zsorted.txt and is based on the SNLS collaboration (Betoule et al. 2014). It contains measurements for 740 Type Ia supernovae.