OrbitTools Class
- class galport.OrbitTools(xv0=None, potential=None, axisym_potential=None, Omega=0.0, Tint=100.0, Nint=2000, reverse=False, setunits=None, t=None, xv=None, act=None, lyapunov=False)[source]
Bases:
object
A unified interface for orbit integration, action-angle calculation, and orbit classification.
- __init__(xv0=None, potential=None, axisym_potential=None, Omega=0.0, Tint=100.0, Nint=2000, reverse=False, setunits=None, t=None, xv=None, act=None, lyapunov=False)[source]
Initialize OrbitTools with either initial conditions or pre-computed trajectories.
- Parameters:
xv0 (numpy 1D or 2D array) – initial condition for integration of few orbits
potential (agama.Potential) – potential for integration
axisym_potential (agama.Potential(symmetry = 'a' or 's'), optional) – if None, instantaneous action not calculated
Omega (float, optional) – parameter for potential Default: 0
Tint (float, optional) – parameter for potential Default: 100
Nint (float, optional) – parameter for potential Default: Tint*100
reverse (bool, optional) – Integrate orbit in both direct and reverse direction Default: False
setunits (list, optional) – Set the agama units
agama.setUnits(mass=setunits[0], length=setunits[1], velocity=setunits[2])Default: Nonet (numpy 1D array) – array of times Default: None
xv (numpy 2D or 3D array) – time series of xv for 1 orbit or N orbits Default: None
act (numpy 2D or 3D array, optional) – array of instantaneous actions Default: None
- calculate_actions(n_out=1, dJdt=False, secular=False, secular_extrema=False, secular_act_freq=False, secular_bar_var=False, border_type='apocenters', JR_ilr=True, positive_omega=True, apply_apo_filter=True, freq_ratio_lim=1.4, value_ratio_lim=0.1, spline_expansion=10, sidereal=False)[source]
Calculate averaged action-angle variables for all orbits.
This method uses
galport.averager.action()to compute averaged actions, angles, and frequencies.
- classify_orbits(t_out=0.0, theta_p=None, time_resolution=None, family='ILR', time_around_res=False, amplitude_res=False)[source]
- Parameters:
t_out ((M, ) float or numpy array) – array of times, in which we define the orbital type, by default 0.
theta_p ((N, ) numpy array, optional) – array of the perturbation (e.g. bar) rotation angle Default: None
time_resolution (float, optional) – time accuracy of series. Recommend don’t take too small Default: 5.
family (str, optional) – Default: ‘ILR’
time_around_res (bool, optional) – if True function estimate the resonance entry and exit times for resonant orbits, by default False
amplitude_res (bool, optional) – if True function estimate the maximum libration amplitude of the resonant angle, by default False
- Returns:
types ((M, ) numpy array) – array of types (integer)
amplitude ((M, ) numpy array, optional) – array of angles amplitude for passage or resonant orbit.
times ((M, 2) numpy array, optional) – if time_around=True array of times for resonance and passage orbits, when they entered/left into resonance or began/end to pass through it.
- naif_frequency(fxy=False)[source]
Calculate orbital frequencies using the NAIF package.
This method uses the external
naifpackage to find peak frequencies in the orbital motion. Requires NAIF to be installed.- Parameters:
fxy (bool, optional) – If True, also calculate frequencies in x and y coordinates separately. Default: False
- Returns:
freq_naif – Array of frequencies. Columns:
If fxy=False: [fR, fz, fφ]
If fxy=True: [fR, fz, fφ, fx, fy]
- Return type:
(Norb, 3) or (Norb, 5) numpy.ndarray