Ranking Statistic Analysis of O3a Month 2 Triggers using AresGW Model 1

Ranking Statistic Analysis of O3a Month 2 Triggers using AresGW Model 1#

AresGW ACME training session#

Alexandra Eleni Koloniari

Aristotle University of Thessaloniki

import numpy as np
import h5py
import matplotlib.pyplot as plt

Ranking statistic \(R_s\)#

In this notebook the ranking statistic is computed as:

rs = -np.log10(1.0 - stat[:] + 1e-16)

This definition follows the statistic used in:

A. E. Koloniari et al., New Gravitational Wave Discoveries Enabled by Machine Learning (2024)

The small constant 1e-16 is added to prevent numerical issues when stat 1, which would otherwise lead to log10(0).

READ THE TRIGGERS FILE#

filename = 'AresGW-model1-O3a-data-m2.hdf'

f =  h5py.File(filename,'r')
f.keys()
<KeysViewHDF5 ['stat', 'time', 'var']>
f_stat = f.get('stat')
f_time = f.get('time')
f_var= f.get('var')

stat = f_stat[()]
stat = -np.log10(1.0-stat[:]+1e-16)
time = f_time[()]
var = f_var[()]
# First trigger time
time[0]
1240758022.925

MERGER TIMES OF EVENTS IN SECOND MONTH OF O3a#

# List with the GPS times of all detected events in the second month of O3a
tc_list = [
    1240944862.3,
    1241719652.4,
    1241816086.8,
    1241852074.8,
    1242107479.8,
    1242315362.4,
    1242442967.4,
    1242459857.5,
    1242984073.8,
    1241614563.9,
    1242637191.4
]
# List with the corresponding names and Catalogs
gw_name_list = [
    "GW190503_185404 (GWTC)",  # 1240944862.3
    "GW190512_180714 (GWTC)",  # 1241719652.4
    "GW190513_205428 (GWTC)",  # 1241816086.8
    "GW190514_065416 (GWTC)",  # 1241852074.8
    "GW190517_055101 (GWTC)",  # 1242107479.8
    "GW190519_153544 (GWTC)",  # 1242315362.4
    "GW190521_030229 (GWTC)",  # 1242442967.4 
    "GW190521_074359 (GWTC)",  # 1242459857.5
    "GW190527_092055 (GWTC)",  # 1242984073.8
    "GW190511_125545 (AresGW model 2)", #1241614563.9
    "GW190523_085933 (AresGW model 2)"  #1242637191.4
]
graph, plot = plt.subplots(1)

plot.plot(np.array(time), np.array(stat), 'o')
plt.grid()

for tc in tc_list:
    plt.axvline(x=tc, color='r', linestyle='dashed')

plt.show()
../_images/2aa5ea0be4b3557ca94d3ddc3773a34d084e965ae4cb5f784a316aefe6f6fec1.png
# Histogram of the ranking statistic (Rs) for all triggers
# Includes both noise triggers and triggers associated with GW events
count, bins, ignored = plt.hist(np.array(stat), 300)

plt.yscale('log')  # Log scale to better visualize the distribution tail
plt.title('Distribution of the Ranking Statistic (Rs) for All Triggers')

plt.show()
../_images/50430368abc86b3f75820e0da705e1c7a7ad928869cd9c3b45665ae3bcc56bc0.png
# Rs for each event and its nearby noise
for tc, name in zip(tc_list, gw_name_list):

    fig, ax = plt.subplots()
    ax.plot(time, stat, 'o')

    ax.axvline(tc, color='r', linestyle='dashed')
    ax.set_xlim(tc-10, tc+10)

    ax.set_title(name)
    ax.grid()

    plt.show()
../_images/e2c58f2c694cf18e16d89a4fc77b28224a583fdc02755fa20bb01d9252c61b6d.png ../_images/34d688252b96720df9a2d54f8ff8074d7027c402abfbc77b78c0597d18a90ae0.png ../_images/41e2ba772b3e443d7847a8ba16ecd5d181dd61a59d499c8b16993da20de9e345.png ../_images/f7f0125a977d4119dbbc3dbb0017f45dbd3a7705d77f252fcc5b80ebbb1272e1.png ../_images/f906a4fc2f708cbfc00ab8539c2e2781ef85d3a84b27bc272493bb01eb7c5d45.png ../_images/f32aa2915c7d1cd0caf9a26d006d21e2b41995f8475b61e2e8cfd730f21d0345.png ../_images/c348429476449b763249bd73995ee780634fbe9f8880861ad5ae4fd51d6f8635.png ../_images/4a723a615835ab9c952f79c9efe57b999a97801c17f4b9f4d6c272af2522d5b1.png ../_images/3c116a1d14011744d2ec5e025daaac7535a6859db9907cbe8543a1a0ac7adbe2.png ../_images/0b8fd2f8dc1c93f689a4fd6ef0129abe39eca0d9694aebc7c3ada6026c26d750.png ../_images/ce88a52f9dd9f397ffd753b62dddc046882d75ac3ce2a60ecf58381eb775cdea.png
print("Total number of triggers (noise and events) above different thresholds:")
rs = np.array(stat)

count_3 = np.sum(rs > 3)
count_7 = np.sum(rs > 7)
count_10 = np.sum(rs > 10)
count_16 = np.sum(rs == 16)

print(f"Number of triggers with Rs > 3  : {count_3}")
print(f"Number of triggers with Rs > 7  : {count_7}")
print(f"Number of triggers with Rs > 10 : {count_10}")
print(f"Number of triggers with Rs = 16 : {count_16}")
Total number of triggers (noise and events) above different thresholds:
Number of triggers with Rs > 3  : 66
Number of triggers with Rs > 7  : 2
Number of triggers with Rs > 10 : 2
Number of triggers with Rs = 16 : 2
print("Rs of each event in m2 is:")

for tc, name in zip(tc_list, gw_name_list):

    # Different windows
    a = np.where((time < tc + 0.5) & (time > tc - 0.5))[0]
    b = np.where((time < tc + 0.3) & (time > tc - 0.5))[0]
    c = np.where((time < tc + 0.5) & (time > tc - 0.3))[0]

    if len(a) == 1:
        trigger_index = int(a[0])
    elif len(b) == 1:
        trigger_index = int(b[0])
    elif len(c) == 1:
        trigger_index = int(c[0])
    else:
        continue

    print(name, stat[trigger_index])
Rs of each event in m2 is:
GW190503_185404 (GWTC) 6.446568645430467
GW190512_180714 (GWTC) 16.0
GW190513_205428 (GWTC) 16.0
GW190514_065416 (GWTC) 3.9329072084680576
GW190517_055101 (GWTC) 4.830268215106394
GW190519_153544 (GWTC) 1.0640701214610282
GW190521_030229 (GWTC) 1.0459935311807413
GW190527_092055 (GWTC) 5.508716552286738
GW190511_125545 (AresGW model 2) 4.631433828913233
GW190523_085933 (AresGW model 2) 3.2573123393379975