correlate_shift

function of dascore.proc.correlate source

correlate_shift(
    patch ,
    dim ,
    undo_weighting = True,
)

Apply a shift to the patch data to undo correlation in frequency domain.

Also adds the appropriate coordinate prefixed with “lag” and has a datatype of float.

Parameters

Parameter Description
patch The input patch
dim The dimension name that was correlated in the freq. domain.
undo_weighting If True, also undo the weighting artifact caused by DASCore’s dft
weighting. This is done by simply dividing by the coordinate step.
See dft note for more details.

Examples

import dascore as dc
patch = dc.get_example_patch()

# Example 1
# An auto-correlation of the example patch
dft = patch.dft("time", real=True)
dft_sq = dft * dft.conj()
idft = dft_sq.idft()
auto_patch = idft.correlate_shift(dim="time")