Created
March 19, 2014 10:14
-
-
Save 153957/9638912 to your computer and use it in GitHub Desktop.
Check for coincidences between stations from different clusters.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tables | |
data = tables.openFile('2013_8_1.h5', 'r') | |
c_index = data.root.coincidences.c_index | |
s_index = data.root.coincidences.s_index | |
clusters = [s_group.split('/')[2][8:] for s_group in s_index[:]] | |
stations = [s_group.split('/')[3][8:] for s_group in s_index[:]] | |
counter = 0 | |
for c_id, c_idx in enumerate(c_index[:]): | |
clusters_in_c = [] | |
for s_idx, e_idx in c_idx: | |
cluster = clusters[s_idx] | |
if not cluster in clusters_in_c: | |
clusters_in_c.append(cluster) | |
if len(clusters_in_c) > 1: | |
counter += 1 | |
print ('coincidence_id: %d events: %d clusters: %s' % | |
(c_id, coincidences[c_id]['N'], clusters_in_c)) | |
print ('Total coincidences: %d Coincidences spanning clusters: %d' | |
(c_index.nrows, counter) | |
data.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment