curve.py 文件源码

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

项目:CElegansBehaviour 作者: ChristophKirst 项目源码 文件源码
def set_points_uniform_length(self, npoints = None):
    """Resample the curves base points such that the distances between the curve vectors are uniform

    Arguments:
      npoints (int or None): number of sample points    
    """
    if npoints is None:
      if self._npoints is None:
        raise ValueError('cannot determine number of points for uniform sampling!');
      npoints = self._npoints; 

    tck,u = splprep(self.values.T, s = 0);
    points = np.linspace(0,1,npoints)
    values = splev(points, tck, der = 0, ext = 1);  
    self.set_values(np.vstack(values).T, points);
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号