# 5.16.1.3. eqcorrscan.utils.stacking.align_traces

`eqcorrscan.utils.stacking.``align_traces`(trace_list, shift_len, master=False, positive=False, plot=False)

  Align traces relative to each other based on their cross-correlation value.

  Uses the `eqcorrscan.core.match_filter.normxcorr2()` function to find the optimum shift to align traces relative to a master event. Either uses a given master to align traces, or uses the trace with the highest MAD amplitude.

  Parameters: | trace_list (list) List of traces to align shift_len (int) Length to allow shifting within in samples master (obspy.core.trace.Trace) Master trace to align to, if set to False will align to the largest amplitude trace (default) positive (bool) Return the maximum positive cross-correlation, or the absolute maximum, defaults to False (absolute maximum). plot (bool) If true, will plot each trace aligned with the master.
  Returns: | list of shifts and correlations for best alignment in seconds.
  Return type: | list