- -
-

Band structure parametrization (fuller.generator)

-
-
-class fuller.generator.BrillouinZoner(folder='', bands=[], axis=0, mask=None, kvals=[[], []])
-

Class for truncating the band mapping data to the first Brillouin zone.

-
-
-bandcutter(nx=None, ny=None, dmean=False, resampled=False, ret=False, **kwargs)
-

Truncate the band within the first Brillouin zone.

-
-
Parameters
-
-
nx, nyint, int

Pixel numbers of the cut band along the image axes.

-
-
dmeanbool | False

Option to subtract the mean from the band structure.

-
-
resampledbool | False

Option to resample the energy band in another k-grid.

-
-
retbool | False

Specifications for return values.

-
-
**kwargskeyword arguments
-
margins
-

list/tuple -Four-sided margins for the truncated band structure.

-
-
selector
-

list/slice object/None | None -Selector along the band index axis.

-
-
-
-
-
-
-
- -
-
-findlandmarks(method='daofind', direction='ccw', center_det='centroidnn', ret=False, **kwargs)
-

Determine the landmark locations.

-
-
Parameters
-

method : str | ‘daofind’ -direction : str | ‘ccw’ -center_det : str | ‘centroidnn’ -ret : bool | False -**kwargs : keyword arguments

-
-
-
- -
-
-load_data(filename, loadfunc=None, ret=False, **kwargs)
-

Load band structure data (energy values and momentum axes).

-
- -
-
-maskgen(ret='all', **kwargs)
-

Generate a mask using given parameters.

-
-
Parameters
-

See fuller.generator.hexmask().

-
-
-
- -
-
-property nbands
-

Number of bands.

-
- -
-
-resample(kvals, band, nx=None, ny=None, ret='all', **kwargs)
-

Resample the energy band in a finer grid.

-
-
Parameters
-

See fuller.utils.interpolate2d().

-
-
-
- -
-
-save_data(form='h5', save_addr='./bandcuts.h5', **kwargs)
-

Save truncated band structure data.

-
-
Parameters
-
-
formstr | ‘h5’

Format of the file to save.

-
-
save_addrstr | ‘./bandcuts’

File-saving address.

-
-
**kwargskeyword arguments

Additional arguments for the file-saving functions.

-
-
-
-
-
- -
-
-select_slice(selector, axis=None)
-

Select the image slice for landmark detection.

-
-
Parameters
-
-
selectorslice object

A slice object for selection of image stacks for feature detection.

-
-
-
-
-
- -
-
-set_bands(bands)
-

Set the energy bands.

-
- -
-
-set_eaxis(axis)
-

Set the index of the energy axis.

-
- -
-
-set_kvals(kvals)
-

Set the k values.

-
- -
-
-set_landmarks(landmarks)
-

Set the landmark locations for the image features.

-
- -
-
-set_mask(mask)
-

Set the mask for the energy band.

-
- -
-
-summary(rettype='dict')
-

A container of truncated band structure and parameters.

-
-
Parameters
-
-
rettypestr | ‘dict’

Data type of the returned summary ('dict' or 'list').

-
-
-
-
-
- -
-
-visualize(image, figsize=4, 4, origin='lower', annotated=False, points=None, scatterkws={}, **kwargs)
-

Display (cut) bands.

-
- -
- -
-
-class fuller.generator.EBandSynthesizer(nbands, **kwargs)
-

Class for synthesizing electronic band structure from basis functions.

-
-
-basisgen(nterms, npix, vertical=True, outside=0, basis_type='Zernike')
-

Generate polynomial bases for energy band synthesis.

-
- -
-
-coeffgen(nterms, method='rand_gauss', **kwargs)
-

Generate coefficients for energy band synthesis.

-
- -
-
-save_bands(form, save_addr='', **kwargs)
-

Save the synthesized energy bands.

-
- -
-
-set_kvals(kvals)
-

Set momentum values.

-
- -
-
-set_mask(mask)
-

Set the mask for the synthesized data.

-
- -
-
-set_nbands(nbands)
-

Set the number of energy bands to synthesize.

-
- -
-
-set_spacing(spacing)
-

Set the energy spacing between energy bands.

-
- -
-
-summary(rettype='dict')
-

A container of synthetic band structure and parameters.

-
- -
-
-synthesize(basis_type='Zernike', **kwargs)
-

