legume.viz.calculate_x
- legume.viz.calculate_x(kpoints, num_eig, k_units)
Calculates x-axis coordinates (wavevector axis) for photonic and polaritonic bands plotting.
- Parameters:
kpoints (np.ndarray) – 2D array with k points coordinates as provided in path[“kpoints”]
num_eig (int) – Numeber of repetition of the output array, in the case of GuidedModeExp or HopfieldPol it is the number of eigenvalues.
k_units (boolean) – If True the x-coordinates in the outputs are proportional to wavevector increment. If False x-points in the outputs are simply linearly spaced.
- Returns:
X0 (np.array) – x cooridnates for light line plotting, its length corresponds to the number of wavevectors in kpoints.
X (np.array) – x cooridnates for band plotting. It has the same shape of [np.shape(kpoints)[1], num_eig]. It is a num_eig repetition of X0.