spharm

Functions

slcode.spharm.get_coeffs(a_lm, n)

The get_coeffs function get the spherical harmonics coefficients of the nth order from a linearly Spharm array.

Attribute :

a_lmnp.array([maxdeg*(maxdeg+1)/2,])

An array containing the spherical coefficient in a linear form

nint

The order of the spherical harmonics coefficient you are trying to retrive

Returns :

a_nnp.array([n,])

The spherical harmonic coefficient of the order n.

CLASS

class slcode.spharm.sphericalobject(grd=None, coeff=None, maxdeg=None)

The sphericalobject class include any spherical object. This class is working with pyshtools (pyshtools).

Attributes

grdnp.array[(maxdeg,maxdeg x2)]

Value of the spherical object on a Gaussian Grid.

isgrdBool

A boolean to define if a Gaussian grid have been defined for this object.

coeffnp.array[(maxdeg,maxdeg)]

Spherical harmonic coefficient array.

iscoeffBool

A boolean to define if a spherical harmonic coefficient have been defined for this object.

savednp.array[(n, maxdeg, maxdeg)]

An array wich contain the spherical harmonic coefficient each time th save method is applied.

prevnp.array[(maxedg, maxdeg)]

save the spherical coefficient using save_prev.

Methods

grdtocoeff

Convert the Gaussian grid to spherical harmonic coefficient

coefftogrd

Convert spherical harmonic coefficient to Gaussian grid

coefftogrdhd :

Convert spherical harmonic coefficient to a Gaussian grid with a higher resolution then maxdeg

save_prev :

Save the spherical harmonic coefficient to the attribute prev

Methods

slcode.spharm.sphericalobject.grdtocoeff(self)

The grdtocoeff method convert a Gaussian grid into spherical harmonic coefficient array using a numerical method to create spherical harmonic coefficient self.coeff is updated usig these output. self.iscoeff defining if a coefficient have been created for this object. If there is no grid created (self.isgrid == 0) then it returns an error.

Attribute :

None

Returns :

None


slcode.spharm.sphericalobject.coefftogrd(self)

The coefftogrd method convert spherical harmonic coefficient into a gird array using shtools. The output of pysh.SHCoeff are converted to real. self.grd is updated usig these output. self.isgrd defining if a grid have been created for this object. If there is no grid created (self.iscoeff == 0) then it returns an error. A modifier pour pouvoir modifier les entrées de la fonction.

Parameters :

See the documentation of the cited class object for more information on different parameters used in the function.

Returns :

Added fields :


slcode.spharm.sphericalobject.coefftogrdhd(self, max_calc_deg)

The coefftogrdhd convert spherical harmonic coefficient into a gird array using shtools. The output of pysh.SHCoeff are converted to real. self.grd is updated usig these output. self.isgrd defining if a grid have been created for this object. If there is no grid created (self.iscoeff == 0) then it returns an error. A modifier pour pouvoir modifier les entrées de la fonction.

Attribute :

max_calc_degint

The maximum spherical harmonic degree to calculate the grid. This function can be used to have a better rendering in output.

Returns :

None


slcode.spharm.sphericalobject.save_prev(self)

The save_prev create a new field for the object to save the spherical coefficient at the moment of the applied function. This function make a clean copy of the array to avoid modification.

Attribute :

None

Returns :

None