solve_coefficients

sofia_redux.toolkit.resampling.solve_coefficients(amat, beta)[source]

Find least squares solution of Ax=B and rank of A.

Parameters:
amatnumpy.ndarray (ncoeffs, ndata)

The coefficient array.

betanumpy.ndarray (ncoeffs,) or (ncoeffs, N)

Dependent values. If 2-dimensional, the least-squares solution is calculated for each column.

Returns:
rank, xint, numpy.ndarray (min(M, N),)

The rank of amat and least-squares solution of x.