FresnelConv¶
- class dnois.optics.df.FresnelConv(grid_size: int | tuple[int, int], wl: Real | Sequence[Real] | Tensor = None, d: Real | Sequence[Real] | Tensor = None, ksize: int | tuple[int, int] = None, padding: int | str = 'linear', phase_factor: bool = True, scale_factor: bool = True, dft_scale: bool = True, simpson: bool = True)¶
Module for computing Fresnel diffraction using convolution method. See
fresnel_conv()
andinit_fresnel_conv()
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: Tensor¶
Grid spacing for \(u\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on
dx
, vice versa.
- property dv: Tensor¶
Grid spacing for \(v\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on
dy
, vice versa.
- property dx: Tensor¶
Grid spacing for \(x\) coordinate. See corresponding functional API reference for allowed values. Note that this property depends on
du
, vice versa.
- property dy: Tensor¶
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.