5.4.1.12. eqcorrscan.utils.clustering.space_cluster¶
-
eqcorrscan.utils.clustering.
space_cluster
(catalog, d_thresh, show=True)[source]¶ Cluster a catalog by distance only.
Will compute the matrix of physical distances between events and utilize the
scipy.clustering.hierarchy
module to perform the clustering.Parameters: - catalog (obspy.core.event.Catalog) Catalog of events to clustered
- d_thresh (float) Maximum inter-event distance threshold
Returns: list of
obspy.core.event.Catalog
objectsReturn type: list
>>> from eqcorrscan.utils.clustering import space_cluster >>> from obspy.clients.fdsn import Client >>> from obspy import UTCDateTime >>> client = Client("NCEDC") >>> starttime = UTCDateTime("2002-01-01") >>> endtime = UTCDateTime("2002-02-01") >>> cat = client.get_events(starttime=starttime, endtime=endtime, ... minmagnitude=2) >>> groups = space_cluster(catalog=cat, d_thresh=2, show=False)
>>> from eqcorrscan.utils.clustering import space_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_cluster(catalog=cat, d_thresh=1000, show=False)