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()
andfraunhofer()
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.
- v: Ts¶
One of coordinates on source plane.
- 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.
- y: Ts¶
One of coordinates on target plane.