original_docstring: Computes the bar angle of a snapshot from angle of the m=2 mode at its maximum
docstring: Computes the bar angle of a snapshot from angle of the m=2 mode at its maximum
docstring_tokens: Computes the bar angle of a snapshot from angle of the m = 2 mode at its maximum
code: def compute_bar_angle(snap, max_r=5, deg=True):
      """Computes the bar angle of a snapshot from angle of the m=2 mode at its maximum"""
      r, surfdensft = bar_cyl_fft(snap)
      gd_i = (r < max_r)
      m2 = np.abs(surfdensft[gd_i, 2]) / np.abs(surfdensft[gd_i, 0])
      ifid = np.argmax(m2)
      bar_angle = -0.5 * np.angle(surfdensft[gd_i, 2][ifid], deg=deg)
      return bar_angle
code_tokens: def compute_bar_angle ( snap , max_r = 5 , deg = True ) : r , surfdensft = bar_cyl_fft ( snap ) gd_i = ( r < max_r ) m2 = np . abs ( surfdensft [ gd_i , 2 ] ) / np . abs ( surfdensft [ gd_i , 0 ] ) ifid = np . argmax ( m2 ) bar_angle = - 0.5 * np . angle ( surfdensft [ gd_i , 2 ] [ ifid ] , deg = deg ) return bar_angle
short_docstring: Computes the bar angle of a snapshot from angle of the m=2 mode at its maximum
short_docstring_tokens: Computes the bar angle of a snapshot from angle of the m = 2 mode at its maximum
comment: """Computes the bar angle of a snapshot from angle of the m=2 mode at its maximum"""