prysm.otf#
MTF/PTF/OTF calculations.
- prysm.otf.transform_psf(psf, dx=None)#
Transform a PSF to k-space without further modification.
- prysm.otf.mtf_from_psf(psf, dx=None)#
Compute the MTF from a given PSF.
- Parameters
psf (prysm.RichData or numpy.ndarray) – object with data property having 2D data containing the psf, or the array itself
dx (float) – sample spacing of the data
- Returns
container holding the MTF, ready for plotting or slicing.
- Return type
- prysm.otf.ptf_from_psf(psf, dx=None)#
Compute the PTF from a given PSF.
- Parameters
psf (prysm.RichData or numpy.ndarray) – object with data property having 2D data containing the psf, or the array itself
dx (float) – sample spacing of the data
- Returns
container holding the MTF, ready for plotting or slicing.
- Return type
- prysm.otf.otf_from_psf(psf, dx=None)#
Compute the OTF from a given PSF.
- Parameters
psf (numpy.ndarray) – 2D data containing the psf
dx (float) – sample spacing of the data
- Returns
container holding the OTF, complex.
- Return type
- prysm.otf.diffraction_limited_mtf(fno, wavelength, frequencies=None, samples=128)#
Give the diffraction limited MTF for a circular pupil and the given parameters.
- Parameters
fno (float) – f/# of the lens.
wavelength (float) – wavelength of light, in microns.
frequencies (numpy.ndarray) – spatial frequencies of interest, in cy/mm if frequencies are given, samples is ignored.
samples (int) – number of points in the output array, if frequencies not given.
- Returns
if frequencies not given –
- frequenciesnumpy.ndarray
array of ordinate data
- mtfnumpy.ndarray
array of coordinate data
else –
- mtfnumpy.ndarray
array of MTF data
Notes
If frequencies are given, just returns the MTF. If frequencies are not given, returns both the frequencies and the MTF.
- prysm.otf.longexposure_otf(nu, Cn, z, f, lambdabar, h_z_by_r=2.91)#
Compute the long exposure OTF for given parameters.
- Parameters
nu (numpy.ndarray) – spatial frequencies, cy/mm
Cn (float) – atmospheric structure constant of refractive index, ranges ~ 10^-13 - 10^-17
z (float) – propagation distance through atmosphere, m
f (float) – effective focal length of the optical system, mm
lambdabar (float) – mean wavelength, microns
h_z_by_r (float, optional) – constant for h[z/r] – see Eq. 8.5-37 & 8.5-38 in Statistical Optics, J. Goodman, 2nd ed.
- Returns
the OTF
- Return type
numpy.ndarray
- prysm.otf.komogorov(r, r0)#
Calculate the phase structure function D_phi in the komogorov approximation.
- Parameters
r (numpy.ndarray) – r, radial frequency parameter (object space)
r0 (float) – Fried parameter
- Return type
numpy.ndarray
- prysm.otf.estimate_Cn(P=1013, T=273.15, Ct=0.0001)#
Use Weng et al to estimate Cn from meteorological data.
- Parameters
P (float) – atmospheric pressure in hPa
T (float) – temperature in Kelvin
Ct (float) – atmospheric struction constant of temperature, typically 10^-5 - 10^-2 near the surface
- Returns
Cn
- Return type
float