Script: Miscellaneous/ex_correlation.py

### Description

This Python ExternalAttrib script provides an alternative to the builtin OpendTect Match Delta attribute to measure time shifts between similar events in different seismic volumes. This script uses local normalised cross correlation to determine the relative Z shift between 2 data volumes. Aside from the estimate of relative Z shift the attribute can also output the correlation value. The correlation value which ranges from 0 (low correlation) to 1 (high correlation) provides a quantitative assessment of the reliability of the Z shift estimate.

The script requires the Numba Python package.

### Examples

This example provides a comparison of this external attribute script (left) with the Match Delta attribute (right) for a depth section and itself shifted up by 13 metres. The Match Delta attribute output is much noisier albiet it can be calulated much quicker.

This example shows the Correlation Quality output for the same data as above.

### Input Parameters

NAME DESCRIPTION
Output What to calculate - choice of the Z shift in millisecs or metres or the corresponding correlation coefficient.
Z window (+/-samples) This in conjunction with the Max Lag parameter determines the length of the segments cross correlated. $SegmentLength = 2*(Zwindow - MaxLag)+1$.
Max Lag (samples) Specifies maximum number of samples to search for the maximum correlation.

Note the user has to ensure that Z window is greater than Max Lag otherwise the script will exit with errors.