Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALBurst 2.0.7.1-ea7c608
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Macros Modules Pages
lalburst.snglcluster Namespace Reference

Functions

def smallest_enclosing_seg (a, b)
 Return the smallest segment that contains both a and b. More...
 
def weighted_average_seg (seg1, weight1, seg2, weight2)
 Return the segment whose start and ends are the weighted arithmetic means of the start and ends of the two input segments, using the two weights given. More...
 
def cluster_events (events, testfunc, clusterfunc, sortkeyfunc=None, bailoutfunc=None, verbose=False)
 Cluster the events in an event list. More...
 

Function Documentation

◆ smallest_enclosing_seg()

def lalburst.snglcluster.smallest_enclosing_seg (   a,
  b 
)

Return the smallest segment that contains both a and b.

Definition at line 51 of file snglcluster.py.

◆ weighted_average_seg()

def lalburst.snglcluster.weighted_average_seg (   seg1,
  weight1,
  seg2,
  weight2 
)

Return the segment whose start and ends are the weighted arithmetic means of the start and ends of the two input segments, using the two weights given.

The arithmetic means are computed in a way that is safe for LIGOTimeGPS objects.

Definition at line 63 of file snglcluster.py.

◆ cluster_events()

def lalburst.snglcluster.cluster_events (   events,
  testfunc,
  clusterfunc,
  sortkeyfunc = None,
  bailoutfunc = None,
  verbose = False 
)

Cluster the events in an event list.

testfunc will be passed a pair of events in random order, and must return 0 (or False) if they should be clustered. clusterfunc will be passed a pair of events in random order, and must return an event that is the "cluster" of the two. clusterfunc is free to return a new events, or modify one or the other of its parameters in place and return it.

If sortkeyfunc and bailoutfunc are both not None (if one is provided the other must be as well), the events will be sorted into "increasing" order using sortkeyfunc as a sort key operator, and then only pairs of events for which bailoutfunc returns 0 (or False) will be considered for clustering.

The return value is True if the events in the event list were modified, and False if they were not (although their order might have changed).

Definition at line 95 of file snglcluster.py.