Xcorr_pick_correction number of samples error

Hi,

I’m trying to use obspy.signal.cross_correlation.xcorr_pick_correction to adjust (mostly P) picks for microseismic data that was detected using template matching. I am getting an error saying “Exception: Less than 3 samples selected for fit to cross correlation: 2”. No matter how much I try to make the traces longer, I get the same error.

I am using traces 1.014s in length cut 0.3s before P pick time. For the parameters I am using t_before=0.05
t_after=0.2
cc_maxlag=0.10

Any ideas as to why the number of samples remains 2?

Thanks.

Have you tried plot=True to see what it actually looks like? Maybe the signal just isn’t similar enough. Also please look at the tutorial. It needs a certain amount of convex points in the cross correlation function for fitting. Maybe sampling rate of the signal is too low or it’s not similar enough (could try pre-filtering to the relevant frequencies).