def thetaBandMaxFreq(self, x1):
    '\n        Calculates the frequency with the max power in the theta band (6-12Hz)\n        of a spike trains autocorrelogram. Partly to look for differences\n        in theta frequency in different running directions a la Blair\n        See Welday paper - https://doi.org/10.1523/jneurosci.0712-11.2011\n        '
    y = self.xcorr(x1)
    (corr, _) = np.histogram(y[(y != 0)], bins=201, range=np.array([(- 500), 500]))
    from scipy.signal import periodogram
    (freqs, power) = periodogram(corr, fs=200, return_onesided=True)
    power_masked = np.ma.MaskedArray(power, np.logical_or((freqs < 6), (freqs > 12)))
    return freqs[np.argmax(power_masked)]
Calculates the frequency with the max power in the theta band (6-12Hz)
of a spike trains autocorrelogram. Partly to look for differences
in theta frequency in different running directions a la Blair
See Welday paper - https://doi.org/10.1523/jneurosci.0712-11.2011
def thetaBandMaxFreq(self, x1):
    '\n        Calculates the frequency with the max power in the theta band (6-12Hz)\n        of a spike trains autocorrelogram. Partly to look for differences\n        in theta frequency in different running directions a la Blair\n        See Welday paper - https://doi.org/10.1523/jneurosci.0712-11.2011\n        '
    y = self.xcorr(x1)
    (corr, _) = np.histogram(y[(y != 0)], bins=201, range=np.array([(- 500), 500]))
    from scipy.signal import periodogram
    (freqs, power) = periodogram(corr, fs=200, return_onesided=True)
    power_masked = np.ma.MaskedArray(power, np.logical_or((freqs < 6), (freqs > 12)))
    return freqs[np.argmax(power_masked)]