Commit 8e14f37a authored by Marius Kriegerowski's avatar Marius Kriegerowski
Browse files

ifc: doc. TraceSelector for onsetifc

parent 757748a3
......@@ -15,12 +15,23 @@ guts_prefix = 'lassie'
class TraceSelector(Object):
'''
Filter traces used in an IFC using NSLC-id lists and/or lists of regular
Filter traces used in an IFC by NSLC-id lists and/or lists of regular
expressions.
'''
white_list = List.T(optional=True, default=[])
white_list_regex = List.T(String.T(default=[]))
white_list = List.T(
optional=True,
default=[],
help='list of NSLC ids'
)
white_list_regex = List.T(
String.T(
default=[],
optional=True,
),
help='list of regular expressions'
)
def __call__(self, trs):
matched = []
......@@ -44,11 +55,13 @@ class IFC(Object):
'''Image function contribution.'''
name = String.T()
weight = Float.T(default=1.0)
weight = Float.T(
default=1.0,
help='global weight for this IFC')
weights = Dict.T(
String.T(),
Float.T(),
String.T('NSL regular expression identifying stations'),
Float.T('weighting factor'),
optional=True,
help='weight selected traces')
......@@ -56,6 +69,9 @@ class IFC(Object):
fmax = Float.T()
shifter = shifter.Shifter.T(optional=True)
trace_selector = TraceSelector.T(
optional=True, help='select traces to be treated by this IFC')
def __init__(self, *args, **kwargs):
Object.__init__(self, *args, **kwargs)
self.shifter.t_tolerance = 1./(self.fmax * 2.)
......@@ -111,7 +127,6 @@ class WavePacketIFC(IFC):
fsmooth = Float.T(optional=True)
fsmooth_factor = Float.T(default=0.1)
trace_selector = TraceSelector.T(optional=True)
def get_tpad(self):
return 4. / self.get_fsmooth()
......@@ -228,6 +243,9 @@ class OnsetIFC(IFC):
fsmooth = self.get_fsmooth()
fnormalize = self.get_fnormalize()
if self.trace_selector:
trs = self.trace_selector(trs)
if not trs:
return []
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment