def __init__(self, model, model_kwargs,
                 pha_offset=0, nrel=0.1, rrel=0.05, verbose=0):
        """Interpolation in-between modeled phase images

        Parameters
        ----------
        model: str
            Name of the light-scattering model
            (see :const:`qpsphere.models.available`)
        model_kwargs: dict
            Keyword arguments for the sphere model; must contain:

            - radius: float
                 Radius of the sphere [m]
            - sphere_index: float
                 Refractive index of the object
            - medium_index: float
                 Refractive index of the surrounding medium
            - wavelength: float
                 Vacuum wavelength of the imaging light [m]
            - pixel_size: float
                 Pixel size [m]
            - grid_size: tuple of floats
                 Resulting image size in x and y [px]
            - center: tuple of floats
                 Center position in image coordinates [px]
        pha_offset: float
            Phase offset added to the interpolation result
        nrel : float
            Determines the border of the interpolation range for the
            refractive index: [n-(n-nmed)*nrel, n+(n-nmed)*nrel]
            with n=model_kwargs["sphere_index"] and
            nmed=model_kwargs["medium_index"]
        rrel : float
            Determines the border of the interpolation range for the
            radius: [r*(1-rrel), r*(1+rrel)] with
            r=model_kwargs["radius"]
        verbose: int
            Increases verbosity.
        """
        self.verbose = verbose

        #: scattering model
        self.model = model
        #: scattering model function
        self.sphere_method = models.model_dict[model]
        #: scattering model keyword arguments
        self.model_kwargs = model_kwargs
        #: current sphere radius [m]
        self.radius = model_kwargs["radius"]
        #: current sphere index
        self.sphere_index = model_kwargs["sphere_index"]
        #: current background phase offset
        self.pha_offset = pha_offset
        #: current pixel offset in x
        self.posx_offset = model_kwargs["center"][0]
        #: current pixel offset in y
        self.posy_offset = model_kwargs["center"][1]
        #: half of current search interval size for refractive index
        self.dn = abs(
            (self.sphere_index - model_kwargs["medium_index"]) * nrel)
        #: half of current search interval size for radius [m]
        self.dr = self.radius * rrel

        # dictionary for determining if a new phase image
        # needs to be computed
        self._n_border = np.zeros((3, 3), dtype=float)
        self._r_border = np.zeros((3, 3), dtype=float)

        # border phase images
        self._border_pha = {}
def __init__ ( self , model , model_kwargs , pha_offset = 0 , nrel = 0.1 , rrel = 0.05 , verbose = 0 ) : self . verbose = verbose self . model = model self . sphere_method = models . model_dict [ model ] self . model_kwargs = model_kwargs self . radius = model_kwargs [ "radius" ] self . sphere_index = model_kwargs [ "sphere_index" ] self . pha_offset = pha_offset self . posx_offset = model_kwargs [ "center" ] [ 0 ] self . posy_offset = model_kwargs [ "center" ] [ 1 ] self . dn = abs ( ( self . sphere_index - model_kwargs [ "medium_index" ] ) * nrel ) self . dr = self . radius * rrel self . _n_border = np . zeros ( ( 3 , 3 ) , dtype = float ) self . _r_border = np . zeros ( ( 3 , 3 ) , dtype = float ) self . _border_pha = { }
Interpolation in-between modeled phase images

        Parameters
        ----------
        model: str
            Name of the light-scattering model
            (see :const:`qpsphere.models.available`)
        model_kwargs: dict
            Keyword arguments for the sphere model; must contain:

            - radius: float
                 Radius of the sphere [m]
            - sphere_index: float
                 Refractive index of the object
            - medium_index: float
                 Refractive index of the surrounding medium
            - wavelength: float
                 Vacuum wavelength of the imaging light [m]
            - pixel_size: float
                 Pixel size [m]
            - grid_size: tuple of floats
                 Resulting image size in x and y [px]
            - center: tuple of floats
                 Center position in image coordinates [px]
        pha_offset: float
            Phase offset added to the interpolation result
        nrel : float
            Determines the border of the interpolation range for the
            refractive index: [n-(n-nmed)*nrel, n+(n-nmed)*nrel]
            with n=model_kwargs["sphere_index"] and
            nmed=model_kwargs["medium_index"]
        rrel : float
            Determines the border of the interpolation range for the
            radius: [r*(1-rrel), r*(1+rrel)] with
            r=model_kwargs["radius"]
        verbose: int
            Increases verbosity.