diff --git a/pycbc/events/stat.py b/pycbc/events/stat.py index e917ad63f22..ff75ba48312 100644 --- a/pycbc/events/stat.py +++ b/pycbc/events/stat.py @@ -898,7 +898,19 @@ def assign_dq_val(self, key): return dq_dict def find_dq_val(self, trigs): - """Get dq values for a specific ifo and times""" + """Get dq values for a specific ifo and times + + Parameters + ---------- + trigs: ReadByTempate or SingleDetTriggers object + Object containing information about the triggers to be + checked + + Returns + ------- + dq_val: numpy array + The value of the dq reweighting factor for each trigger + """ time = trigs['end_time'].astype(int) try: tnum = trigs.template_num @@ -1150,8 +1162,18 @@ def sensitive_volume_factor(self, sngls): should be given by the volume of the sphere to which we are sensitive. - This is then the cube of the sensitive distance (sigma), divided - by a benchmark volume. + Parameters + ---------- + sngls: tuple + Single-detector information, tuples of the (ifo, sngl_object), + where sngl_object is a ReadByTemplate object or similar. + + Returns + ------- + network_logvol: numpy.array + Array of values for the network log-volume factor. This is the + log of the cube of the sensitive distance (sigma), divided by + a benchmark volume. """ # Network sensitivity for a given coinc type is approximately # determined by the least sensitive ifo @@ -1173,6 +1195,18 @@ def logsignalrate_shared(self, sngls_info): """ Calculate the parts of the log signal rate which are shared by both the single and coinc ranking statistics + + Parameters + ---------- + sngls_info: tuple + Single-detector information, tuples of the (ifo, sngl_object), + where sngl_object is a ReadByTemplate object or similar. + + Returns + ------- + sr_factor: numpy.ndarray + Array of values to be added to the ranking statistic when + taking various signal rate factors into account """ # Other features affecting the signal rate sr_factor = 0 @@ -1229,6 +1263,28 @@ def rank_stat_coinc(self, s, slide, step, to_shift, **kwargs): # pylint:disable=unused-argument """ Calculate the coincident detection statistic. + + Parameters + ---------- + s: list + List of (ifo, single detector statistic) tuples + slide: numpy array + The number of steps by which to shift each trigger + step: float + The size of each step, to be multiplied by to_shift + to_shift: list + List of integers indicating what multiples of the time shift will + be applied + kwargs: various + Key-word arguments to define different features and tunable + values in the statistic. Only time_addition is used here + + Returns + ------- + loglr: numpy.ndarray + The ranking statistic for each trigger based on the supplied + triggers, requested features and keyword arguments + """ # ranking statistic is -ln(expected rate density of noise triggers) # plus normalization constant @@ -1296,6 +1352,25 @@ def coinc_lim_for_thresh(self, s, thresh, limifo, rate calculation, we take the best-case scenario. By using the best-case for signal rate in this calculation, some events are kept at this point which are hopeless. + + Parameters + ---------- + s: list + List of (ifo, single detector statistic) tuples + thresh: float + The threshold value to be checked against + limifo: string + The pivot detector, i.e. the one in which the sngl stat must + reach the value output by ths function + kwargs: various + Key-word arguments to define different features and tunable + values in the statistic. Only time_addition is used here + + Returns + ------- + numpy.array + The minimum snglstat values required in the 'pivot' detector + in order to reach the threshold specified """ # Safety against subclassing and not rethinking this allowed_names = ['ExpFitStatistic']