original_docstring: Helper function for bar lengths allowing linear interpolation to fin the point where the criteria is crossed.
      Use either comp='lt' or comp='gt' to decide in which direction to fin the crossing. ifid should be an index point
      well into the bar to avoid e.g. finding an inner bar, when you wanted the outer.
docstring: Helper function for bar lengths allowing linear interpolation to fin the point where the criteria is crossed.
  Use either comp='lt' or comp='gt' to decide in which direction to fin the crossing. ifid should be an index point
  well into the bar to avoid e.g. finding an inner bar, when you wanted the outer.
docstring_tokens: Helper function for bar lengths allowing linear interpolation to fin the point where the criteria is crossed . Use either comp = ' lt ' or comp = ' gt ' to decide in which direction to fin the crossing . ifid should be an index point well into the bar to avoid e . g . finding an inner bar when you wanted the outer .
code: def interplen(r, vals, lim, ifid, comp='lt'):
      """Helper function for bar lengths allowing linear interpolation to fin the point where the criteria is crossed.
      Use either comp='lt' or comp='gt' to decide in which direction to fin the crossing. ifid should be an index point
      well into the bar to avoid e.g. finding an inner bar, when you wanted the outer."""
      if comp == 'lt':
          i = (vals > lim)  # bad points
      else:
          i = (vals < lim)  # bad points
      in_bar_i = i.nonzero()[0][i.nonzero()[0] > ifid]
      if len(in_bar_i) == 0:
          return np.nan
      last_i = np.min(in_bar_i)
      r0, val0 = r[last_i], vals[last_i]
      r1, val1 = r[last_i - 1], vals[last_i - 1]
      thisbarlen = r1 * (val0 - lim) / (val0 - val1) + r0 * (lim - val1) / (
                  val0 - val1)
      return thisbarlen
code_tokens: def interplen ( r , vals , lim , ifid , comp = 'lt' ) : if comp == 'lt' : i = ( vals > lim ) else : i = ( vals < lim ) in_bar_i = i . nonzero ( ) [ 0 ] [ i . nonzero ( ) [ 0 ] > ifid ] if len ( in_bar_i ) == 0 : return np . nan last_i = np . min ( in_bar_i ) r0 , val0 = r [ last_i ] , vals [ last_i ] r1 , val1 = r [ last_i - 1 ] , vals [ last_i - 1 ] thisbarlen = r1 * ( val0 - lim ) / ( val0 - val1 ) + r0 * ( lim - val1 ) / ( val0 - val1 ) return thisbarlen
short_docstring: Helper function for bar lengths allowing linear interpolation to fin the point where the criteria is crossed.
short_docstring_tokens: Helper function for bar lengths allowing linear interpolation to fin the point where the criteria is crossed .
comment: """Helper function for bar lengths allowing linear interpolation to fin the point where the criteria is crossed.
      Use either comp='lt' or comp='gt' to decide in which direction to fin the crossing. ifid should be an index point
      well into the bar to avoid e.g. finding an inner bar, when you wanted the outer."""$SEP$# bad points$SEP$# bad points