PYME.Analysis.PSFGen.fourierHNA module

generate a phase ramp psf unp.sing fourier optics

PYME.Analysis.PSFGen.fourierHNA.ExtractPupil(ps, zs, dx, lamb=488, NA=1.3, n=1.51, nIters=50, size=5000.0, intermediateUpdates=False)
PYME.Analysis.PSFGen.fourierHNA.FourierPropagator

alias of FourierPropagatorHNA

class PYME.Analysis.PSFGen.fourierHNA.FourierPropagatorClipHNA(u, v, k=None, lamb=488, n=1.51, field_x=0, field_y=0, apertureNA=1.5, apertureZGradient=0)

A FourierPropagator object allows us evaluate the electric field at a given defocus by propagating a complex pupil distribution a given distance from the nominal focus by adding the relevant phase term to the pupil and then taking the Fourier amplitude.

This version will also clip the propagated pupil at a specified NA, potentially off-centered. This is useful in simulating clipping / vignetting effects within the objective.

Parameters:

u, v : 2D arrays

co-ordinates in the pupil plane

lamb : float

wavelength in nm

n : float

refractive index

field_x, field_y : float

how much our aperture is off-center, in pupil coordinates

apertureNA : float

the NA of our clipping aperture

apertureZGradient : float

a factor by which the NA of the clipping aperture changes with defocus. Permits modelling of apertures which are not in the pupil plane, as these will look like an aperture which changes with defocus.

Methods

propagate(F, z) Propagate a complex pupil, F, a distance z from the nominal focus and return the electric field amplitude
propagate_r(f, z) Backpropagate an electric field distribution, f, at defocus z to the nominal focus and return the complex pupil
propagate(F, z)

Propagate a complex pupil, F, a distance z from the nominal focus and return the electric field amplitude

Parameters:

F : 2D array

complex pupil

z : float

distance in nm to propagate

propagate_r(f, z)

Backpropagate an electric field distribution, f, at defocus z to the nominal focus and return the complex pupil

Parameters:

f : 2D array

complex electric field amplitude

z : float

nominal distance of plane from focus in nm

Returns:

the back-propagated pupil

Note

backpropagation currently doesn’t take clipping into account.

class PYME.Analysis.PSFGen.fourierHNA.FourierPropagatorHNA(u, v, k=None, lamb=488, n=1.51)

A FourierPropagator object allows us evaluate the electric field at a given defocus by propagating a complex pupil distribution a given distance from the nominal focus by adding the relevant phase term to the pupil and then taking the Fourier amplitude.

Parameters:

u, v : 2d arrays of float

the co-ordinates in spatial frequencies within the pupil plane

lamb : float

the wavelength in nm

n : float

the refractive index of the media

Notes

u, v must be the same size as the eventual pupil distribution to be used. On creation, the FourierPropagator pre-calculates the phase factor to add for each u, v, co-ordinate and also pre-computes FFTW3 plans for the necessary Fourier transforms.

Methods

propagate(F, z) Propagate a complex pupil, F, a distance z from the nominal focus and return the electric field amplitude
propagate_r(f, z) Backpropagate an electric field distribution, f, at defocus z to the nominal focus and return the complex pupil
propagate(F, z)

Propagate a complex pupil, F, a distance z from the nominal focus and return the electric field amplitude

Parameters:

F : 2D array

complex pupil

z : float

distance in nm to propagate

propagate_r(f, z)

Backpropagate an electric field distribution, f, at defocus z to the nominal focus and return the complex pupil

Parameters:

f : 2D array

complex electric field amplitude

z : float

nominal distance of plane from focus in nm

