sisl.io.siesta.bandsSileSiesta
- class sisl.io.siesta.bandsSileSiesta(filename, *args, **kwargs)
Bases:
SileSiesta
Bandstructure information
Plotting
Plotting functions for the
bandsSileSiesta
class.plot.bands
(*[, Erange, E0, ...])Creates a
BandsData
object and then plots aBandsPlot
from it.Methods
base_directory
([relative_to])Retrieve the base directory of the file, relative to the path relative_to
close
()dir_file
([filename, filename_base])File of the current Sile
read
(*args, **kwargs)Generic read method which should be overloaded in child-classes
read_data
([as_dataarray])Returns data associated with the bands file
Returns the Fermi level in the bands file
write
(*args, **kwargs)Generic write method which should be overloaded in child-classes
Attributes
File of the current Sile
File of the current Sile
- base_directory(relative_to='.')
Retrieve the base directory of the file, relative to the path relative_to
- close()
- dir_file(filename=None, filename_base='')
File of the current Sile
- plot.bands(*, Erange: tuple[float, float] | None = None, E0: float = 0.0, E_axis: Literal['x', 'y'] = 'y', bands_range: tuple[int, int] | None = None, spin: Literal[0, 1] | None = None, bands_style: StyleSpec = {'color': 'black', 'dash': 'solid', 'opacity': 1, 'width': 1}, spindown_style: StyleSpec = {'color': 'blue', 'width': 1}, colorscale: Colorscale | None = None, gap: bool = False, gap_tol: float = 0.01, gap_color: str = 'red', gap_marker: dict = {'size': 7}, direct_gaps_only: bool = False, custom_gaps: Sequence[dict] = [], line_mode: Literal['line', 'scatter', 'area_line'] = 'line', group_legend: bool = True, backend: str = 'plotly') BandsPlot
Creates a
BandsData
object and then plots aBandsPlot
from it.- Parameters:
Erange – The energy range to plot. If None, the range is determined by
bands_range
.E0 – The energy reference.
E_axis – Axis to plot the energies.
bands_range – The bands to plot. Only used if
Erange
is None. If None, the 15 bands above and below the Fermi level are plotted.spin – Which spin channel to display. Only meaningful for spin-polarized calculations. If None and the calculation is spin polarized, both are plotted.
bands_style – Styling attributes for bands.
spindown_style – Styling attributes for the spin down bands (if present). Any missing attribute will be taken from
bands_style
.colorscale – Colorscale to use for the bands in case the color attribute is an array of values. If None, the default colorscale is used for each backend.
gap – Whether to display the gap.
gap_tol – Tolerance in k for determining whether two gaps are the same.
gap_color – Color of the gap.
gap_marker – Marker styles for the gap (as plotly marker’s styles).
direct_gaps_only – Whether to only display direct gaps.
custom_gaps – List of custom gaps to display. See the showcase notebooks for examples.
line_mode – The method used to draw the band lines.
group_legend – Whether to group all bands in the legend to show a single legend item.
If the bands are spin polarized, bands are grouped by spin channel.
backend – The backend to use to generate the figure.
See also
BandsPlot
The plot class used to generate the plot.
BandsData
The class to which data is converted.
- read(*args, **kwargs)
Generic read method which should be overloaded in child-classes
- Parameters:
kwargs – keyword arguments will try and search for the attribute
read_<>
and call it with the remaining**kwargs
as arguments.
- read_data(as_dataarray: bool = False)[source]
Returns data associated with the bands file
The energy levels are shifted with respect to the Fermi-level.
- Parameters:
as_dataarray (
boolean
, optional) – if True, the information is returned as anxarray.DataArray
Ticks (if read) are stored as an attribute of the DataArray (under array.ticks and array.ticklabels)
- write(*args, **kwargs)
Generic write method which should be overloaded in child-classes
- Parameters:
**kwargs – keyword arguments will try and search for the attribute write_ and call it with the remaining
**kwargs
as arguments.
- property base_file
File of the current Sile
- property file
File of the current Sile
- plot
Plotting functions for the
bandsSileSiesta
class.