code: def mean_if_greater_than_zero(vals):
      
      vals = numpy.array(vals)
      above_zero = vals > 0
      return vals[above_zero].mean(), above_zero.sum()
docs: Calculate mean over numerical values, ignoring values less than zero.
      E.g. used for mean time over coincident triggers when timestamps are set
      to -1 for ifos not included in the coincidence.
  
      Parameters
      ----------
      vals: iterator of numerical values
          values to be mean averaged
  
      Returns
      -------
      mean: float
          The mean of the values in the original vector which are
          greater than zero
      num_above_zero: int
          The number of entries in the vector which are above zero