LebedevExpander#
Lebedev grid-based spherical harmonics expander.
This class is a specialized version of the SphericalHarmonicsExpander that uses Lebedev grids for sampling points on the sphere.
- param max_degree:
Maximum degree of spherical harmonics expansion.
- type max_degree:
int
- param n_quadrature_points:
Number of quadrature points to use for Lebedev sampling. Possible values are listed in the table below. If the value is larger than the maximum number of points available (5810) for the given degree, it is clipped to 5810.
- type n_quadrature_points:
int
- param expansion_type:
Type of expansion to perform. Can be either ‘cartesian’ or ‘radial’.
- type expansion_type:
str
- param use_minimal_point_set:
If True, use a minimal point set for the Lebedev quadrature. For every degree, a corresponding number of quadrature points is used, which is the minimum number of points. The table below lists the expansion degree and the corresponding minimal number of points:
Table 1 Lebedev quadrature point reference# Degree
Points
2
6
3
14
4
26
5
38
6
50
7
74
8
86
9
110
10
146
11
170
12
194
13
230
14
266
15
302
16
350
18
434
21
590
24
770
27
974
30
1202
33
1454
36
1730
39
2030
42
2354
45
2702
48
3074
51
3470
54
3890
57
4334
60
4802
63
5294
66
5810
If False, the number of quadrature points is set to the maximum number of points available for the given degree, which is 5810 for degree 66.
- type use_minimal_point_set:
bool
- param normalize_spectrum:
Normalize power spectrum sum to 1. If False, the power spectrum is not normalized.
- type normalize_spectrum:
bool
- napari_stress.approximation.LebedevExpander.coefficients_#
Spherical harmonics coefficients of shape (3, max_degree + 1, max_degree + 1) for ‘cartesian’ expansion type or (1, max_degree + 1, max_degree + 1) for ‘radial’ expansion type.
- Type:
np.ndarray
- napari_stress.approximation.LebedevExpander.properties#
Dictionary containing properties of the expansion.
- normals: np.ndarray
Outward normals at Lebedev quadrature points.
- mean_curvature: np.ndarray
Mean curvature \(H\) at Lebedev quadrature points, computed as
\[H = \frac{1}{2}(k_1 + k_2)\]where \(k_1\) and \(k_2\) are the principal curvatures.
- H0_arithmetic: float
Arithmetic average of mean curvature:
\[H_0^{\mathrm{arith}} = \frac{1}{N} \sum_{i=1}^N H_i\]where \(N\) is the number of quadrature points.
- H0_surface_integral: float
Surface-area-weighted average mean curvature:
\[H_0^{\mathrm{surf}} = \frac{\int_S H \, dA}{\int_S dA}\]where \(S\) is the surface, \(H\) is the mean curvature, and \(dA\) is the surface element.
- H0_volume_integral: float
Average mean curvature estimated via the volume integral of the manifold:
\[H_0^{\mathrm{vol}} \approx \left( \frac{4\pi}{3V} \right)^{1/3}\]where \(V\) is the volume enclosed by the surface.
- S2_volume_integral: float
Volume of the unit sphere, typically \(\frac{4}{3}\pi\).
- H0_radial_surface: float
Surface-area-weighted average mean curvature on the radially expanded surface. Only calculated if expansion_type is ‘radial’.
- Gauss_Bonnet_error_radial: float
Gauss-Bonnet error for the radial expansion, calculated as:
\[\int_{\mathcal{M}} f(\theta, \phi) \, dA - 4\pi\]where \(K\) is the Gaussian curvature.
- Gauss_Bonnet_relative_error_radial: float
Relative Gauss-Bonnet error for the radial expansion, calculated as:
\[\frac{\int_{\mathcal{M}} f(\theta, \phi) \, dA - 4\pi}{4\pi}\]
- power_spectrum: np.ndarray
Power spectrum of spherical harmonics coefficients. If ‘normalize_spectrum’ is set to True, the power spectrum is normalized to sum to 1.
The spectrum \(P_l\) is calculated as:
\[P_l = \sum_{m=-l}^{l} |a_{lm}|^2\]where \(a_{lm}\) are the spherical harmonics coefficients.
- Type:
dict
- napari_stress.approximation.LebedevExpander.fit(points: 'napari.types.PointsData')#
Fit Lebedev quadrature points to input data.
- napari_stress.approximation.LebedevExpander.expand() 'napari.types.SurfaceData'#
Expand spherical harmonics using Lebedev quadrature points. Calculates properties of the expansion as listed above.
- napari_stress.approximation.LebedevExpander.fit_expand(points: 'napari.types.PointsData') 'napari.types.SurfaceData'#
Fit Lebedev quadrature points to input data and then expand them.