General Utilities#
- slothpy.lebedev_laikov_grid(grid)[source]#
Returns Lebedev-Laikov-Grids [1] over a hemisphere.
- Parameters:
grid (int) –
An integer from 0 to 11 controling the number of points in the grid over the hemisphere.
0 - 17 points, 1 - 29 points, 2 - 93 points, 3 - 161 points, 4 - 185 points, 5 - 229 points, 6 - 309 points, 7 - 401 points, 8 - 505 points, 9 - 889 points, 10 - 1381 points, 11 - 2949 points
- Returns:
Grid array in the form [[direction_x, direction_y, direction_z, weight], …].
- Return type:
ndarray
- Raises:
ValueError – If grid is not an integer from 0 to 11.
Notes
Grids 0-2 can be considered as insufficient in most cases (only should be used for experimental purposes), 3-5 minimal to standard, 6-8 very precise, but costly, 9-11 very dense - only for particular use-cases (extremely costly - especially 10-11).
References
[1]V.I. Lebedev, and D.N. Laikov “A quadrature formula for the sphere of the 131st algebraic order of accuracy” Doklady Mathematics, Vol. 59, No. 3, 1999, pp. 477-481.
- slothpy.colour_map(name)[source]#
Creates matplotlib colour map object.
- Parameters:
name (Union["BuPi", "rainbow", "dark_rainbow", "light_rainbow",) –
“light_rainbow_alt”, “BuOr”, “BuYl”, “BuRd”, “GnYl”, “PrOr”, “GnRd”, “funmat”, “NdCoN322bpdo”, “NdCoNO222bpdo”, “NdCoI22bpdo”, “viridis”, “plasma”, “inferno”, “magma”, “cividis”] or list[str]
One of the defined names for colour maps: BuPi, rainbow, dark_rainbow, light_rainbow,light_rainbow_alt, BuOr, BuYl, BuRd, GnYl, PrOr, GnRd, funmat, NdCoN322bpdo, NdCoNO222bpdo, NdCoI22bpdo, viridis, plasma, inferno, magma, cividis or list of HTML colour codes from which the colour map will be created by interpolation of colours between ones on the list. The predefined names modifiers can be applied: _l loops the list in a way that it starts and ends with the same colour, _r reverses the list.
- Returns:
The Matplotlib’s colour map object used for plotting.
- Return type:
matplotlib.colors.LinearSegmentedColormap
- Raises:
ValueError – If the input is not acceptable for creating a colour map from the list of colour codes or the name of predefined colour map was incorrectly written.