gala.dynamics.fit_toy_potential(orbit, force_harmonic_oscillator=False)[source]

Fit a best fitting toy potential to the orbit provided. If the orbit is a tube (loop) orbit, use the Isochrone potential. If the orbit is a box potential, use the harmonic oscillator potential. An option is available to force using the harmonic oscillator (force_harmonic_oscillator).

See the docstrings for ~`gala.dynamics.fit_isochrone()` and ~`gala.dynamics.fit_harmonic_oscillator()` for more information.

orbit : Orbit
force_harmonic_oscillator : bool (optional)

Force using the harmonic oscillator potential as the toy potential.

potential : IsochronePotential or HarmonicOscillatorPotential

The best-fit potential object.