PYME.Analysis.PSFGen.fourierHNA module

generate a phase ramp psf unp.sing fourier optics

PYME.Analysis.PSFGen.fourierHNA.EField_from_pupil_and_propagator(X, Y, R, FP, u, v, n, NA, pupil, zs, apodization='sine')
PYME.Analysis.PSFGen.fourierHNA.E_field_from_pupil_and_propagator(X, Y, R, FP, u, v, pupil, zs, n=1.51, NA=1.47, vectorial=False, apodization='sine', ns=None, output_shape=None, beadsize=0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.ExtractPupil(ps, zs, dx, lamb=488, NA=1.3, n=1.51, nIters=50, size=5000.0, intermediateUpdates=False, apodization='sine')
class PYME.Analysis.PSFGen.fourierHNA.FourierPSF(**kwargs)

Bases: object

e_field(zs)
psf(zs)
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)

Bases: FourierPropagatorHNA

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, v2D arrays

co-ordinates in the pupil plane

lambfloat

wavelength in nm

nfloat

refractive index

field_x, field_yfloat

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

apertureNAfloat

the NA of our clipping aperture

apertureZGradientfloat

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.

propagate(F, z)

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

Parameters
F2D array

complex pupil

zfloat

distance in nm to propagate

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

Bases: object

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, v2d arrays of float

the co-ordinates in spatial frequencies within the pupil plane

lambfloat

the wavelength in nm

nfloat

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.

classmethod get_propagator(u, v, k=None, lamb=488, n=1.51)
propagate(F, z)

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

Parameters
F2D array

complex pupil

zfloat

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
f2D array

complex electric field amplitude

zfloat

nominal distance of plane from focus in nm

Returns
PYME.Analysis.PSFGen.fourierHNA.Gen4PiPSF(zs, phi=0, zernikeCoeffs=[{}, {}], **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenAstigPSF(zs, strength=1.0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenBesselPSF(zs, rad=0.95, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenBiplanePSF(zs, zshift=500, xshift=1, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenClippedWidefieldPSF(zs, field_x=0, field_y=0, apertureNA=1.5, apertureZGradient=0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenColourPRIPSF(zs, strength=1.0, transmit=[1, 1], **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenCubicPhasePSF(zs, strength=1.0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenDHPSF(zs, vortices=[0.0], **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenICPRIPSF(zs, strength=1.0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenPRIEField(zs, strength=1.0, dp=0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenPRIPSF(zs, strength=1.0, dp=0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenR3PSF(zs, strength=1.0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenSAAstigPSF(zs, strength=1.0, SA=0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenSABesselPSF(zs, rad=0.95, strength=1.0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenSAPRIPSF(zs, strength=1.0, SA=0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenSAPSF(zs, strength=1.0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenShiftedPSF(zs, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenStripePRIPSF(zs, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenWidefieldPSF(zs, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenZernikeDAPSF(zs, zernikeCoeffs={}, field_x=0, field_y=0, apertureNA=1.5, apertureZGradient=0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenZernikeDPSF(zs, zernikeCoeffs={}, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenZernikeDonutPSF(zs, zernikeCoeffs={}, spiral_amp=1.0, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.GenZernikePSF(zs, zernikeCoeffs=[], **kwargs)
PYME.Analysis.PSFGen.fourierHNA.PSF_from_pupil_and_propagator(*args, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.PsfFromPupil(pupil, zs, dx, **kwargs)
PYME.Analysis.PSFGen.fourierHNA.PsfFromPupilVect(pupil, zs, dx, shape=[61, 61], **kwargs)
class PYME.Analysis.PSFGen.fourierHNA.ZernikePSF(zernikeCoeffs={}, **kwargs)

Bases: FourierPSF

PYME.Analysis.PSFGen.fourierHNA.clipped_widefield_pupil_and_propagator(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, **kwargs)

Generate a widefield pupil and corresponding propagator for the case where the light is clipped with another aperture which is off-centre and not in the pupil plane

Parameters
dxfloat

pixel size in resulting image

X, Y1D 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

lambfloat

wavelength

nfloat

refractive index

NAfloat

Numerical aperture

apodizationstring or None

one of None or ‘sine’. Pupil apodization.

Returns
X, Ypixel coordinates in nm
Rradial co-ordinates in u,v space
FPthe propagator
Mthe widefield pupil
u, vco-ordinates in pupil space
PYME.Analysis.PSFGen.fourierHNA.get_bead_pupil(X, Y, beadsize)
PYME.Analysis.PSFGen.fourierHNA.widefield_pupil_and_propagator(dx=5, X=None, Y=None, lamb=700, n=1.51, NA=1.47, **kwargs)

Generate a widefield pupil and corresponding propagator

Parameters
dxfloat

pixel size in resulting image

X, Y1D 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

lambfloat

wavelength

nfloat

refractive index

NAfloat

Numerical aperture

Returns
X, Ypixel coordinates in nm
Rradial co-ordinates in u,v space
FPthe propagator
Mthe widefield pupil
u, vco-ordinates in pupil space