PYME.Analysis.PSFGen.fourierHNA.Gen4PiPSF(zs, dx=5, lamb=700, n=1.51, NA=1.47, apodization=None, phi=0, X=None, Y=None)
PYME.Analysis.PSFGen.fourierHNA.GenAstigPSF(zs, dx=5, strength=1.0, X=None, Y=None, lamb=700, n=1.51, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenBesselPSF(zs, dx=5, rad=0.95, X=None, Y=None, lamb=700, n=1.51, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenBiplanePSF(zs, dx=5, zshift=500, xshift=1, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenColourPRIPSF(zs, dx=5, strength=1.0, transmit=[1, 1])
PYME.Analysis.PSFGen.fourierHNA.GenCubicPhasePSF(zs, dx=5, strength=1.0, X=None, Y=None, n=1.51, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenDHPSF(zs, dx=5, vortices=[0.0], lamb=700, n=1.51, NA=1.47, ns=1.51, beadsize=0, vect=False, apodization=None)
PYME.Analysis.PSFGen.fourierHNA.GenICPRIPSF(zs, dx=5, strength=1.0, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenPRIEField(zs, dx=5, strength=1.0, dp=0, lamb=700, n=1.51, NA=1.47, ns=1.51, beadsize=0, vect=False, apodization=None)
PYME.Analysis.PSFGen.fourierHNA.GenPRIPSF(zs, dx=5, strength=1.0, dp=0, lamb=700, n=1.51, NA=1.47, ns=1.51, beadsize=0, vect=False, apodization=None)
PYME.Analysis.PSFGen.fourierHNA.GenR3PSF(zs, dx=5, strength=1.0, X=None, Y=None, lamb=700, n=1.51, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenSAAstigPSF(zs, dx=5, strength=1.0, SA=0, X=None, Y=None, lamb=700, n=1.51, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenSABesselPSF(zs, dx=5, rad=0.95, strength=1.0, X=None, Y=None, lamb=700, n=1.51, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenSAPRIPSF(zs, dx=5, strength=1.0, SA=0, X=None, Y=None, lamb=700, n=1.51, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenSAPSF(zs, dx=5, strength=1.0, X=None, Y=None, lamb=700, n=1.51, NA=1.47)
PYME.Analysis.PSFGen.fourierHNA.GenShiftedPSF(zs, dx=5)
PYME.Analysis.PSFGen.fourierHNA.GenStripePRIPSF(zs, dx=5)
PYME.Analysis.PSFGen.fourierHNA.GenWidefieldAP(dx=5, X=None, Y=None, lamb=700, n=1.51, NA=1.47, apodization='sine')

Generate a widefield pupil and corresponding propagator

Parameters:

dx : float

pixel size in resulting image

X, Y : 1D arrays (optional)

pixel coordinates in image plane nm. Note that if provided, the pixel size should match that in dx. If not provided, co-ordinated will be generated for a default size of 4umx4um

lamb : float

wavelength

n : float

refractive index

NA : float

Numerical aperture

apodization : string or None

one of None or ‘sine’. Pupil apodization.

Returns:

X, Y : pixel coordinates in nm

R : radial co-ordinates in u,v space

FP : the propagator

M : the widefield pupil

u, v : co-ordinates in pupil space

PYME.Analysis.PSFGen.fourierHNA.GenWidefieldAPA(dx=5, X=None, Y=None, lamb=700, n=1.51, NA=1.47, field_x=0, field_y=0, apertureNA=1.5, apertureZGradient=0, apodization='sine')
PYME.Analysis.PSFGen.fourierHNA.GenWidefieldPSF(zs, dx=5, lamb=700, n=1.51, NA=1.47, apodization=None)
PYME.Analysis.PSFGen.fourierHNA.GenWidefieldPSFA(zs, dx=5, lamb=700, n=1.51, NA=1.47, field_x=0, field_y=0, apertureNA=1.5, apertureZGradient=0)
PYME.Analysis.PSFGen.fourierHNA.GenZernikeDAPSF(zs, dx=5, X=None, Y=None, zernikeCoeffs={}, lamb=700, n=1.51, NA=1.47, ns=1.51, field_x=0, field_y=0, apertureNA=1.5, apertureZGradient=0, apodizisation=None, vect=True)
PYME.Analysis.PSFGen.fourierHNA.GenZernikeDPSF(zs, dx=5, zernikeCoeffs={}, lamb=700, n=1.51, NA=1.47, ns=1.51, beadsize=0, vect=False, apodization=None)
PYME.Analysis.PSFGen.fourierHNA.GenZernikePSF(zs, dx=5, zernikeCoeffs=[])
PYME.Analysis.PSFGen.fourierHNA.PsfFromPupil(pupil, zs, dx, lamb, apodization=None, n=1.51, NA=1.51)
PYME.Analysis.PSFGen.fourierHNA.PsfFromPupilFP(X, Y, R, FP, u, v, n, pupil, zs)
PYME.Analysis.PSFGen.fourierHNA.PsfFromPupilVect(pupil, zs, dx, lamb, shape=[61, 61], apodization=None, n=1.51, NA=1.51)
PYME.Analysis.PSFGen.fourierHNA.PsfFromPupilVectFP(X, Y, R, FP, u, v, n, pupil, zs)