# spacepy.toolbox.tOverlapHalf

spacepy.toolbox.tOverlapHalf(ts1, ts2, presort=False)

  Find overlapping elements in two lists of datetime objects

  This is one-half of tOverlap, i.e. it finds only occurrences where ts2 exists within the bounds of ts1, or the second element returned by tOverlap.

  Parameters
    ts1 list

      first set of datetime object

    ts2 list

      datatime object

    presort bool
      Set to use a faster algorithm which assumes ts1 and

        ts2 are both sorted in ascending order. This speeds up the overlap comparison by about 50x, so it is worth sorting the list if one sort can be done for many calls to tOverlap

  Returns
    out list

      indices of ts2 within interval of ts1

      note: Returns empty list if no overlap found

  See also

  `tOverlap`
  `tCommon`