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
评论列表
文章目录