# obspy.signal.cross_correlation.xcorr_pick_correction

`xcorr_pick_correction`(pick1, trace1, pick2, trace2, t_before, t_after, cc_maxlag, filter=None, filter_options={}, plot=False, filename=None)

  Calculate the correction for the differential pick time determined by cross correlation of the waveforms in narrow windows around the pick times. For details on the fitting procedure refer to [Deichmann1992].

  The parameters depend on the epicentral distance and magnitude range. For small local earthquakes (Ml ~0-2, distance ~3-10 km) with consistent manual picks the following can be tried:

      t_before=0.05, t_after=0.2, cc_maxlag=0.10,
      filter="bandpass", filter_options={'freqmin': 1, 'freqmax': 20}

  The appropriate parameter sets can and should be determined/verified visually using the option plot=True on a representative set of picks.

  To get the corrected differential pick time calculate: `((pick2 + pick2_corr) - pick1)`. To get a corrected differential travel time using origin times for both events calculate: `((pick2 + pick2_corr - ot2) - (pick1 - ot1))`

  Parameters: | pick1 (`UTCDateTime`) Time of pick for trace1. trace1 (`Trace`) Waveform data for pick1. Add some time at front/back. The appropriate part of the trace is used automatically. pick2 (`UTCDateTime`) Time of pick for trace2. trace2 (`Trace`) Waveform data for pick2. Add some time at front/back. The appropriate part of the trace is used automatically. t_before (float) Time to start cross correlation window before pick times in seconds. t_after (float) Time to end cross correlation window after pick times in seconds. cc_maxlag (float) Maximum lag/shift time tested during cross correlation in seconds. filter (str) None for no filtering or name of filter type as passed on to `filter()` if filter should be used. To avoid artifacts in filtering provide sufficiently long time series for trace1 and trace2. filter_options (dict) Filter options that get passed on to `filter()` if filtering is used. plot (bool) If True, a plot window illustrating the alignment of the two traces at best cross correlation will be shown. This can and should be used to verify the used parameters before running automatedly on large data sets. filename (str) If plot option is selected, specifying a filename here (e.g. ‘myplot.pdf’ or ‘myplot.png’) will output the plot to a file instead of opening a plot window.
  Return type: | (float, float)
  Returns: | Correction time pick2_corr for pick2 pick time as a float and corresponding correlation coefficient.

### Thank you!

We would like to thank our contributors, whose efforts make this software what it is. These people have helped by writing code and documentation, and by testing. They have created and maintained this product, its associated libraries and applications, our build tools and our web sites.

#### Contributors

- Ackerley, Nick
- Allgeyer, Sebastien
- Ammon, Charles J.
- Antunes, Emanuel
- Arnarsson, Ólafur St.
- Bank, Markus
- Barsch, Robert
- Behr, Yannik
- Bernardi, Fabrizio
- Bernauer, Felix
- Bes de Berc, Maxime
- Beyreuther, Moritz
- Boltz, Shawn
- Bonaimé, Sébastien
- Carothers, Lloyd
- Chamberlain, Calum
- Chambers, Derrick
- Chen, Zhao
- Clark, Adam
- Danecek, Peter
- Egdorf, Sven
- Engels, Fabian
- Ermert, Laura
- Eulenfeld, Tom

- Fabbri, Tommaso
- Falco, Nicholas
- Fee, Jeremy
- Grellier, Clément
- Grunberg, Marc
- Hammer, Conny
- Heimann, Sebastian
- Heiniger, Lukas
- Hope, Gaute
- Igel, Heiner
- Inza, Adolfo
- Isken, Marius
- Ketchum, David
- Koymans, Mathijs
- Kremers, Simon
- Kress, Victor
- Krieger, Lars
- Krischer, Lion
- Kula, Damian
- Käufl, Paul
- Köhler, Andreas
- Lecocq, Thomas
- Leeman, John
- Legovini, Paride

- Lesage, Philippe
- Li, Yulin
- Lomax, Anthony
- Lopes, Rui L.
- MacCarthy, Jonathan
- Maggi, Alessia
- Martin, Henri
- Medlin, Andrew
- Megies, Tobias
- Meschede, Matthias
- Michelini, Alberto
- Miller, Nathaniel C.
- Morgenstern, Bernhard
- Nof, Ran Novitsky
- Panning, Mark P.
- Parker, Tom
- Pestourie, Romain
- Rapagnani, Giovanni
- Reyes, Celso
- Ringler, Adam
- Rothenhäusler, Nicolas
- Russo, Emiliano
- Sales de Andrade, Elliott

- Satriano, Claudio
- Saul, Joachim
- Scheingraber, Chris
- Schneider, Simon
- Sippl, Christian
- Snoke, Arthur
- Stange, Stefan
- Stähler, Simon C.
- Sullivan, Benjamin
- Tian, Dongdong
- Trabant, Chad
- Trani, Luca
- Uieda, Leonardo
- Walker, Andrew
- Walther, Marcus
- Wassermann, Joachim
- Williams, Mark C.
- Winkelman, Andrew
- Zaccarelli, Riccardo
- Zad, Seyed Kasra Hosseini
- Zhu, Lijun
- van Driel, Martin
- van Wijk, Kasper

#### Funds

ObsPy was partially funded by the

- German Science Foundation (DFG) via grant DFG IG 16/9-1
- German Ministry for Education and Research (BMBF), GEOTECHNOLOGIEN grant 03G0646H.
- NERA project (Network of European Research Infrastructures for Earthquake Risk Assessment and Mitigation) under the European Community's Seventh Framework Programme (FP7/2007-2013) grant agreement n° 262330
- Leibniz Institute for Applied Geophysics (LIAG)
- VERCE EU-FP7 project (no. 283543)