SpatialMap

class SpatialMap(data, positions, sublattices=None)

Represents some spatially dependent property: data mapped to site positions

Attributes

data 1D array of values for each site, i.e.
num_sites Total number of lattice sites
positions Lattice site positions.
sub 1D array of sublattices IDs, short for .sublattices
sublattices 1D array of sublattices IDs
x 1D array of coordinates, short for .positions.x
xyz Return a new array with shape=(N, 3).
y 1D array of coordinates, short for .positions.y
z 1D array of coordinates, short for .positions.z

Methods

__getitem__(idx) Same rules as numpy indexing
clipped(v_min, v_max) Clip (limit) the values in the data array, see clip()
cropped(**limits) Return a copy which retains only the sites within the given limits
plot_contour(**kwargs) Contour plot of the xy plane
plot_contourf([num_levels]) Filled contour plot of the xy plane
plot_pcolor(**kwargs) Color plot of the xy plane
with_data(data) Return a copy of this object with different data mapped to the sites
__getitem__(idx)

Same rules as numpy indexing

clipped(v_min, v_max)

Clip (limit) the values in the data array, see clip()

cropped(**limits)

Return a copy which retains only the sites within the given limits

Parameters:
**limits

Attribute names and corresponding limits. See example.

Examples

Leave only the data where -10 <= x < 10 and 2 <= y < 4:

new = original.cropped(x=[-10, 10], y=[2, 4])
plot_contour(**kwargs)

Contour plot of the xy plane

Parameters:
**kwargs

Forwarded to tricontour().

plot_contourf(num_levels=50, **kwargs)

Filled contour plot of the xy plane

Parameters:
num_levels : int

Number of contour levels.

**kwargs

Forwarded to tricontourf().

plot_pcolor(**kwargs)

Color plot of the xy plane

Parameters:
**kwargs

Forwarded to tripcolor().

with_data(data) → pybinding.results.SpatialMap

Return a copy of this object with different data mapped to the sites

data

1D array of values for each site, i.e. maps directly to x, y, z site coordinates

num_sites

Total number of lattice sites

positions

Lattice site positions. Named tuple with x, y, z fields, each a 1D array.

sub

1D array of sublattices IDs, short for .sublattices

sublattices

1D array of sublattices IDs

x

1D array of coordinates, short for .positions.x

xyz

Return a new array with shape=(N, 3). Convenient, but slow for big systems.

y

1D array of coordinates, short for .positions.y

z

1D array of coordinates, short for .positions.z