data.py 文件源码

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

项目:trappist1 作者: rodluger 项目源码 文件源码
def mouse_drag(self, event):
    '''

    '''

    if event.inaxes == self.ax and event.button == 1:

      # Index of nearest point
      i = np.nanargmin(((event.xdata - self.x) / self.nx) ** 2)
      j = np.nanargmin(((event.ydata - self.y) / self.ny) ** 2)  

      if (i == self.last_i) and (j == self.last_j):
        return
      else:
        self.last_i = i
        self.last_j = j

      # Toggle pixel
      if self.aperture[j,i]:
        self.aperture[j,i] = 0
      else:
        self.aperture[j,i] = 1

      # Update the contour
      self.update()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号