healpy.projaxes.GnomonicAxes.xcorr¶
-
GnomonicAxes.xcorr(x, y, normed=True, detrend=<function detrend_none>, usevlines=True, maxlags=10, **kwargs)¶ Plot the cross correlation between x and y.
Call signature:
xcorr(self, x, y, normed=True, detrend=mlab.detrend_none, usevlines=True, maxlags=10, **kwargs)
If normed = True, normalize the data by the cross correlation at 0-th lag. x and y are detrended by the detrend callable (default no normalization). x and y must be equal length.
Data are plotted as
plot(lags, c, **kwargs)Return value is a tuple (lags, c, line) where:
lags are a length
2*maxlags+1lag vectorc is the
2*maxlags+1auto correlation vector- line is a
Line2Dinstance returned by
plot().
- line is a
The default linestyle is None and the default marker is ‘o’, though these can be overridden with keyword args. The cross correlation is performed with
numpy.correlate()with mode = 2.If usevlines is True:
vlines()rather thanplot()is used to draw vertical lines from the origin to the xcorr. Otherwise the plotstyle is determined by the kwargs, which areLine2Dproperties.The return value is a tuple (lags, c, linecol, b) where linecol is the
matplotlib.collections.LineCollectioninstance and b is the x-axis.maxlags is a positive integer detailing the number of lags to show. The default value of None will return all
(2*len(x)-1)lags.Example:
xcorr()is top graph, andacorr()is bottom graph.