spherical.modes.utilities

evaluate

evaluate(self, rotors, **kwargs)

Source: spherical/modes/utilities.py

Return values of function on input rotors

grid

grid(self, n_theta=None, n_phi=None, use_spinsfast=True, **kwargs)

Source: spherical/modes/utilities.py

Return values of function on an equi-angular grid This method converts mode weights of spin-weighted function to values on a grid. The grid has n_theta evenly spaced points along the usual polar (colatitude) angle theta, and n_phi evenly spaced points along the usual azimuthal angle phi. This grid corresponds to the one produced by spherical.theta_phi; see that function for specifics. The output array has one more dimension than this object; rather than the last axis giving the mode weights, the last two axes give the values on the two-dimensional grid.

Parameters

  • n_theta: {None, int}, optional

    Number of points to use in theta direction. None is equivalent to 2*self.ell_max+1, which is the minimum number that can capture behavior up to and including ell_max. If you need to multiply the result with some other spin-weighted function, you should use an n_theta value of 2 * (self.ell_max + other.ell_max) + 1 to avoid aliasing.

  • n_phi: {None, int}, optional

    Number of points to use in the phi direction. Here, None is equivalent to n_phi=n_theta, after calculation of the default value for n_theta. Note that the same comments apply about avoiding aliasing.

  • use_spinsfast: optional, bool

    If True, and spinsfast is accessible, use it to evaluate the function values; otherwise, use this module's Wigner.evaluate method.

  • **kwargs: Any

    Additional keyword arguments are passed through to the Grid constructor on output

index

index(self, ell, m)

Source: spherical/modes/utilities.py

Return index of (ell, m) mode in data Note that the modes are always stored in the last axis of the data, so if your Modes object modes has (or even just might have) more than one dimension, you might extract a particular mode weight with something like this: i = modes.index(ell, m) ell_m_modes = modes[..., i] The ellipsis just represents all other dimensions (even if there are none).

rotate

rotate(self, R, **kwargs)

Source: spherical/modes/utilities.py

Return values of function on input rotors

truncate_ell

truncate_ell(self, new_ell_max)

Source: spherical/modes/utilities.py

Slice array so that new ell max is no more than the given value Note that the result's maximum ell value is limited by the current maximum. If the input is larger than that, the object is returned unchanged.