beam-tracing / Scotty

Beam tracing code for diagnostics
https://scotty.readthedocs.io/en/latest/
GNU General Public License v3.0
7 stars 4 forks source link

Possible bug in horns? #40

Open ZedThree opened 2 years ago

ZedThree commented 2 years ago

The Scalar_horn and Goldsmith_symmetric Conical_horn variation both return only single values for the width, while all the other Conical_horn variations return a list of two values (for the electric and magnetic components I guess?).

Should those two instead return something like [width, width]?

The horns are also only used in one place: https://github.com/valerian-chen/Scotty/blob/9e1b154a319038e08509060daace50eac5b78734/scotty/init_bruv.py#L357-L364

and that looks like it's expecting horn_width to be a single number

ZedThree commented 2 years ago

Also the Speirs_asymmetric method returns two values for the curvature too -- probably all the horns should do so too?

valerian-chen commented 2 years ago

Some horns emit circularly symmetric Gaussian beams, while others have different widths/curvatures in the directions parallel and perpendicular to the propagation.

I've been meaning to do this properly, but right now it's a very hacky approach that is going to trip someone up. Thing is, Scotty doesn't yet accept non-circular beams as initial conditions. This is tricky to do because the elliptical beams due to the horns likely have their principal axes at some arbitrary angle.

I don't know what's the best way forward for now, before the new functionality is implemented in Scotty.

ZedThree commented 2 years ago

Here's some options:

  1. Change the default horn type to one that returns scalar width and curvature, and possibly disable the others for now
  2. Make the symmetric horns return [width, width], [curvature, curvature] and handle the general case in Psi_w_horn_cartesian
  3. Make the asymmetric horns return only single values for width and curvature
  4. Disable the horn_and_lens beam initialisation option for now