galpy.orbit.Orbit.SOS

Orbit.SOS(pot, ncross=500, surface=None, t0=0.0, method='dop853_c', skip=100, progressbar=True, numcores=2, force_map=False, **kwargs)[source]

Calculate the surface of section of the orbit.

Parameters:
  • pot (Potential, DissipativeForce, or list of such instances) – Gravitational field to integrate the orbit in.

  • ncross (int, optional) – Number of times to cross the surface. Default is 500.

  • surface (str, optional) – Surface to punch through. This has no effect in 3D, where the surface is always z=0, but in 2D it can be ‘x’ or ‘y’ for x=0 or y=0. Default is None.

  • t0 (float or Quantity, optional) – Time of the initial condition. Default is 0.

  • method ({'odeint', 'dop853_c', 'dop853', 'rk4_c', 'rk6_c', 'dop54_c'}, optional) – Integration method. Default is ‘dop853_c’. See Notes for more information.

  • skip (int, optional) – For non-adaptive integrators, the number of basic steps to take between crossings (these are further refined in the code, but only up to a maximum refinement, so you can use skip to get finer integration in cases where more accuracy is needed). Default is 100.

  • progressbar (bool, optional) – If True, display a tqdm progress bar when integrating multiple orbits (requires tqdm to be installed!). Default is True.

  • numcores (int, optional) – Number of cores to use for Python-based multiprocessing (pure Python or using force_map=True). Default is OMP_NUM_THREADS.

  • force_map (bool, optional) – If True, force use of Python-based multiprocessing (not recommended). Default is False.

Returns:

(R,vR) for 3D orbits, (y,vy) for 2D orbits when surface==’x’, (x,vx) for 2D orbits when surface==’y’.

Return type:

tuple

Notes

  • Possible integration methods are:

    • ‘odeint’ for scipy’s odeint

    • ‘rk4_c’ for a 4th-order Runge-Kutta integrator in C

    • ‘rk6_c’ for a 6-th order Runge-Kutta integrator in C

    • ‘dopr54_c’ for a 5-4 Dormand-Prince integrator in C

    • ‘dop853’ for a 8-5-3 Dormand-Prince integrator in Python

    • ‘dop853_c’ for a 8-5-3 Dormand-Prince integrator in C

  • 2023-03-16 - Written - Bovy (UofT)