Functions relating to the evaluation of the optical E-field by summation of General Astigmatic Gaussian Beams

class raypier.core.fields.EFieldSummation(gausslet_collection, wavelengths=None, blending=1.0)

Bases: object

For situations where you wish to evaluate the E-field from a set of Gausslets with different sets of evaluation points, this class provides a small optimisation by performing the maths to convert ray-intercepts to Gaussian mode parameters up front.

evaluate(points, time_ps=0.0)

Called to calculate the E-field for the given points.

raypier.core.fields.ExtractGamma(gausslet_collection, blending=1.0)

Used in Testing

raypier.core.fields.Gamma(z, A, B, C)

Used in testing

raypier.core.fields.eval_Efield_from_gausslets(gausslet_collection, points, wavelengths=None, blending=1.0, time_ps=0.0, **kwds)

Calculates the vector E-field is each of the points given. The returned array of field-vectors will have the same length as points and has numpy.complex128 dtype.

  • gc (GaussletCollection) – The set of Gausslets for which the field should be calculated

  • points (ndarray[N,3]) – An array of shape (N,3) giving the points at which the field will be evaluated.

  • wavelengths (ndarray[]) – A 1d array containing the wavelengths to be used for the field calculation, overriding the wavelengths data contained by the GaussletCollection object.

  • blending (float) – The 1/width of each Gaussian mode at the evaluation points. A value of unity (the default), means the parabasal rays are determined to be the 1/e point in the field amplitude.

raypier.core.fields.evaluate_modes(neighbour_x, neighbour_y, dx, dy, blending=1.0)

For each ray in rays, use its nearest neighbours to compute the best fit for the Astigmatic Gaussian Beam parameters.

rays - an array of ray_t with shape (N,) x,y,dx,dy - array of shape (N,6)

For N rays, return a Nx3 complex array of coeffs

raypier.core.fields.evaluate_neighbours(rays, neighbours_idx)

For each of a rays neighbours, we need to project the neighbour back onto the plane containing the main rays origin, to obtain the (x,y) cordinate for the neighbour ray, relative to the main ray origin

rays - a ray_t array of length N neighbours_idx - a array on ints of shape (N,6)

returns - a 5-tuple (rays, x,y,dx,dy) where x,y are N*6 arrays for the coordinate of each neighbour.

dx and dy represent the change in direction of the neighbouring rays (i.e. curvature of the wavefront). The returns rays are the subset of the input rays with 6 neighbours (i.e. edge-rays are dropped).

raypier.core.fields.project_to_sphere(rays, centre=(0, 0, 0), radius=10.0)

project the given set of rays back to their intercept with a sphere at the given centre and radius.

rays - an array of ray_t dtype