import pandas as pd
gw_data = pd.read_csv('GWTC_cleaned.csv')
gw_data
id | commonName | version | catalog.shortName | GPS | reference | jsonurl | mass_1_source | mass_1_source_lower | mass_1_source_upper | ... | redshift_upper | far | p_astro | final_mass_source | final_mass_source_lower | final_mass_source_upper | final_spin | final_spin_lower | final_spin_upper | sky_area_(deg^2) | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | GW150914-v3 | GW150914 | 3 | GWTC-2.1-confident | 1.126259e+09 | /GWTC-2.1/ | https://gwosc.org/eventapi/json/GWTC-1-confide... | 34.6 | -2.6 | 4.4 | ... | 0.03 | 1.000000e-07 | 1.00 | 61.5 | -2.9 | 3.4 | 0.68 | -0.05 | 0.05 | 250 |
1 | GW151012-v3 | GW151012 | 3 | GWTC-2.1-confident | 1.128679e+09 | /GWTC-2.1/ | https://gwosc.org/eventapi/json/GWTC-1-confide... | 24.8 | -6.3 | 14.5 | ... | 0.11 | 7.920000e-03 | 1.00 | 37.1 | -4.6 | 10.6 | 0.69 | -0.13 | 0.13 | 1,700 |
2 | GW151226-v2 | GW151226 | 2 | GWTC-2.1-confident | 1.135136e+09 | /GWTC-2.1/ | https://gwosc.org/eventapi/json/GWTC-1-confide... | 14.2 | -3.6 | 11.1 | ... | 0.03 | 1.000000e-07 | 1.00 | 20.5 | -1.5 | 6.4 | 0.75 | -0.05 | 0.12 | 950 |
3 | GW170104-v2 | GW170104 | 2 | GWTC-2.1-confident | 1.167560e+09 | /GWTC-2.1/ | https://gwosc.org/eventapi/json/GWTC-1-confide... | 28.7 | -4.2 | 6.6 | ... | 0.07 | 1.000000e-07 | 1.00 | 47.5 | -3.4 | 4.5 | 0.67 | -0.08 | 0.06 | 1,000 |
4 | GW170608-v3 | GW170608 | 3 | GWTC-2.1-confident | 1.180922e+09 | /GWTC-2.1/ | https://gwosc.org/eventapi/json/GWTC-1-confide... | 10.6 | -1.4 | 4.0 | ... | 0.03 | 1.000000e-07 | 1.00 | 17.7 | -0.6 | 2.1 | 0.69 | -0.03 | 0.03 | 380 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
85 | GW200306_093714-v1 | GW200306_093714 | 1 | GWTC-3-confident | 1.267523e+09 | /GWTC-3/ | https://gwosc.org/eventapi/json/GWTC-3-confide... | 28.3 | -7.7 | 17.1 | ... | 0.24 | 2.400000e+01 | 0.81 | 41.7 | -6.9 | 12.3 | 0.78 | -0.26 | 0.11 | 4,600 |
86 | GW200308_173609-v1 | GW200308_173609 | 1 | GWTC-3-confident | 1.267724e+09 | /GWTC-3/ | https://gwosc.org/eventapi/json/GWTC-3-confide... | 60.0 | -29.0 | 166.0 | ... | 1.47 | 2.400000e+00 | 0.86 | 88.0 | -47.0 | 169.0 | 0.72 | -0.35 | -0.22 | 12,000 |
87 | GW200311_115853-v1 | GW200311_115853 | 1 | GWTC-3-confident | 1.267963e+09 | /GWTC-3/ | https://gwosc.org/eventapi/json/GWTC-3-confide... | 34.2 | -3.8 | 6.4 | ... | 0.05 | 1.000000e-05 | 0.99 | 59.0 | -3.9 | 4.8 | 0.69 | -0.08 | 0.07 | 35 |
88 | GW200316_215756-v1 | GW200316_215756 | 1 | GWTC-3-confident | 1.268431e+09 | /GWTC-3/ | https://gwosc.org/eventapi/json/GWTC-3-confide... | 13.1 | -2.9 | 10.2 | ... | 0.08 | 1.000000e-05 | 0.99 | 20.2 | -1.9 | 7.4 | 0.70 | -0.04 | 0.04 | 190 |
89 | GW200322_091133-v1 | GW200322_091133 | 1 | GWTC-3-confident | 1.268904e+09 | /GWTC-3/ | https://gwosc.org/eventapi/json/GWTC-3-confide... | 38.0 | -22.0 | 130.0 | ... | 1.43 | 1.400000e+02 | 0.62 | 48.0 | -22.0 | 132.0 | 0.77 | -0.39 | 0.19 | 18,000 |
90 rows × 40 columns
events = [i for i in gw_data['commonName']]
events
['GW150914', 'GW151012', 'GW151226', 'GW170104', 'GW170608', 'GW170729', 'GW170809', 'GW170814', 'GW170817', 'GW170818', 'GW170823', 'GW190403_051519', 'GW190408_181802', 'GW190412', 'GW190413_052954', 'GW190413_134308', 'GW190421_213856', 'GW190425', 'GW190426_190642', 'GW190503_185404', 'GW190512_180714', 'GW190513_205428', 'GW190514_065416', 'GW190517_055101', 'GW190519_153544', 'GW190521', 'GW190521_074359', 'GW190527_092055', 'GW190602_175927', 'GW190620_030421', 'GW190630_185205', 'GW190701_203306', 'GW190706_222641', 'GW190707_093326', 'GW190708_232457', 'GW190719_215514', 'GW190720_000836', 'GW190725_174728', 'GW190727_060333', 'GW190728_064510', 'GW190731_140936', 'GW190803_022701', 'GW190805_211137', 'GW190814', 'GW190828_063405', 'GW190828_065509', 'GW190910_112807', 'GW190915_235702', 'GW190916_200658', 'GW190917_114630', 'GW190924_021846', 'GW190925_232845', 'GW190926_050336', 'GW190929_012149', 'GW190930_133541', 'GW191103_012549', 'GW191105_143521', 'GW191109_010717', 'GW191113_071753', 'GW191126_115259', 'GW191127_050227', 'GW191129_134029', 'GW191204_110529', 'GW191204_171526', 'GW191215_223052', 'GW191216_213338', 'GW191219_163120', 'GW191222_033537', 'GW191230_180458', 'GW200112_155838', 'GW200115_042309', 'GW200128_022011', 'GW200129_065458', 'GW200202_154313', 'GW200208_130117', 'GW200208_222617', 'GW200209_085452', 'GW200210_092254', 'GW200216_220804', 'GW200219_094415', 'GW200220_061928', 'GW200220_124850', 'GW200224_222234', 'GW200225_060421', 'GW200302_015811', 'GW200306_093714', 'GW200308_173609', 'GW200311_115853', 'GW200316_215756', 'GW200322_091133']
from gwosc.locate import get_event_urls
import urllib.request
# Collect URLs containing 32s of strain data for each event
all_urls = []
for event in events:
url_list = get_event_urls(event, duration=32, detector='H1')
# If no URL for detector 'H1', get the URL for detector 'L1'
if not url_list:
url_list = get_event_urls(event, duration=32, detector='L1')
all_urls.extend(url_list)
# Download strain data for all events
def download(url):
filename = events[i] + '.hdf5'
print('Downloading ' + url )
urllib.request.urlretrieve(url, filename)
print("File download complete:", filename)
return filename
for i in range(len(events)):
url = all_urls[i]
download(url)
Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW150914/v3/H-H1_GWOSC_4KHZ_R1-1126259447-32.hdf5 File download complete: GW150914.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW151012/v3/H-H1_GWOSC_4KHZ_R1-1128678885-32.hdf5 File download complete: GW151012.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW151226/v2/H-H1_GWOSC_4KHZ_R1-1135136335-32.hdf5 File download complete: GW151226.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW170104/v2/H-H1_GWOSC_4KHZ_R1-1167559921-32.hdf5 File download complete: GW170104.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW170608/v3/H-H1_GWOSC_4KHZ_R1-1180922479-32.hdf5 File download complete: GW170608.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW170729/v1/H-H1_GWOSC_4KHZ_R1-1185389792-32.hdf5 File download complete: GW170729.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW170809/v1/H-H1_GWOSC_4KHZ_R1-1186302504-32.hdf5 File download complete: GW170809.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW170814/v3/H-H1_GWOSC_4KHZ_R1-1186741846-32.hdf5 File download complete: GW170814.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW170817/v3/H-H1_GWOSC_4KHZ_R1-1187008867-32.hdf5 File download complete: GW170817.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW170818/v1/H-H1_GWOSC_4KHZ_R1-1187058312-32.hdf5 File download complete: GW170818.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-1-confident/GW170823/v1/H-H1_GWOSC_4KHZ_R1-1187529241-32.hdf5 File download complete: GW170823.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190403_051519/v1/H-H1_GWOSC_4KHZ_R1-1238303722-32.hdf5 File download complete: GW190403_051519.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190408_181802/v2/H-H1_GWOSC_4KHZ_R1-1238782685-32.hdf5 File download complete: GW190408_181802.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190412/v4/H-H1_GWOSC_4KHZ_R1-1239082247-32.hdf5 File download complete: GW190412.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190413_052954/v2/H-H1_GWOSC_4KHZ_R1-1239168597-32.hdf5 File download complete: GW190413_052954.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190413_134308/v2/H-H1_GWOSC_4KHZ_R1-1239198191-32.hdf5 File download complete: GW190413_134308.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190421_213856/v2/H-H1_GWOSC_4KHZ_R1-1239917939-32.hdf5 File download complete: GW190421_213856.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190425/v3/L-L1_GWOSC_4KHZ_R1-1240215487-32.hdf5 File download complete: GW190425.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190426_190642/v1/H-H1_GWOSC_4KHZ_R1-1240340805-32.hdf5 File download complete: GW190426_190642.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190503_185404/v2/H-H1_GWOSC_4KHZ_R1-1240944847-32.hdf5 File download complete: GW190503_185404.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190512_180714/v2/H-H1_GWOSC_4KHZ_R1-1241719637-32.hdf5 File download complete: GW190512_180714.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190513_205428/v2/H-H1_GWOSC_4KHZ_R1-1241816071-32.hdf5 File download complete: GW190513_205428.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190514_065416/v2/H-H1_GWOSC_4KHZ_R1-1241852059-32.hdf5 File download complete: GW190514_065416.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190517_055101/v2/H-H1_GWOSC_4KHZ_R1-1242107464-32.hdf5 File download complete: GW190517_055101.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190519_153544/v2/H-H1_GWOSC_4KHZ_R1-1242315347-32.hdf5 File download complete: GW190519_153544.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190521/v4/H-H1_GWOSC_4KHZ_R1-1242442952-32.hdf5 File download complete: GW190521.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190521_074359/v2/H-H1_GWOSC_4KHZ_R1-1242459842-32.hdf5 File download complete: GW190521_074359.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190527_092055/v2/H-H1_GWOSC_4KHZ_R1-1242984058-32.hdf5 File download complete: GW190527_092055.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190602_175927/v2/H-H1_GWOSC_4KHZ_R1-1243533569-32.hdf5 File download complete: GW190602_175927.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190620_030421/v2/L-L1_GWOSC_4KHZ_R1-1245035064-32.hdf5 File download complete: GW190620_030421.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190630_185205/v2/L-L1_GWOSC_4KHZ_R1-1245955928-32.hdf5 File download complete: GW190630_185205.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190701_203306/v2/H-H1_GWOSC_4KHZ_R1-1246048389-32.hdf5 File download complete: GW190701_203306.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190706_222641/v2/H-H1_GWOSC_4KHZ_R1-1246487204-32.hdf5 File download complete: GW190706_222641.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190707_093326/v2/H-H1_GWOSC_4KHZ_R1-1246527209-32.hdf5 File download complete: GW190707_093326.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190708_232457/v2/L-L1_GWOSC_4KHZ_R1-1246663500-32.hdf5 File download complete: GW190708_232457.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190719_215514/v2/H-H1_GWOSC_4KHZ_R1-1247608517-32.hdf5 File download complete: GW190719_215514.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190720_000836/v2/H-H1_GWOSC_4KHZ_R1-1247616519-32.hdf5 File download complete: GW190720_000836.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190725_174728/v1/H-H1_GWOSC_4KHZ_R1-1248112051-32.hdf5 File download complete: GW190725_174728.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190727_060333/v2/H-H1_GWOSC_4KHZ_R1-1248242616-32.hdf5 File download complete: GW190727_060333.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190728_064510/v2/H-H1_GWOSC_4KHZ_R1-1248331513-32.hdf5 File download complete: GW190728_064510.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190731_140936/v2/H-H1_GWOSC_4KHZ_R1-1248617379-32.hdf5 File download complete: GW190731_140936.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190803_022701/v2/H-H1_GWOSC_4KHZ_R1-1248834424-32.hdf5 File download complete: GW190803_022701.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190805_211137/v1/H-H1_GWOSC_4KHZ_R1-1249074700-32.hdf5 File download complete: GW190805_211137.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190814/v3/H-H1_GWOSC_4KHZ_R1-1249852241-32.hdf5 File download complete: GW190814.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190828_063405/v2/H-H1_GWOSC_4KHZ_R1-1251009248-32.hdf5 File download complete: GW190828_063405.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190828_065509/v2/H-H1_GWOSC_4KHZ_R1-1251010512-32.hdf5 File download complete: GW190828_065509.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190910_112807/v2/L-L1_GWOSC_4KHZ_R1-1252150090-32.hdf5 File download complete: GW190910_112807.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190915_235702/v2/H-H1_GWOSC_4KHZ_R1-1252627025-32.hdf5 File download complete: GW190915_235702.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190916_200658/v1/H-H1_GWOSC_4KHZ_R1-1252699621-32.hdf5 File download complete: GW190916_200658.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190917_114630/v1/H-H1_GWOSC_4KHZ_R1-1252755992-32.hdf5 File download complete: GW190917_114630.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190924_021846/v2/H-H1_GWOSC_4KHZ_R1-1253326729-32.hdf5 File download complete: GW190924_021846.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190925_232845/v1/H-H1_GWOSC_4KHZ_R1-1253489328-32.hdf5 File download complete: GW190925_232845.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190926_050336/v1/H-H1_GWOSC_4KHZ_R1-1253509418-32.hdf5 File download complete: GW190926_050336.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190929_012149/v2/H-H1_GWOSC_4KHZ_R1-1253755312-32.hdf5 File download complete: GW190929_012149.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-2.1-confident/GW190930_133541/v2/H-H1_GWOSC_4KHZ_R1-1253885744-32.hdf5 File download complete: GW190930_133541.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191103_012549/v1/H-H1_GWOSC_4KHZ_R1-1256779552-32.hdf5 File download complete: GW191103_012549.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191105_143521/v1/H-H1_GWOSC_4KHZ_R1-1256999724-32.hdf5 File download complete: GW191105_143521.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191109_010717/v1/H-H1_GWOSC_4KHZ_R1-1257296840-32.hdf5 File download complete: GW191109_010717.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191113_071753/v1/H-H1_GWOSC_4KHZ_R1-1257664676-32.hdf5 File download complete: GW191113_071753.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191126_115259/v1/H-H1_GWOSC_4KHZ_R1-1258804382-32.hdf5 File download complete: GW191126_115259.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191127_050227/v1/H-H1_GWOSC_4KHZ_R1-1258866150-32.hdf5 File download complete: GW191127_050227.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191129_134029/v1/H-H1_GWOSC_4KHZ_R1-1259070032-32.hdf5 File download complete: GW191129_134029.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191204_110529/v1/H-H1_GWOSC_4KHZ_R1-1259492732-32.hdf5 File download complete: GW191204_110529.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191204_171526/v1/H-H1_GWOSC_4KHZ_R1-1259514928-32.hdf5 File download complete: GW191204_171526.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191215_223052/v1/H-H1_GWOSC_4KHZ_R1-1260484255-32.hdf5 File download complete: GW191215_223052.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191216_213338/v1/H-H1_GWOSC_4KHZ_R1-1260567221-32.hdf5 File download complete: GW191216_213338.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191219_163120/v1/H-H1_GWOSC_4KHZ_R1-1260808283-32.hdf5 File download complete: GW191219_163120.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191222_033537/v1/H-H1_GWOSC_4KHZ_R1-1261020940-32.hdf5 File download complete: GW191222_033537.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW191230_180458/v1/H-H1_GWOSC_4KHZ_R1-1261764301-32.hdf5 File download complete: GW191230_180458.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200112_155838/v1/L-L1_GWOSC_4KHZ_R1-1262879920-32.hdf5 File download complete: GW200112_155838.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200115_042309/v2/H-H1_GWOSC_4KHZ_R1-1263097392-32.hdf5 File download complete: GW200115_042309.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200128_022011/v1/H-H1_GWOSC_4KHZ_R1-1264213214-32.hdf5 File download complete: GW200128_022011.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200129_065458/v1/H-H1_GWOSC_4KHZ_R1-1264316101-32.hdf5 File download complete: GW200129_065458.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200202_154313/v1/H-H1_GWOSC_4KHZ_R1-1264693396-32.hdf5 File download complete: GW200202_154313.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200208_130117/v1/H-H1_GWOSC_4KHZ_R1-1265202080-32.hdf5 File download complete: GW200208_130117.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200208_222617/v1/H-H1_GWOSC_4KHZ_R1-1265235980-32.hdf5 File download complete: GW200208_222617.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200209_085452/v1/H-H1_GWOSC_4KHZ_R1-1265273695-32.hdf5 File download complete: GW200209_085452.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200210_092254/v1/H-H1_GWOSC_4KHZ_R1-1265361777-32.hdf5 File download complete: GW200210_092254.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200216_220804/v1/H-H1_GWOSC_4KHZ_R1-1265926087-32.hdf5 File download complete: GW200216_220804.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200219_094415/v1/H-H1_GWOSC_4KHZ_R1-1266140658-32.hdf5 File download complete: GW200219_094415.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200220_061928/v1/H-H1_GWOSC_4KHZ_R1-1266214771-32.hdf5 File download complete: GW200220_061928.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200220_124850/v1/H-H1_GWOSC_4KHZ_R1-1266238133-32.hdf5 File download complete: GW200220_124850.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200224_222234/v1/H-H1_GWOSC_4KHZ_R1-1266618157-32.hdf5 File download complete: GW200224_222234.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200225_060421/v1/H-H1_GWOSC_4KHZ_R1-1266645864-32.hdf5 File download complete: GW200225_060421.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200302_015811/v1/H-H1_GWOSC_4KHZ_R1-1267149494-32.hdf5 File download complete: GW200302_015811.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200306_093714/v1/H-H1_GWOSC_4KHZ_R1-1267522637-32.hdf5 File download complete: GW200306_093714.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200308_173609/v1/H-H1_GWOSC_4KHZ_R1-1267724172-32.hdf5 File download complete: GW200308_173609.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200311_115853/v1/H-H1_GWOSC_4KHZ_R1-1267963136-32.hdf5 File download complete: GW200311_115853.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200316_215756/v1/H-H1_GWOSC_4KHZ_R1-1268431079-32.hdf5 File download complete: GW200316_215756.hdf5 Downloading https://gwosc.org/eventapi/json/GWTC-3-confident/GW200322_091133/v1/H-H1_GWOSC_4KHZ_R1-1268903496-32.hdf5 File download complete: GW200322_091133.hdf5
from gwpy.timeseries import TimeSeries
from gwosc.datasets import event_gps
import matplotlib.pyplot as plt
# Function that will create a spectrogram for any of the events
def q_plots(event):
filepath = 'HDF5 files/' + event + '.hdf5'
strain = TimeSeries.read(filepath, format='hdf5.gwosc')
gps = event_gps(event)
q = strain.q_transform(outseg=(gps-0.3, gps+0.3), qrange = (5,5))
spectrogram = q.plot()
ax = spectrogram.gca()
spectrogram.colorbar(label="Normalized energy", vmax = 25)
ax.grid(False)
ax.set_yscale('log')
ax.set_ylim(bottom=10, top=1000)
plt.title(event + ' Spectrogram')
plt.show()
# Plotting spectrograms for all events
for event in events:
q_plots(event)