psf_generator.propagators.vectorial_spherical_propagator#

The propagator for the vectorial field in the spherical coordinates.

Classes#

VectorialSphericalPropagator

Propagator for the vectorial case of the Richard's-Wolf integral in spherical parameterization.

Module Contents#

class psf_generator.propagators.vectorial_spherical_propagator.VectorialSphericalPropagator(n_pix_pupil=128, n_pix_psf=128, device='cpu', zernike_coefficients=None, e0x=1.0, e0y=0.0, wavelength=632, na=1.3, pix_size=10, defocus_step=0, n_defocus=1, apod_factor=False, envelope=None, cos_factor=False, gibson_lanni=False, z_p=1000.0, n_s=1.3, n_g=1.5, n_g0=1.5, t_g=170000.0, t_g0=170000.0, n_i=1.5, n_i0=1.5, t_i0=100000.0, integrator=simpsons_rule)[source]#

Bases: psf_generator.propagators.spherical_propagator.SphericalPropagator

Propagator for the vectorial case of the Richard’s-Wolf integral in spherical parameterization.

The equation to compute the electric field is

\[\begin{split}\mathbf{E}(\boldsymbol{\rho}) = - \frac{\mathrm{i} fk}{2} \begin{bmatrix} {2}^y\sin2\varphi\\ - I_{2}^x\sin2\varphi + [I_{0}^y + I_{2}^y\cos2\varphi]\\ -2\mathrm{i} I_{1}^x\cos\varphi - 2\mathrm{i} I_{1}^y\sin\varphi \end{bmatrix},\end{split}\]

where

\[ \begin{align}\begin{aligned}I_{0}^a (\rho,z) = \int_0^{\theta_{\max}} \boldsymbol{e}_{\textrm{inc}^a}(\theta)\sin\theta (\cos\theta+1) J_0(k\rho\sin\theta)\mathrm{e}^{\mathrm{i} kz\cos\theta}d\theta,\\I_{1}^a (\rho,z)= \int_0^{\theta_{\max}} \boldsymbol{e}_{\textrm{inc}^a}(\theta)\sin^2\theta J_1(k\rho\sin\theta)\mathrm{e}^{\mathrm{i} kz\cos\theta}d\theta,\\I_{2}^a (\rho,z) = \int_0^{\theta_{\max}} \boldsymbol{e}_{\textrm{inc}^a}(\theta)\sin\theta (\cos\theta-1) J_2(k\rho\sin\theta)\mathrm{e}^{\mathrm{i} kz\cos\theta}d\theta,\end{aligned}\end{align} \]

where \(a\in\{x,y\}, \boldsymbol{e}_{\textrm{inc}}(\theta) = [\boldsymbol{e}_{\textrm{inc}}^x(\theta), \boldsymbol{e}_{\textrm{inc}}^y(\theta), 0]\).

Parameters#

self.e0xfloat, optional

Initial electric field component \(\mathbf{e}_0^x\). Default value is 1.0.

self.e0yfloat, optional

Initial electric field component \(\mathbf{e}_0^y\). Default value is 0.0.

Notes#

The vectorial propagators have two additional arguments apart from those inherited form the base propagator to account for polarization.

e0x[source]#
e0y[source]#
varphi[source]#
sin_phi[source]#
cos_phi[source]#
sin_twophi[source]#
cos_twophi[source]#
classmethod get_name() str[source]#
_get_args() Dict[source]#
initialize_input_field() torch.Tensor[source]#
compute_focus_field() torch.Tensor[source]#

Compute the focus field.

Returns#

field: torch.Tensor

Output PSF.

Notes#

This involves expensive evaluations of Bessel functions. We compute it independently of defocus and handle defocus via batching with vmap().

_compute_psf_at_defocus(defocus_term: torch.Tensor, J0: torch.Tensor, J1: torch.Tensor, J2: torch.Tensor, pupil: torch.Tensor, sin_t: torch.Tensor, cos_t: torch.Tensor) torch.Tensor[source]#

Compute the PSF at defocus.

Parameters#

defocus_term: torch.Tensor

Factor in the integrand corresponding to defocus.

J0: torch.Tensor

Bessel function of the first kind of order 0 \(J_0\).

J1: torch.Tensor

Bessel function of the first kind of order 1 \(J_1\).

J2: torch.Tensor

Bessel function of the first kind of order 2 \(J_2\).

pupil: torch.Tensor

Pupil function.

sin_t: torch.Tensor

shape: (n_thetas, )

cos_t: torch.Tensor

shape: (n_thetas, )

Returns#

PSF_field: torch.Tensor

Output field.