OrbitClassifier Class
- class galport.OrbitClassifier(t, angles, theta_p=None, time_resolution=5.0)[source]
Bases:
object
A class for classifying orbits based on their resonant angle behavior.
This classifier analyzes the time evolution of a resonant angle to determine whether an orbit is in resonance, passing through resonance, or non-resonant. It supports multiple resonance families commonly found in barred galaxies.
- Parameters:
t ((N,) numpy.ndarray) – Array of time values.
angles ((M, N, 3) or (M, N,) or (N,) numpy.ndarray) – Series of angles. Can be one of: - Full set of 3 angles (θ_R, θ_z, θ_φ) for M orbits - Pre-computed resonant angle(s) for one or multiple orbits
theta_p ((N,) numpy.ndarray, optional) – Array of the perturbation (e.g., bar) rotation angle. Required for families that use θ_p. Default: None (assumes θ_p = 0)
time_resolution (float, optional) – Time resolution for angle analysis. The time series is downsampled to approximately this resolution to reduce numerical noise. Recommended not to set too small. Default: 5.0
Classification Types
The classifier assigns one of the following types to each orbit:
Type
Name
Description
0
Not classified
Unable to determine type
1
Increasing angle
Monotonically increasing (ω_res > 0)
2
Decreasing angle
Monotonically decreasing (ω_res < 0)
3
Resonance around 0
Librating around θ_res = 0
4
Resonance around π
Librating around θ_res = π
5
Passage through 0 (ω>0 → ω<0)
Crossing resonance at θ=0, slowing down
6
Passage through π (ω>0 → ω<0)
Crossing resonance at θ=π, slowing down
7
Passage through 0 (ω<0 → ω>0)
Crossing resonance at θ=0, speeding up
8
Passage through π (ω<0 → ω>0)
Crossing resonance at θ=π, speeding up
Resonance Families
Different resonance families correspond to different combinations of angles. The following families are supported:
Family
Resonance Angle Formula
'ILR'\(\theta_{\text{res}} = 2(\theta_\varphi - \theta_p) - \theta_R\)
'corotation'\(\theta_{\text{res}} = (\theta_\varphi - \theta_p) + \pi/2\)
'uha'\(\theta_{\text{res}} = 4(\theta_\varphi - \theta_p) - \theta_R\)
'vILR'\(\theta_{\text{res}} = \theta_z - \theta_R\)
Orbit Types by Family:
ILR: Type 3 → x1 orbits, Type 4 → x2 orbits
Corotation: Type 3 → L4 points, Type 4 → L5 points
vILR: Type 4 → banana orbits
- t
Downsampled time array.
- Type:
numpy.ndarray
- angles
Downsampled angle array(s).
- Type:
numpy.ndarray
- theta_p
Downsampled perturbation angle array.
- Type:
numpy.ndarray
- __call__(t_out, family='ILR', time_around_res=False, amplitude_res=False)[source]
Find resonant type
- Parameters:
t_out (float or (N, ) numpy array) – array of times, in which we define the orbital type
family (str ('ILR')) –
List of families:
’ILR’ or ‘ilr’ : θres = 2(θφ - θp) - θR
ILR orbits if resonance around 0 - x1 orbits, around π - x2; * ‘corotation’ or ‘cor’ : θres = θφ - θp + π/2 Corotatation orbits if resonance around around 0 - L4, π - L5 orbits; * ‘ultraharmonic’ or ‘uha’ or ‘4:1’ : θres = 4(θφ - θp) - θR * ‘vILR’ or ‘vilr’ : θres = θz - θR ILR orbits if resonance around pi - banana orbits;
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.
- __init__(t, angles, theta_p=None, time_resolution=5.0)[source]
Initialise angles
- Parameters:
t ((N, ) numpy array) – array of times
angles ((M, N, 3) or (M, N, ) or (N, ) numpy array) – series of 3 angles (θR, θz, θφ) or resonant angle, which user defined
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.