de_twin.optics.aberrations.Aberrations#

class de_twin.optics.aberrations.Aberrations(coeffs=<factory>)[source]#

Bases: object

A set of aberration coefficients (complex, nm). Missing names are zero.

Parameters:

coeffs (dict[str, complex])

__init__(coeffs=<factory>)#
Parameters:

coeffs (dict[str, complex])

Return type:

None

Methods

__init__([coeffs])

chi(kx, ky, wavelength_nm)

Aberration phase chi(k) in radians; kx, ky in 1/nm (broadcastable).

copy()

flat_angle_mrad(wavelength_nm[, limit_rad, ...])

Largest aperture semi-angle whose phase error stays below limit_rad (what a corrector tableau quotes as the 'pi/4 angle').

from_polar(**mag_angle)

Aberrations.from_polar(A1=(5.0, 30.0), C3=1.2e6): magnitude nm, azimuth deg.

gradient(kx, ky, wavelength_nm)

(d chi/d kx, d chi/d ky) in rad*nm; used for spatial-coherence envelopes and for the probe/image shift produced by beam tilt.

key()

Hashable, rounded representation (cache keys).

only(names)

phase_error_at(angle_mrad, wavelength_nm[, n])

Largest abs(chi) (rad) on a ring of the given semi-angle (e.g. the pi/4 criterion).

polar()

name -> (magnitude nm, azimuth deg) in CEOS convention.

scaled(factor)

Attributes

coeffs: dict[str, complex]#
classmethod from_polar(**mag_angle)[source]#

Aberrations.from_polar(A1=(5.0, 30.0), C3=1.2e6): magnitude nm, azimuth deg.

Return type:

Aberrations

copy()[source]#
Return type:

Aberrations

scaled(factor)[source]#
Parameters:

factor (float)

Return type:

Aberrations

only(names)[source]#
Parameters:

names (Iterable[str])

Return type:

Aberrations

polar()[source]#

name -> (magnitude nm, azimuth deg) in CEOS convention.

Return type:

dict[str, tuple[float, float]]

key()[source]#

Hashable, rounded representation (cache keys).

Return type:

tuple

chi(kx, ky, wavelength_nm)[source]#

Aberration phase chi(k) in radians; kx, ky in 1/nm (broadcastable).

Parameters:

wavelength_nm (float)

Return type:

ndarray

gradient(kx, ky, wavelength_nm)[source]#

(d chi/d kx, d chi/d ky) in rad*nm; used for spatial-coherence envelopes and for the probe/image shift produced by beam tilt.

Parameters:

wavelength_nm (float)

Return type:

tuple[ndarray, ndarray]

phase_error_at(angle_mrad, wavelength_nm, n=72)[source]#

Largest abs(chi) (rad) on a ring of the given semi-angle (e.g. the pi/4 criterion).

Parameters:
Return type:

float

flat_angle_mrad(wavelength_nm, limit_rad=0.7853981633974483, max_mrad=60.0)[source]#

Largest aperture semi-angle whose phase error stays below limit_rad (what a corrector tableau quotes as the ‘pi/4 angle’).

Parameters:
Return type:

float