Fraunhofer

class dnois.optics.df.Fraunhofer(grid_size: int | tuple[int, int], spacing: float | Tensor | tuple[float | Tensor, float | Tensor] = None, wl: Real | Sequence[Real] | Tensor = None, d: Real | Sequence[Real] | Tensor = None, delta_mode: Literal['forward', 'backward'] = 'backward', phase_factor: bool = True, scale_factor: bool = True, dft_scale: bool = True)

Module for computing Fraunhofer diffraction using Fourier transform method. See fraunhofer() and fraunhofer() for more details and description of parameters.

forward(pupil: Tensor) Tensor

Compute diffraction integral for given pupil function pupil

Parameters:

pupil (Tensor) – Pupil function \(U\). A tensor of shape \((\cdots,N_d,N_\lambda,H,W)\).

Returns:

Diffracted complex amplitude \(U'\). A tensor of shape \((\cdots,N_d,N_\lambda,H,W)\).

Return type:

Tensor

property d: Tensor

Diffraction distances \(z\). It can be assigned with a float, sequence of float, 0D or 1D tensor. This property returns a 0D tensor if assigned with a float or 0D tensor, or a 1D tensor otherwise.

property device: device

Device of this object.

Type:

torch.device

property dtype: dtype

Data type of this object.

Type:

torch.dtype

property du

Grid spacing for \(u\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on dx, vice versa.

property dv

Grid spacing for \(v\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on dy, vice versa.

property dx

Grid spacing for \(x\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on du, vice versa.

property dy

Grid spacing for \(y\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on dv, vice versa.

u: Ts

One of coordinates on source plane.

u_range: tuple[Ts, Ts]

Range of u. A pair of 0D tensor.

u_size: Ts

Span of u, i.e. u_range[1] - u_range[0].

v: Ts

One of coordinates on source plane.

v_range: tuple[Ts, Ts]

Range of v. A pair of 0D tensor.

v_size: Ts

Span of v, i.e. v_range[1] - v_range[0].

property wl: Tensor

Wavelengths \(\lambda\). It can be assigned with a float, sequence of float, 0D or 1D tensor. This property returns a 0D tensor if assigned with a float or 0D tensor, or a 1D tensor otherwise.

x: Ts

One of coordinates on target plane.

x_range: tuple[Ts, Ts]

Range of x. A pair of 0D tensor.

x_size: Ts

Span of x, i.e. x_range[1] - x_range[0].

y: Ts

One of coordinates on target plane.

y_range: tuple[Ts, Ts]

Range of y. A pair of 0D tensor.

y_size: Ts

Span of y, i.e. y_range[1] - y_range[0].