text: """
  Goniometer
  ==========
  """
  
  # sphinx_gallery_thumbnail_path = '../images/Experiment_CouplingVSPhi.png'
  
  def run(Plot, Save):
      import numpy as np
      from PyMieSim.Experiment import SphereSet, SourceSet, Setup, PhotodiodeSet
      from PyOptik             import ExpData
  
      detecSet   = PhotodiodeSet(NA           = [0.05, 0.1, 0.2, 0.3],
                                 Phi          = np.linspace(0,180,20),
                                 Gamma        = [0],
                                 Sampling     = [300],
                                 Filter       = None )
  
      scatSet    = SphereSet(Diameter       = [600e-9],
                             Material       = [ExpData('BK7')],
                             nMedium        = [1] )
  
      sourceSet  = SourceSet(  Wavelength   = [900e-9],
                               Polarization = [0],
                               Amplitude    = [1] )
  
      Experiment = Setup(ScattererSet = scatSet,
                         SourceSet    = sourceSet,
                         DetectorSet  = detecSet)
  
      Data = Experiment.Get(['Coupling'])
  
      if Plot:
          Data.Plot(y=['Coupling'], x='Phi')
  
      if Save:
          from pathlib import Path
          dir = f'docs/images/{Path(__file__).stem}'
          Data.SaveFig(Directory=dir, y='Coupling', x='Phi')
  
  if __name__ == '__main__':
      run(Plot=True, Save=False)
  