errors.py 文件源码

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

项目:measure_lens_alignment 作者: oxford-pcs 项目源码 文件源码
def calculate_position_error_at_z(self, z=0):
    '''
      Returns the standard deviation in x and y, and the euclidean distance between 
      pairs of coordinates.    
    '''
    xy_at_given_z = []
    for ax in self.axes:
      x, y = ax.getXY(z=z)
      xy_at_given_z.append((x,y))
    X = [xy[0] for xy in xy_at_given_z]
    Y = [xy[1] for xy in xy_at_given_z]

    pairs = []
    for x, y in zip(X, Y):
      pairs.append((x,y))

    distances = distance.pdist(pairs)

    return ((np.std(X), np.std(Y)), np.mean(distances))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号