Generate 3D electronic band structure.

-
- -
-
-visualize(selector=None, indaxis=0, backend='plotly', **kwargs)
-

Plot synthesized band structure.

-
- -
- -
-
-class fuller.generator.MPESDataGenerator(bands, lineshape, baxis=0, **kwargs)
-

Class for generating three-dimensional photoemssion data.

-
-
-add_bands(bands, edir='lower')
-

Add an energy band the existing list.

-
- -
-
-generate_data(matrix_elements='off')
-

Generate photoemission data.

-
- -
-
-property nbands
-

Number of bands used in the simulation.

-
- -
-
-property parameters
-

A dictionary of lineshape parameters.

-
- -
-
-save_data(form='h5', save_addr='', save_items='all', **kwargs)
-

Save generated photoemission data.

-
- -
-
-select_bands(selector)
-

Select energy bands by their indices.

-
- -
-
-set_amplitude(amplitude)
-

Set the amplitude of the lineshape function.

-
- -
-
-set_bands(bands)
-

Set the energy band positions.

-
- -
-
-set_energy(energy)
-

Set the binding energy of the photoelectrons.

-
- -
-
-set_kvals(kvals)
-

Set the momentum values for the data.

-
- -
-
-set_lineshape(lineshape)
-

Set the lineshape function.

-
- -
-
-set_linewidth(gamma)
-

Set the intrinsic linewidth of electronic state.

-
- -
-
-set_matrix_elements(matelems)
-

Set the matrix element intensity modulation in photoemission process.

-
- -
-
-set_srfwidth(sigma)
-

Set the width of the system response function (SRF).

-
- -
-
-summary(rettype='dict')
-

A container of synthetic band mapping data and parameters.

-
- -
- -
-
-fuller.generator.bandstack(data, baxis=2, nvb=None, ncb=None, gap_id=None, pbar=True, pbenv='classic', **kwargs)
-

Construct a stack of energy bands after symmetrization.

-
-
Parameters
-
-
data3D array

Patches of band structure data with the axes in any ordering of (kx, ky, band_index).

-
-
baxisint | 2

Axis of the band index.

-
-
nvb, ncbint, int | None, None

Number of valence and conduction bands to extract.

-
-
gap_idint | None

Index number of the topmost valence band or bottommost conduction band, -depending on the stacking order in the data variable.

-
-
pbarbool | True

Option to turn on/off the progress bar in computation.

-
-
pbenvstr | ‘classic’

Progress bar environment (‘classic’ or ‘notebook’).

-
-
-

**kwargs : keyword arguments

-
-
Returns
-
-
vbands, cbands3D array, 3D array

Stacked valence and conduction bands after symmetrization.

-
-
-
-
-
- -
-
-fuller.generator.cutedge(image, check_axis=1, boundary='square', ret='cutimage')
-

Cutting out the region beyond the edge of an image.

-
-
Parameters
-
-
image2D array

Image (containing nan or 0 outside the region of interest) before cutting.

-
-
check_axisint | 1

The long axis for determining the boundary.

-
-
boundarystr | ‘square’
-
‘square’
-

Square image boundary.

-
-
‘tight’
-

Tightest rectangular image boundary.

-
-
-

The shape of the image boundary.

-
-
retstr | ‘cutimage’

Option to specify return quantity (‘cutimage’, ‘cutrange’, ‘all’).

-
-
-
-
-
- -
-
-fuller.generator.decomposition_hex2d(band, bases=None, baxis=0, nterms=100, basis_type='Zernike', ret='coeffs')
-

Decompose energy band in 3D momentum space using the orthogonal polynomials in a hexagon.

-
-
Parameters
-
-
band2D array

2D electronic band structure.

-
-
bases3D array | None

Matrix composed of bases to decompose into.

-
-
baxisint | 0

Axis of the basis index.

-
-
ntermsint | 100

Number of basis terms.

-
-
basis_typestr | ‘Zernike’

Type of basis to use.

-
-
retstr | ‘coeffs’

Options for the return values.

-
-
-
-
-
- -
-
-fuller.generator.hexfilter(images, center, axis=0, rotrange=[- 30, - 25, - 20, - 15, - 10, - 5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290, 295, 300, 305, 310, 315, 320, 325], lookahead=4, pbar=True, pbenv='classic', ret='all')
-

