compute_coeffs_discrete#

gala.potential.scf.compute_coeffs_discrete(xyz, mass, nmax, lmax, r_s, skip_odd=False, skip_even=False, skip_m=False, compute_var=False, pool=None)[source]#

Compute the expansion coefficients for representing the density distribution of input points as a basis function expansion. The points, xyz, are assumed to be samples from the density distribution.

Warning

GSL is required for this function, see the Installation instructions for more details

Parameters:
xyzarray_like

Samples from the density distribution. Should have shape (n_samples, 3).

massarray_like

Mass of each sample. Should have shape (n_samples,).

nmaxint

Maximum value of n for the radial expansion.

lmaxint

Maximum value of l for the spherical harmonics.

r_snumeric

Scale radius.

skip_oddbool (optional)

Skip the odd terms in the angular portion of the expansion. For example, only take \(l=0, 2, 4, ...\)

skip_evenbool (optional)

Skip the even terms in the angular portion of the expansion. For example, only take \(l=1, 3, 5, ...\)

skip_mbool (optional)

Ignore terms with \(m > 0\).

compute_varbool (optional)

Also compute the variances (and covariances) of the coefficients.

poolPool, schwimmbad.BasePool (optional)

A multi-processing or other parallel processing pool to use to distribute the tasks of computing the coefficients for each n,l,m term. The pool instance must have a map() method.

Returns:
Snlmndarray

The value of the cosine expansion coefficient.

Tnlmndarray

The value of the sine expansion coefficient.

STcovarndarray, optional

If compute_var==True, this also computes and returns the covariance matrix of the coefficients.