### Navigation

- index
- modules |
- modules |
- next |
- previous |
- homepage|
- search|
- documentation »
- toolbox - Toolbox of various functions and generic utilities »

# spacepy.toolbox.tOverlap

`spacepy.toolbox.``tOverlap`(ts1, ts2, *args, **kwargs)

  Finds the overlapping elements in two lists of datetime objects

  Parameters: | ts1 : datetime first set of datetime object ts2 : datetime datatime object args : : additional arguments passed to tOverlapHalf
  Returns: | out : list indices of ts1 within interval of ts2, & vice versa

  See also

  `tOverlapHalf`, `tCommon`

  Examples

  Given two series of datetime objects, event_dates and omni[‘Time’]:

      >>> import spacepy.toolbox as tb
      >>> from spacepy import omni
      >>> import datetime
      >>> event_dates = st.tickrange(datetime.datetime(2000, 1, 1), datetime.datetime(2000, 10, 1), deltadays=3)
      >>> onni_dates = st.tickrange(datetime.datetime(2000, 1, 1), datetime.datetime(2000, 10, 1), deltadays=0.5)
      >>> omni = omni.get_omni(onni_dates)
      >>> [einds,oinds] = tb.tOverlap(event_dates, omni['ticks'])
      >>> omni_time = omni['ticks'][oinds[0]:oinds[-1]+1]
      >>> print omni_time
      [datetime.datetime(2000, 1, 1, 0, 0), datetime.datetime(2000, 1, 1, 12, 0),
      ... , datetime.datetime(2000, 9, 30, 0, 0)]

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- homepage|
- search|
- documentation »
- toolbox - Toolbox of various functions and generic utilities »