# Cross-Correlation not working after update

**URL:** https://discourse.obspy.org/t/cross-correlation-not-working-after-update/715
**Category:** Users Mailing List Archive
**Tags:** archive
**Created:** [November 10, 2017, 8:06pm UTC](https://discourse.obspy.org/t/cross-correlation-not-working-after-update/715 "2017-11-10T20:06:18Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![gonzalo\_antonio\_fern](https://discourse.obspy.org/user_avatar/discourse.obspy.org/gonzalo_antonio_fern/32/407_2.png) [@gonzalo\_antonio\_fern](https://discourse.obspy.org/u/gonzalo_antonio_fern)
#### Post date: [November 10, 2017, 8:06pm UTC](https://discourse.obspy.org/t/cross-correlation-not-working-after-update/715/1 "2017-11-10T20:06:18Z")

</div>

Dear all,

Tahnk you for the time you spend reading it,

When I had the obspy.0.9 version the cross-correlation worked fine, since I updated to V1.1.0 i git an erro when I tried to re run my script I am working in windows 10 with python 2.7

I have two waveforms from a seismic swarm, I cut them before P phase just a few mili seconds (they are in SAC format).

I applied the scritp from the Obspy tutorial:

m=read(‘EV5\_1s\_LPAZ\_Z\*’)[0] #master  
s=read(‘EV2\_1s\_LPAZ\_Z\*’)[0] #slave  
tm=obspy.UTCDateTime(‘2016-12-14T19:33:37.3Z’)  
ts=obspy.UTCDateTime(‘2016-10-20T11:18:26.1Z’)  
dt, coeff = xcorr\_pick\_correction(tm, m, ts, s, 0.05, 0.7, 0.3, plot=True,  
filter=“bandpass”,  
filter\_options={‘freqmin’: 0.8, ‘freqmax’: 3.5})

Before the update with the same vales it worked well, attach the figure before the update.

After the update I got an error.

warnings.warn(msg)  
UserWarning: Artifacts from signal processing possible. Trace 0 should have more additional data at the start.

Warning (from warnings module):  
File “C:\Python27\lib\site-packages\obspy\signal\cross\_correlation.py”, line 451  
warnings.warn(msg)  
UserWarning: Artifacts from signal processing possible. Trace 0 should have more additional data at the end.

Traceback (most recent call last):  
File “G:+0n1nO\_python\_obspy\_scripts\python\_correlation\corrsig.py”, line 35, in   
filter\_options={‘freqmin’: 0.8, ‘freqmax’: 3.5})  
File “C:\Python27\lib\site-packages\obspy\signal\cross\_correlation.py”, line 440, in xcorr\_pick\_correction  
raise Exception(msg)  
Exception: Trace 1 starts too late.

I modofied the t\_before and t\_after and it is the same.

 ![LPAZ_Corr5-1.png](https://discourse.obspy.org/uploads/default/original/1X/d24c0efcadb85135d1d5791ab6f0247ab114b88f.png)

Thank you a lot for yoor time.

Gonzalo

[EV1\_1s\_LPAZ\_Z.sac](https://discourse.obspy.org/uploads/short-url/f0Kxf42xPly7VXou2KnclRoSGXo.sac) (828 Bytes)

[EV5\_1s\_LPAZ\_Z.sac](https://discourse.obspy.org/uploads/short-url/4bZgLS1qedLqUNrutvIX38JVbIQ.sac) (828 Bytes)

---

<div class="post-metadata">

### Author: ![trichter](https://discourse.obspy.org/user_avatar/discourse.obspy.org/trichter/32/226_2.png) [@trichter](https://discourse.obspy.org/u/trichter)
#### Post date: [November 12, 2017, 11:39pm UTC](https://discourse.obspy.org/t/cross-correlation-not-working-after-update/715/2 "2017-11-12T23:39:29Z")

</div>

Hi Gonzalo,

in the script you read in events 5 and 2, but you sent only data for events 1 and 5.

If I change your code to read in event 1, the defined pick time is too late and I get the same error.

Can you double check and provide the data for event 1?

Best regards,  
Tom

 ![LPAZ_Corr5-1.png](https://discourse.obspy.org/uploads/default/original/1X/d24c0efcadb85135d1d5791ab6f0247ab114b88f.png)
