# Path: pytim/utilities.py
# def lap(show=False):
# def correlate(a1, a2=None, _normalize=True):
# def extract_positions(inp):
# def get_box(universe, normal=2):
# def get_pos(group, normal=2):
# def get_coord(coord, group, normal=2):
# def get_x(group, normal=2):
# def get_y(group, normal=2):
# def get_z(group, normal=2):
# def centerbox(universe,
#               x=None,
#               y=None,
#               z=None,
#               vector=None,
#               center_direction=2,
#               halfbox_shift=True):
# def guess_normal(universe, group):
# def density_map(pos, grid, sigma, box):
# def _NN_query(kdtree, position, qrange):
# def consecutive_filename(universe, basename, extension):
# def generate_cube_vertices(box, delta=0.0, jitter=False, dim=3):


import numpy as np
from pytim import utilities
from MDAnalysis.core.groups import Atom, AtomGroup, Residue, ResidueGroup
            correlation at time lag :math:`t` by its value at time lag 0
            computed over all trajectories that extend up to time
            lag :math:`t` and do not start with :math:`h=0`.

            >>> # not normalizd, intermittent
            >>> corr = vv.correlation(normalized=False,continuous=False)
            >>> c0 = (1+1+1+0.25+1+1+0.25)/7
            >>> c1 = (1+1+0.5+1)/5 ; c2 = (1+0.5+0.5)/4 ; c3 = (0.5+0.5)/2
            >>> print (np.allclose(corr, [ c0, c1, c2, c3]))
            True
            >>> # check normalization
            >>> np.all(vv.correlation(continuous=False) == corr/corr[0])
            True
            >>> # not normalizd, continuous
            >>> corr = vv.correlation(normalized=False,continuous=True)
            >>> c0 = (1+1+1+0.25+1+1+0.25)/7
            >>> c1 = (1+1+0.5+1)/5 ; c2 = (1+0.5)/4 ; c3 = (0.5+0.)/2
            >>> print (np.allclose(corr, [ c0, c1, c2, c3]))
            True
            >>> # check normalization
            >>> np.all(vv.correlation(continuous=True) == corr/corr[0])
            True

        """
        intermittent = not continuous
        self.dim = self._determine_dimension()

        # the standard correlation
        if self.reference is None:
            ts = np.asarray(self.timeseries)

# Path: pytim/utilities.py
# def lap(show=False):
# def correlate(a1, a2=None, _normalize=True):
# def extract_positions(inp):
# def get_box(universe, normal=2):
# def get_pos(group, normal=2):
# def get_coord(coord, group, normal=2):
# def get_x(group, normal=2):
# def get_y(group, normal=2):
# def get_z(group, normal=2):
# def centerbox(universe,
#               x=None,
#               y=None,
#               z=None,
#               vector=None,
#               center_direction=2,
#               halfbox_shift=True):
# def guess_normal(universe, group):
# def density_map(pos, grid, sigma, box):
# def _NN_query(kdtree, position, qrange):
# def consecutive_filename(universe, basename, extension):
# def generate_cube_vertices(box, delta=0.0, jitter=False, dim=3):


# Path: pytim/observables/correlator.py
import numpy as np
from pytim import utilities
from MDAnalysis.core.groups import Atom, AtomGroup, Residue, ResidueGroup

            correlation at time lag :math:`t` by its value at time lag 0
            computed over all trajectories that extend up to time
            lag :math:`t` and do not start with :math:`h=0`.

            >>> # not normalizd, intermittent
            >>> corr = vv.correlation(normalized=False,continuous=False)
            >>> c0 = (1+1+1+0.25+1+1+0.25)/7
            >>> c1 = (1+1+0.5+1)/5 ; c2 = (1+0.5+0.5)/4 ; c3 = (0.5+0.5)/2
            >>> print (np.allclose(corr, [ c0, c1, c2, c3]))
            True
            >>> # check normalization
            >>> np.all(vv.correlation(continuous=False) == corr/corr[0])
            True
            >>> # not normalizd, continuous
            >>> corr = vv.correlation(normalized=False,continuous=True)
            >>> c0 = (1+1+1+0.25+1+1+0.25)/7
            >>> c1 = (1+1+0.5+1)/5 ; c2 = (1+0.5)/4 ; c3 = (0.5+0.)/2
            >>> print (np.allclose(corr, [ c0, c1, c2, c3]))
            True
            >>> # check normalization
            >>> np.all(vv.correlation(continuous=True) == corr/corr[0])
            True

        """
        intermittent = not continuous
        self.dim = self._determine_dimension()

        # the standard correlation
        if self.reference is None:
            ts = np.asarray(self.timeseries)

            corr = utilities.correlate(ts)