# 5.4.1.13. eqcorrscan.utils.clustering.space_time_cluster

`eqcorrscan.utils.clustering.``space_time_cluster`(catalog, t_thresh, d_thresh)

  Cluster detections in space and time.

  Use to separate repeaters from other events. Clusters by distance first, then removes events in those groups that are at different times.

  Parameters: | catalog (obspy.core.event.Catalog) Catalog of events to clustered t_thresh (float) Maximum inter-event time threshold in seconds d_thresh (float) Maximum inter-event distance in km
  Returns: | list of `obspy.core.event.Catalog` objects
  Return type: | list

      >>> from eqcorrscan.utils.clustering import space_time_cluster
      >>> from obspy.clients.fdsn import Client
      >>> from obspy import UTCDateTime
      >>> client = Client("https://earthquake.usgs.gov")
      >>> starttime = UTCDateTime("2002-01-01")
      >>> endtime = UTCDateTime("2002-02-01")
      >>> cat = client.get_events(starttime=starttime, endtime=endtime,
      ...                         minmagnitude=6)
      >>> groups = space_time_cluster(catalog=cat, t_thresh=86400, d_thresh=1000)