# surface_of_section¶

gala.dynamics.nonlinear.surface_of_section(orbit, constant_idx, constant_val=0.0)[source]

Generate and return a surface of section from the given orbit.

Parameters
orbitOrbit

The input orbit to generate a surface of section for.

constant_idxint

Integer that represents the coordinate to record crossings in. For example, for a 2D Hamiltonian where you want to make a SoS in $$y-p_y$$, you would specify constant_idx=0 (crossing the $$x$$ axis), and this will only record crossings for which $$p_x>0$$.

Returns
sos
TODO:
• Implement interpolation to get the other phase-space coordinates truly

at the plane, instead of just at the orbital position closest to the plane.