Isosurface#

class ifermi.surface.Isosurface(vertices, faces, band_idx, properties=None, dimensionality=None, orientation=None)[source]#

Bases: MSONable

An isosurface object contains a triangular mesh and surface properties.

Variables:
  • vertices – A (n, 3) float array of the vertices in the isosurface.

  • faces – A (m, 3) int array of the faces of the isosurface.

  • band_idx – The band index to which the surface belongs.

  • properties – An optional (m, …) float array containing face properties as scalars or vectors.

  • dimensionality – The dimensionality of the surface.

  • orientation – The orientation of the surface (for 1D and 2D surfaces only).

property area: float#

Area of the isosurface in Å-2.

average_properties(norm=False, projection_axis=None)[source]#

Average property across isosurface.

Parameters:
  • norm (bool) – Average the norm of the properties (vector properties only).

  • projection_axis (Optional[tuple[int, int, int]]) – A (3, ) in array of the axis to project the properties onto (vector properties only).

Return type:

float | ndarray

Returns:

The averaged property.

property has_properties: float#

Whether the surface has properties.

property properties_ndim: int#

Dimensionality of face properties.

property properties_norms: ndarray#

(m, ) norm of isosurface properties.

sample_uniform(grid_size)[source]#

Sample mesh faces uniformly.

See the docstring for ifermi.analysis.sample_surface_uniform for more details.

Parameters:

grid_size (float) – The grid size in Å^-1.

Return type:

ndarray

Returns:

A (n, ) int array containing the indices of uniformly spaced faces.

scalar_projection(axis)[source]#

Get scalar projection of properties onto axis.

Parameters:

axis (tuple[int, int, int]) – A (3, ) int array of the axis to project onto.

Return type:

ndarray

Returns:

(m, ) float array of scalar projection of properties.