class_docstr: Galaxy simulation using the density wave theory 
docstr: Initialize galaxy 
code: def __init__(self, n=20000):
      """Initialize galaxy"""
  
      # Eccentricity of the innermost ellipse
      self._inner_eccentricity = 0.8
  
      # Eccentricity of the outermost ellipse
      self._outer_eccentricity = 1.0
  
      # Velocity at the innermost core in km/s
      self._center_velocity = 30
  
      # Velocity at the core edge in km/s
      self._inner_velocity = 200
  
      # Velocity at the edge of the disk in km/s
      self._outer_velocity = 300
  
      # Angular offset per parsec
      self._angular_offset = 0.019
  
      # Inner core radius
      self._core_radius = 6000
  
      # Galaxy radius
      self._galaxy_radius = 15000
  
      # The radius after which all density waves must have circular shape
      self._distant_radius = 0
  
      # Distribution of stars
      self._star_distribution = 0.45
  
      # Angular velocity of the density waves
      self._angular_velocity = 0.000001
  
      # Number of stars
      self._stars_count = n
  
      # Number of dust particles
      self._dust_count = int(self._stars_count * 0.75)
  
      # Number of H-II regions
      self._h2_count = 200
  
      # Particles
      dtype = [
          ("theta", np.float32),
          ("velocity", np.float32),
          ("angle", np.float32),
          ("m_a", np.float32),
          ("m_b", np.float32),
          ("size", np.float32),
          ("type", np.float32),
          ("temperature", np.float32),
          ("brightness", np.float32),
          ("position", np.float32, 2),
      ]
      n = self._stars_count + self._dust_count + 2 * self._h2_count
      self._particles = np.zeros(n, dtype=dtype)
  
      i0 = 0
      i1 = i0 + self._stars_count
      self._stars = self._particles[i0:i1]
      self._stars["size"] = 3.0
      self._stars["type"] = 0
  
      i0 = i1
      i1 = i0 + self._dust_count
      self._dust = self._particles[i0:i1]
      self._dust["size"] = 64
      self._dust["type"] = 1
  
      i0 = i1
      i1 = i0 + self._h2_count
      self._h2a = self._particles[i0:i1]
      self._h2a["size"] = 0
      self._h2a["type"] = 2
  
      i0 = i1
      i1 = i0 + self._h2_count
      self._h2b = self._particles[i0:i1]
      self._h2b["size"] = 0
      self._h2b["type"] = 3
  
file_path: vispy/examples/demo/gloo/galaxy/galaxy_simulation.py
imports: import math
  import numpy
label_desc: Use image node_id 1 to create a new Galaxy object from inherited base classes: object with example: obj = Galaxy(n)