This function computes the covariance matrix for a set of
multidimensional data. It optionally returns the principal axes, of
the distribution, along with the variance along each principal
The principal axes and variances describe the orientation and size
of the "error ellipse" for multivariate gaussians.
data: An (ndimension) x (n point) data array.
paxis: On output, will hold the principal axes of the distribution.
An (ndim x ndim) array. The ith row of this array lists the ith
pvar: On output, will hold the variance along each principal axis.
An (ndim) vector.
mean: On output, will hold the mean of the distribution.
weights: An option (npoint) array that will weight each data point
The covariance array. An (ndimension) x (ndimension) array.
March 2010: Written by Chris Beaumont
December 2010: Added paxis, pvar, and mean keywords. cnb.