salvus.mesh.layered_meshing.utils.compute_ellipticity
A utility for computing the ellipticity of a layered model.
Functions
apply_ellipticity()
apply_ellipticity()def apply_ellipticity(
mesh: salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh,
ellipticity: Callable[
[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]],
numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]],
],
radius: float,
) -> (
salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh
): ...Deform a spherical mesh according to its ellipticity.
Parameters
meshsalvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — The mesh to deform. NOTE: Will be updated in place.ellipticityCallable[[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]], numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]] — A callable that provides the ellipticity at an array of radii. Can be computed from a layered model using thecompute_ellipticityfunction in this module.radiusfloat — The radius of the sphere to apply ellipticity to.
Returns salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh — A mesh with ellipticity applied.
compute_ellipticity()
compute_ellipticity()def compute_ellipticity(
layered_model: salvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel,
ellipsoid: Union[str, float],
) -> Callable[
[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]],
numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]],
]: ...Computes the ellipticity of a layered model as a function of radius.
All realized parameter types are acceptable. For discrete parameters the mean ellipticity will be computed at each radial sample, and for analytic parameters only 1-D radially-varying models are accepted.
Each layer is discretized using 100 equally-spaced points in the radial direction, and the density is evaluated at those points. These discrete values are then used to integrate Clairaut’s equation. The discrete interval is then interpolated using a 3rd order spline, and returned as a callable that can be evaluated at any absolute radius in meters.
Parameters
layered_modelsalvus.mesh.layered_meshing.layered_model.layered_model.LayeredModel — The layered model to compute the ellipticity of.ellipsoidUnion[str, float] — The ellipticity (or flattening — the terms are used interchangeably here) of the sphere at the surface. If a string is passed, it can be one of WGS84, GRS80, or MARS, which will be converted to the corresponding ellipticity.
Returns Callable[[numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]], numpy.ndarray[Any, numpy.dtype[+_ScalarType_co]]] — A function that can be called to compute the ellipticity at a given absolute radius in meters.