Lattices

class batoid.Lattice(array, primitiveVectors)[source]

Container class for an ndarray + primitive lattice vectors.

Used as the output type for several of the analysis algorithms, including PSFs and wavefronts.

Parameters:
  • array (ndarray, shape (N1, N2, …, Nd)) – d-dimensional ndarray with dimensions N1, N2, …, Nd

  • primitiveVector ((d, d) ndarray) – Primitive lattice vectors. E.g., primitiveVector[0] should contain the lattice vector for the first dimension.

Notes

The coords attribute will contain the coordinates of each lattice point determined by the coordinate index and the primitive lattice vectors. E.g., in 2-dimensions

lattice.coord[i, j] = (i - N1//2) * primitiveVector[0] + (j - N2//2) * primitiveVector[1]

Note, this convention places

lattice.coord[0,0] = (-N1//2) * primitiveVector[0] + (-N2/2) * primitiveVector[1]

but the location of lattice.coord[-1,-1] depends on whether the size of each dimension is even or odd. An odd-sized dimension is “centered”, in that the 0-coordinate is precisely in the middle of the dimension. An even-sized dimension will be slightly decentered, with more negative points than positive points. The above convention is the same as for numpy.fft.fftfreq.