wf_psf.utils.preprocessing

Preprocessing.

A module with utils to preprocess data.

Author:

Tobias Liaudat <tobias.liaudat@cea.fr>

Functions

defocus_to_zk4_wavediff(dz[, ...])

Compute Zernike 4 value for a given defocus in WaveDifff conventions.

defocus_to_zk4_zemax(dz[, tel_focal_length, ...])

Compute Zernike 4 value for a given defocus in zemax conventions.

shift_x_y_to_zk1_2_wavediff(dxy[, ...])

Compute Zernike 1(2) for a given shifts in x(y) in WaveDifff conventions.

wf_psf.utils.preprocessing.defocus_to_zk4_wavediff(dz, tel_focal_length=24.5, tel_diameter=1.2)[source]

Compute Zernike 4 value for a given defocus in WaveDifff conventions.

All inputs should be in [m].

The output zernike coefficient is in [um] units as expected by wavediff.

Parameters:
  • dz (float) – Shift in the z-axis, perpendicular to the focal plane. Units in [m].

  • tel_focal_length (float) – Telescope focal length in [m].

  • tel_diameter (float) – Telescope aperture diameter in [m].

wf_psf.utils.preprocessing.defocus_to_zk4_zemax(dz, tel_focal_length=24.5, tel_diameter=1.2)[source]

Compute Zernike 4 value for a given defocus in zemax conventions.

All inputs should be in [m].

Parameters:
  • dz (float) – Shift in the z-axis, perpendicular to the focal plane. Units in [m].

  • tel_focal_length (float) – Telescope focal length in [m].

  • tel_diameter (float) – Telescope aperture diameter in [m].

wf_psf.utils.preprocessing.shift_x_y_to_zk1_2_wavediff(dxy, tel_focal_length=24.5, tel_diameter=1.2)[source]

Compute Zernike 1(2) for a given shifts in x(y) in WaveDifff conventions.

All inputs should be in [m]. A displacement of, for example, 0.5 pixels should be scaled with the corresponding pixel scale, e.g. 12[um], to get a displacement in [m], which would be dxy=0.5*12e-6.

The output zernike coefficient is in [um] units as expected by wavediff.

To apply match the centroid with a dx that has a corresponding zk1, the new PSF should be generated with -zk1.

The same applies to dy and zk2.

Parameters:
  • dxy (float) – Centroid shift in [m]. It can be on the x-axis or the y-axis.

  • tel_focal_length (float) – Telescope focal length in [m].

  • tel_diameter (float) – Telescope aperture diameter in [m].