swiftest.shgrav.clm_from_ellipsoid#
- swiftest.shgrav.clm_from_ellipsoid(mass, density, a, b=None, c=None, lmax=6, lref_radius=False, ref_radius=None)[source]#
Creates and returns the gravity coefficients for an ellipsoid with principal axes a, b, c upto a certain maximum degree lmax. Uses pyshtools. No units necessary for a, b, & c. However, they need to be in the same units (DU).
- Parameters:
mass (float) β mass of the central body
density (float) β density of the central body
a (float) β length of the pricipal axis aligned with the x axis
b (float, optional, default = a) β length of the pricipal axis aligned with the y axis
c (float, optional, default = b) β length of the pricipal axis aligned with the z axis
lmax (int, optional, default = 6) β The maximum spherical harmonic degree resolvable by the grid.
lref_radius (boolean, optional, default = False) β Boolean value to return the reference radius calculated by SHTOOLS
ref_radius (float, optional, default = None) β Reference radius to scale the gravitational coefficients to
- Returns:
clm (ndarry, shape (2, lmax+1, lmax+1)) β numpy ndarray of the gravitational potential spherical harmonic coefficients. This is a three-dimensional array formatted as coeffs[i, degree, order], where i=0 corresponds to positive orders and i=1 to negative orders.