6.2.2.1.1. eqcorrscan.utils.catalog_to_dd.compute_differential_times

eqcorrscan.utils.catalog_to_dd.compute_differential_times(catalog, correlation, stream_dict=None, event_id_mapper=None, max_sep=8.0, min_link=8, min_cc=None, extract_len=None, pre_pick=None, shift_len=None, interpolate=False, all_horiz=False, max_workers=None, max_trace_workers=1, use_shared_memory=False, weight_by_square=True, *args, **kwargs)[source]

Generate groups of differential times for a catalog.

Parameters:
  • catalog (obspy.core.event.Catalog) – Catalog of events to get differential times for

  • correlation (bool) – If True will generate cross-correlation derived differential-times for a dt.cc file. If false, will generate catalog times for a dt.ct file.

  • stream_dict (dict) – Dictionary of streams keyed by event-id (the event.resource_id.id, NOT the hypoDD event-id)

  • event_id_mapper (dict) – Dictionary mapping event resource id to an integer event id for hypoDD. If this is None, or missing events then the dictionary will be updated to include appropriate event-ids. This should be of the form {event.resource_id.id: integer_id}

  • max_sep (float) – Maximum hypocentral separation in km to link events

  • min_link (int) – Minimum shared phase observations to link events

  • min_cc (float) – Threshold to include cross-correlation results.

  • extract_len (float) – Length in seconds to extract around the pick

  • pre_pick (float) – Time before the pick to start the correlation window

  • shift_len (float) – Time (+/-) to allow pick to vary in seconds. e.g. if shift_len is set to 1s, the pick will be allowed to shift between pick_time - 1 and pick_time + 1.

  • interpolate (bool) – Whether to interpolate correlations or not. Allows subsample accuracy

  • max_workers (int) – Maximum number of workers for parallel correlation of events. If None then all threads will be used.

  • max_trace_workers (int) – Maximum number of workers for parallel correlation of traces insted of events. If None then all threads will be used (but can only be used when max_workers = 1).

  • use_shared_memory (bool) – Whether to move trace data arrays into shared memory for computing trace correlations. Can speed up total execution time by ~20 % for hypodd-correlations with a lot of clustered seismicity.

  • weight_by_square (bool) – Whether to compute correlation weights as the square of the maximum correlation (True), or the maximum correlation (False).

Return type:

dict

Returns:

Dictionary of differential times keyed by event id.

Return type:

dict

Returns:

Dictionary of event_id_mapper

Note

The arguments min_cc, stream_dict, extract_len, pre_pick, shift_len and interpolate are only required if correlation=True.

Two parallelization strategies are available for correlating waveforms: parallelization across events (default) or across each event’s traces (when max_workers = 1 and max_traces_workers > 1). The former is often quicker for short traces because it generally loads the CPU better for multiple events and may require more memory, but the latter can be quicker for few events with many or very long traces and requires less memory.

Note

Differential times are computed as travel-time for event 1 minus travel-time for event 2 (tt1 - tt2).