def __init__(self, shape=None, zrange=None, laser_wavelength=<NUM_LIT>,<EOL>zslab=<NUM_LIT:0.>, zscale=<NUM_LIT:1.0>, kfki=<NUM_LIT>, n2n1=<NUM_LIT>/<NUM_LIT>, alpha=<NUM_LIT>,<EOL>polar_angle=<NUM_LIT:0.>, pxsize=<NUM_LIT>, support_factor=<NUM_LIT:2>, normalize=False,<EOL>sigkf=<NUM_LIT:0.0>, nkpts=None, cutoffval=None, measurement_iterations=None,<EOL>k_dist='<STR_LIT>', use_J1=True, sph6_ab=None, global_zscale=False,<EOL>cutbyval=False, cutfallrate=<NUM_LIT>, cutedgeval=<NUM_LIT>,<EOL>pinhole_width=None, do_pinhole=False, *args, **kwargs):
self.pxsize = pxsize<EOL>self.polar_angle = polar_angle<EOL>self.support_factor = support_factor<EOL>self.normalize = normalize<EOL>self.measurement_iterations = measurement_iterations or <NUM_LIT:11><EOL>self.global_zscale = global_zscale<EOL>self.polychromatic = False<EOL>self.sigkf = sigkf<EOL>self.nkpts = nkpts<EOL>self.cutoffval = cutoffval<EOL>self.cutbyval = cutbyval<EOL>self.cutfallrate = cutfallrate<EOL>self.cutedgeval = cutedgeval<EOL>self.k_dist = k_dist<EOL>self.use_J1 = use_J1<EOL>self.do_pinhole = do_pinhole<EOL>if self.sigkf is not None:<EOL><INDENT>self.nkpts = self.nkpts or <NUM_LIT:3><EOL>self.polychromatic = True<EOL><DEDENT>elif self.nkpts is not None:<EOL><INDENT>self.sigkf = <NUM_LIT:0.0><EOL>self.polychromatic = True<EOL><DEDENT>else:<EOL><INDENT>self.sigkf = sigkf = <NUM_LIT:0.0><EOL>self.polychromatic = False<EOL><DEDENT>if (sph6_ab is not None) and (not np.isnan(sph6_ab)):<EOL><INDENT>self.use_sph6_ab = True <EOL><DEDENT>else:<EOL><INDENT>self.use_sph6_ab = False<EOL><DEDENT>if shape and zrange is None:<EOL><INDENT>zrange = (<NUM_LIT:0>, shape.shape[<NUM_LIT:0>])<EOL><DEDENT>self.zrange = zrange<EOL>params = [<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>'<EOL>]<EOL>values = np.array([<EOL>kfki,   zslab,   zscale,   alpha,   n2n1,   laser_wavelength,<EOL>sigkf,    sph6_ab<EOL>])<EOL>if not self.polychromatic:<EOL><INDENT>ind = params.index('<STR_LIT>')<EOL>params.pop(ind)<EOL>values = np.delete(values, ind)<EOL><DEDENT>if not self.use_sph6_ab:<EOL><INDENT>ind = params.index('<STR_LIT>')<EOL>params.pop(ind)<EOL>values = np.delete(values, ind)<EOL><DEDENT>for i in range(len(params)):<EOL><INDENT>if params[i] is '<STR_LIT>' and self.global_zscale:<EOL><INDENT>continue<EOL><DEDENT>params[i] = '<STR_LIT>' + params[i]<EOL><DEDENT>super(ExactPSF, self).__init__(<EOL>*args, params=params, values=values, shape=shape, **kwargs<EOL>)<EOL>
Superclass for all the exact PSFs, i.e. any PSF that is based on
physical properties of the imaging system such as the laser
wavelength.

This PSF functions by calculating the local PSF for every z layer
in the image, and convolving each layer independently (numerically
the exact model of image formation).

Parameters
----------
shape : tuple
    Shape of the image in (z,y,x) pixel numbers (to be deprecated)

zrange : tuple
    range of z pixels over which we should calculate the psf, good pixels
    being zrange[0] <= z <= zrange[1]. currently must be set to the interior
    of the image, so [state.pad, state.image.shape[0] - state.pad]

laser_wavelength : float
    wavelength of light in um of the incoming laser light

zslab : float
    Pixel position of the optical interface where 0 is the edge of the
    image in the z direction

zscale : float
    Scaling of the z pixel size, so that each pixel is located at
    zscale*(z - zint), such that the interface does not move with zscale

kfki : float
    Ratio of outgoing to incoming light wavevectors, 2\pi/\lambda

n2n1 : float
    Ratio of the index mismatch across the optical interface. For typical
    glass with glycerol/water 80/20 mixture this is 1.4/1.518

alpha : float
    Aperture of the lens in radians, set by arcsin(n2n1)?

polar_angle : float
    the angle of the light polarization with respect to the scanning axis

pxsize : float
    the size of a xy pixel in um, defaults to cohen group size 0.125 um

support_factor : integer
    size of the support

normalize : boolean
    if True, use the normalization as calculated by the PSF instead of
    unit normalization

sigkf : float
    Width of wavelengths to use in the polychromatic psf, None is
    monochromatic. Values for kfki = kfki +- sigkf, unitless

nkpts : integer
    number of integration points to use for the polychromatic psf

cutoffval : float
    Percentage of peak psf value to cutoff using a 3-axis
    exp(-(r-r0)**4) function where r0 is determined by cutoffval. A
    good value for this is the bit depth of the camera, or possibly the
    SNR, so 1/2**8 or 1/50.

measurement_iterations : int
    number of interations used when trying to find the center of mass
    of the psf in a certain slice

k_dist : str
    Eithe ['gaussian', 'gamma'] which control the wavevector
    distribution for the polychromatic detection psf. Default
    is Gaussian.

use_J1 : boolean
    Which hdet confocal model to use. Set to True to include the
    J1 term corresponding to a large-NA focusing lens, False to
    exclude it. Default is True

cutbyval : boolean
    If True, cuts the PSF based on the actual value instead of the
    position associated with the nearest value.

cutfallrate : float
    The relative value of the cutoffval over which to damp the
    remaining values of the psf. 0.3 seems a good fit now.

cutedgeval : float
    The value with which to determine the edge of the psf, typically
    taken around floating point, 1e-12

pinhole_width : Float
    The width of the line illumination, in 1/k units. Default is 1.0.

do_pinhole : Bool
    Whether or not to include pinhole line width in the sampling.
    Default is False.