prysm.psf#
Evaluation routines for point spread functions.
- prysm.psf.estimate_size(data, metric, dx=None, x=None, y=None, criteria='last')#
Calculate the “size” of the function in data based on a metric.
- Parameters:
data (ndarray) – f(x,y), 2D
metric (str or float, {'fwhm', '1/e', '1/e^2', float()}) – what metric to apply
dx (float) – inter-sample spacing, if x and y != None, they supercede this parameter
x (ndarray) – x coordinates, 2D
y (ndarray) – y coordinates, 2D
criteria (str, optional, {'first', 'last'}) – whether to use the first or last occurence of <metric>
- Returns:
the radial coordinate at which on average the function reaches <metric>
- Return type:
- Raises:
ValueError – metric not in (‘fwhm’, ‘1/e’, ‘1/e^2’, numbers.Number())
- prysm.psf.fwhm(data, dx=None, x=None, y=None, criteria='last')#
Calculate the FWHM of (data).
- Parameters:
- Returns:
the FWHM
- Return type:
- prysm.psf.one_over_e(data, dx=None, x=None, y=None, criteria='last')#
Calculate the 1/e diameter of data.
- Parameters:
- Returns:
the FWHM
- Return type:
- prysm.psf.one_over_e_sq(data, dx=None, x=None, y=None, criteria='last')#
Calculate the 1/e^2 diameter of data.
- Parameters:
- Returns:
the FWHM
- Return type:
- prysm.psf.centroid(data, dx=None, unit='spatial')#
Calculate the centroid of the PSF.
- Parameters:
- Returns:
int, int – if unit == pixels, indices into the array
float, float – if unit == spatial, referenced to the origin
- prysm.psf.autocrop(data, px)#
Crop to a rectangular window around the centroid.
- Parameters:
data (ndarray) – data to crop into
px (int) – window full width, samples
- Returns:
cropped data
- Return type:
ndarray
- prysm.psf.airydisk(unit_r, fno, wavelength)#
Compute the airy disk function over a given spatial distance.
- prysm.psf.airydisk_efield(unit_r, fno, wavelength)#
The same as airydisk(), returning complex E-field instead.
- prysm.psf.airydisk_ft(r, fno, wavelength)#
Compute the Fourier transform of the airy disk.