Filter out sixfold-symmetric images.

-
-
Parameters
-

images : 3D array -center : list/tuple/1D array

-
-

Image center pixel coordinates.

-
-

axis : int | 0 -rotrange : list/tuple | list(range(-30, 330, 5)) -lookahead : int | 4 -pbar : bool | True -pbenv : str | ‘classic’ -ret : str | ‘all’

-
-
-
- -
-
-fuller.generator.hexmask(hexdiag=128, imside=256, image=None, padded=False, margins=[], pad_top=None, pad_bottom=None, pad_left=None, pad_right=None, vertical=True, outside='nan', ret='mask', **kwargs)
-

Generate a hexagonal mask. To use the function, either the argument imside or image should be -given. The image padding on four sides could be specified with either margins altogether or separately -with the individual arguments pad_xxx. For the latter, at least two independent padding values are needed.

-
-
Parameters
-
-
hexdiagint | 128

Number of pixels along the hexagon’s diagonal.

-
-
imsideint | 256

Number of pixels along the side of the (square) reference image.

-
-
image2D array | None

2D reference image to construct the mask for. If the reference (image) is given, each side -of the generated mask is at least that of the smallest dimension of the reference.

-
-
paddedbool | False

Option to pad the image (need to set to True to enable the margins).

-
-
marginslist/tuple | []

Margins of the image [top, bottom, left, right]. Overrides the pad_xxx arguments.

-
-
pad_top, pad_bottom, pad_left, pad_rightint, int, int, int | None, None, None, None

Number of padded pixels on each of the four sides of the image.

-
-
verticalbool | True

Option to align the diagonal of the hexagon with the vertical image axis.

-
-
outsidenumeric/str | ‘nan’

Pixel value outside the masked region.

-
-
retstr | ‘mask’

Return option (‘mask’, ‘masked_image’, ‘all’).

-
-
-
-
-
- -
-
-fuller.generator.hexpad(img, cvd, edgepad=None, **kwargs)
-

Symmetrically pad an image in directions perpendicular to the hexagonal edges.

-
-
Parameters
-
-
img2d array

Image to pad.

-
-
cvdnumeric

Center-vertex distance of the hexagon.

-
-
edgepadlist/tuple

Number of padded pixels on the edge of the image, ((left, right), (top, bottom)).

-
-
-

**kwargs : keyword arguments

-
-
Return
-
-
padded_view2d array

Rectangular image after padding hexagonally.

-
-
-
-
-
- -
-
-fuller.generator.hextiler(image, final_size, cvd, method='geometric', op='nanmax', op_package='numpy', ret='final')
-

Tiling the image plane with hexagonal patterns.

-
-
Parameters
-
-
image2D array

Base image before hexagonal tiling.

-
-
final_sizelist/tuple

Final size of the padded image (row_size, colum_size).

-
-
cvdnumeric

Center-vertex distance.

-
-
methodstr | ‘geometric’

Method for hexagonal tiling.

-
-
opstr | ‘nanmax’

Namestring of the operator.

-
-
op_packagestr | ‘numpy’

Namestring of the software package to obtain the operator.

-
-
retstr | ‘final’
-
final
-

Return only the final result.

-
-
all
-

Return results from all intermediate steps.

-
-
-
-
-
-
-
- -
-
-fuller.generator.polydecompose(trace, deg, ids=None, method='piecewise', polytype='Legendre', **kwds)
-

Decompose the trace into orthogonal polynomials.

-
- -
-
-fuller.generator.polyreconstruct(coeffs, ids=None, polytype='Legendre', flatten=True)
-

Reconstruct line segments using provided coefficients.

-
- -
-
-fuller.generator.projectionfilter(data, nterms=None, bases=None, npix=None, basis_type='Zernike', outside='nan', basis_kwds={})
-

Filtering reconstructed band structure using orthogonal polynomial approximation.

-
-
Parameters
-

data : 2D array -nterms : int | None

-
-

Number of terms.

-
-
-
bases3D array | None

Bases for decomposition.

-
-
-

npix : int | None -basis_type : str | ‘Zernike’ -outside : numeric/str | ‘nan’ -basis_kwds : dictionary | {}

-
-
-
- -
-
-fuller.generator.reconstruction_hex2d(coeffs, bases=None, baxis=0, npix=256, basis_type='Zernike', ret='band')
-

