# bruges.attribute.similarity module¶

A variance method to compute similarity.

copyright: 2015 Agile Geoscience Apache 2.0
bruges.attribute.similarity.similarity(traces, duration, dt=1, step_out=1, lag=0)[source]

Compute similarity for each point of a seismic section using a variance method between traces.

For each point, a kernel of n_samples length is extracted from a trace. The similarity is calculated as a normalized variance between two adjacent trace sections, where a value of 1 is obtained by identical if the traces are identical. The step out will decide how many adjacent traces will be used for each kernel, and should be increased for poor quality data. The lag determines how much neighbouring traces can be shifted when calculating similiarity, which should be increased for dipping data.

Parameters: Keyword Arguments: traces – A 2D numpy array arranged as [time, trace]. duration – The length in seconds of the window trace kernel used to calculate the similarity. (default=1 ) (step_out) – The number of adjacent traces to the kernel to check similarity. The maximum similarity value will be chosen. (default=0) (lag) – The maximum number of time samples adjacent traces can be shifted by. The maximum similarity of will be used. (default=1) (dt) – The sample interval of the traces in sec. (eg. 0.001, 0.002, …). Will default to one, allowing duration to be given in samples.