Skip to content

Commit

Permalink
add parameters and return to doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjonesBSU committed May 21, 2024
1 parent dae9e65 commit 11a5568
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cmeutils/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,19 @@ def is_equilibrated(data, threshold_fraction=0.50, threshold_neff=50, nskip=1):


def autocorr1D(array):
"""
Takes in a linear np array, performs autocorrelation
"""Takes in a linear np array, performs autocorrelation
function and returns normalized array with half the length
of the input
of the input.
Parameters
----------
data : numpy.typing.Arraylike, required
1-D series of data to perform autocorrelation on.
Returns
-------
1D np.array
"""
ft = np.fft.rfft(array - np.average(array))
acorr = np.fft.irfft(ft * np.conjugate(ft)) / (len(array) * np.var(array))
Expand Down

0 comments on commit 11a5568

Please sign in to comment.