pyfrp_simulation.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:PyFRAP 作者: alexblaessle 项目源码 文件源码
def computeInterpolatedICImg(self):

        """Computes interpolation of initial condition image.

        Interpolation is done as in :py:func:`pyfrp.modules.pyfrp_sim_module.applyInterpolatedICs`.

        Returns:
            tuple: Tuple containing:

                * xInt (numpy.ndarray): Meshgrid x-coordinates.
                * yInt (numpy.ndarray): Meshgrid y-coordinates.
                * f (numpy.ndarray): Interpolated image.

        """

        #Get image resolution and center of geometry
        res=self.ICimg.shape[0]
        center=self.embryo.geometry.getCenter()

        #Define x/y coordinates of interpolation
        if 'quad' in self.embryo.analysis.process.keys():
            #Shift everything by center to fit with the mesh
            xInt = np.arange(center[0]+1, center[0]+res+1, 1)
            yInt = np.arange(center[1]+1, center[1]+res+1, 1)       
        else:
            xInt = np.arange(1, res+1, 1)
            yInt = np.arange(1, res+1, 1)

        #Generate interpolation function
        f=interp.RectBivariateSpline(xInt, yInt, self.ICimg, bbox=[None, None, None, None], kx=3, ky=3, s=0)

        return xInt, yInt, f
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号