-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsimilarity.py
32 lines (28 loc) · 1.05 KB
/
similarity.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from pyrocko import trace, model
from pyrocko.guts import Object, Int, Float, List, String
from pyrocko.gf import SeismosizerTrace, Target
class Similarity(Object):
'''CC result of one event pair at one target.'''
ievent = Int.T(
help='Event identifier')
jevent = Int.T(
help='Event identifier')
itarget = Int.T(
help='Target identifier')
cross_correlation = Float.T()
cross_correlation_trace = SeismosizerTrace.T(optional=True)
relative_amplitude = Float.T(
help='Relative amplitude with reference to ievent.')
time_lag = Float.T(
help='Time lag at maximum of cross correlation')
class SimilarityMatrix(Object):
''' A container class to store a list of :py:class:`Similarity` instances
and how they have been calculated.'''
events = List.T(model.Event.T())
targets = List.T(Target.T())
similarities = List.T(Similarity.T())
filters = List.T(trace.FrequencyResponse.T())
padding = Float.T()
windowing_method = String.T()
vmin = Float.T()
vmax = Float.T()