pyprocar.core.Isosurface#

class pyprocar.core.Isosurface(XYZ: ndarray, V: ndarray, isovalue: float, V_matrix=None, algorithm: str = 'lewiner', interpolation_factor: int = 1, padding: List[int] | None = None, transform_matrix: ndarray | None = None, boundaries=None)[source]#

This class contains a surface that finds all the points corresponding to the following equation. V(X,Y,Z) = f

Parameters:
  • XYZ (List of lists of floats, (n,3)) – XYZ must be between (0.5,0.5]. a list of coordinates [[x1,y1,z1],[x2,y2,z2],…] corresponding V

  • V (TYPE, list of floats, (n,)) – DESCRIPTION. a list of values [V1,V2,…] corresponding to XYZ XYZ[0] >>> V[0] XYZ[1] >>> V[1]

  • isovalue (float) – The constant value of the surface (f)

  • V_matrix (float (nx,ny,nz)) – One can present V_matrix instead of XYZ and V. V_matrix is a matrix representation of XYZ and V together. This matrix is generated if XYZ and V are provided.

  • algorithm (str) – The default is ‘lewiner’. The algorithm used to find the isosurface, This function used scikit-image to find the isosurface. possibilities [‘classic’,’lewiner’]

  • interpolation_factor (int) – The default is 1. This module uses Fourier Transform interpolation. interpolation factor will increase the grid points in each direction by a this factor, the dafault is set to 1

  • padding (list of float (3,)) –

    Padding is used for periodic datasets such as bands in a solid state calculation. e.g. The 1st BZ is not covered fully so one might want to pad the matrix with wrap(look at padding in numpy for wrap), afterwards one has to clip the surface to the first BZ. easily doable using pyvista of trimesh padding goes as follows

    1np.pad(self.eigen_matrix,
    2        ((padding[0]/2, padding[0]/2),
    3        (padding[1]/2, padding[1]/2)
    4        (padding[2]/2, padding[2])),
    5        "wrap")
    

    In other words it creates a super cell withpadding

  • transform_matrix (np.ndarray (3,3) float) – Applies an transformation to the vertices VERTS_prime=T*VERTS

  • boundaries (pyprocar.core.surface) – The default is None. The boundaries in which the isosurface will be clipped with for example the first brillouin zone

Methods

Isosurface.__init__(XYZ, V, isovalue[, ...])

Initialize the polydata.

Attributes

Isosurface.dxyz

Returns the spacings of the grid in the x,y,z directions.

Isosurface.nX

Returns the number of points in the grid in X direction

Isosurface.nY

Returns the number of points in the grid in Y direction

Isosurface.nZ

Returns the number of points in the grid in Z direction

Isosurface.surface_boundaries

This function tries to find the isosurface using no interpolation to find the correct positions of the surface to be able to shift to the interpolated one to the correct position