Reconstruction of energy band in 3D momentum space using orthogonal polynomials -and the term-wise coefficients.

-
-
Parameters
-
-
coeffs1D array

Polynomial coefficients to use in reconstruction.

-
-
bases3D array | None

Matrix composed of bases to decompose into.

-
-
baxisint | 0

Axis of the basis index.

-
-
npixint | 256

Number of pixels along one side in the square image.

-
-
basis_typestr | ‘Zernike’

Type of basis to use.

-
-
retstr | ‘band’

Options for the return values.

-
-
-
-
-
- -
-
-fuller.generator.reflectodeform(imbase, refangle, center, axis=0, interp_order=1, **kwargs)
-

Reflect the image with respect to the symmetry line across the image center -using deformation field.

-
-
Parameters
-
-
imbase2D array

Base image.

-
-
refanglenumeric

Reflection angle with respect to the image horizontal axis.

-
-
centerlist/tuple

Center coordinates of the image.

-
-
axisint | 0

Axis to reflect along.

-
-
-
-
-
- -
-
-fuller.generator.reflectosymmetrize(image, center, refangles, axis=0, outside='nan')
-

Symmetrize the pattern according to reflection symmetry.

-
- -
-
-fuller.generator.refsym(img, op='nanmax', op_package='numpy', axis=0, pbenv='classic', pbar=True)
-

Symmetrize by reflections.

-
- -
-
-fuller.generator.restore(img, **kwargs)
-

Restore an image with irregularly distributed missing values (as nan’s).

-
-
Parameters
-
-
imgnd array

Multidimensional image array with missing data (as nan’s).

-
-
**kwargskeyword arguments

Additional arguments supplied to scipy.interpolate.griddata().

-
-
-
-
-
- -
-
-fuller.generator.rotodeform(imbase, angle, center, interp_order=1, **kwargs)
-

Image rotation using deformation field.

-
-
Parameters
-
-
imbase2D array

Base image before rotation.

-
-
anglenumeric

Angle of rotation.

-
-
centerlist/tuple

Center pixel coordinates of the image.

-
-
**kwargskeyword arguments

See additional arguments in scipy.ndimage.map_coordinates().

-
-
-
-
Return
-
-
imshift2D array

Rotated image.

-
-
-
-
-
- -
-
-fuller.generator.rotosymdetect(image, center, rotrange=[- 30, - 25, - 20, - 15, - 10, - 5, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105, 110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175, 180, 185, 190, 195, 200, 205, 210, 215, 220, 225, 230, 235, 240, 245, 250, 255, 260, 265, 270, 275, 280, 285, 290, 295, 300, 305, 310, 315, 320, 325], lookahead=4, pbar=True, pbenv='classic')
-

Detect the degree of rotational symmetry of an image.

-
-
Parameters
-

image : 2D array -center : list/tuple -rotrange : list/tuple | list(range(-30, 330, 5)) -lookahead : int | 4 -pbar : bool | True

-
-

Option to show progress bar.

-
-
-
pbenvstr | ‘classic’

Progress bar environment (‘classic’ or ‘notebook’).

-
-
-
-
Return
-
-
nmaxint

Order of rotational symmetry.

-
-
-
-
-
- -
-
-fuller.generator.rotosymmetrize(image, center, rotsym=None, angles=None, outside='nan', **kwargs)
-

Symmetrize the pattern according to the rotational symmetry.

-
-
Parameters
-
-
image2D array

Image to symmetrize.

-
-
centerlist/tuple

Image center pixel position (row, column).

-
-
rotsymint | None

Order of rotation symmetry (if regular symmetry is assumed). If rotsym -is specified, the values from angles are ignored.

-
-
anglesnumeric | None

Angles of rotation.

-
-
outsidestr/numeric | ‘nan’

The values of the symmetrized image outside the masked boundary.

-
-
-
-
-
- -
-
-fuller.generator.transdeform(imbase, xtrans=0, ytrans=0, interp_order=1, **kwargs)
-

Image translation using deformation field.

-
-
Parameters
-
-
imbase2D array

Base image before translation.

-
-
xtrans, ytransnumeric, numeric | 0, 0

Magnitude of translation along the x and y axes.

-
-
**kwargskeyword arguments

See additional arguments in scipy.ndimage.map_coordinates().

-
-
-
-
-
- -
- - -