This repository contains code and data for clustering analysis of Gamma-Ray Bursts (GRBs) based on their T90 and fluence values.
The GRB_Table.csv
file contains the following columns:
name
: The name of the GRB.ra
: Right Ascension of the GRB.dec
: Declination of the GRB.trigger_time
: The trigger time of the GRB.t90
: The duration in seconds during which 90% of the burst's fluence is detected.fluence
: The total fluence of the GRB in erg/cm².trigger_name
: The trigger name of the GRB.
-
Load and Preprocess Data: The script reads the
GRB_Table.csv
file and preprocesses the data by convertingt90
andfluence
to log scale. -
Handle Missing Values: Rows with missing values are dropped.
-
Clustering Analysis:
- Clustering based on
T90
. - Clustering based on
Fluence
. - Clustering based on both
T90
andFluence
.
- Clustering based on
-
Plot and Save Results: The script generates and saves elbow plots and clustering results.
-
Analyze Clusters: The script analyzes the clusters and writes the results to
output.txt
. -
Save Cluster Assignments: The script saves the cluster assignments to
GRB_Table_clustered.csv
.
- pandas
- numpy
- scikit-learn
- matplotlib
- seaborn