Family Module
The family module provides light-weight container that groups a family of periodic orbits obtained via a continuation engine.
It offers convenience helpers for iteration, random access, conversion to a pandas.DataFrame, and basic serialisation to an HDF5 file leveraging the existing utilities in io
.
OrbitFamily()
Container for an ordered family of periodic orbits.
- class hiten.system.family.OrbitFamily[source]
Bases:
_HitenBase
Container for an ordered family of periodic orbits.
- Parameters:
orbits (List[
PeriodicOrbit
]) – The orbits in the family.parameter_name (str) – The name of the parameter that is varied.
parameter_values (np.ndarray) – The values of the parameter that is varied.
- property periods: ndarray
Array of orbit periods.
- Returns:
Array of orbit periods in nondimensional units (NaN if not available).
- Return type:
- property jacobis: ndarray
Array of Jacobi constants for all orbits.
- Returns:
Array of Jacobi constants (dimensionless).
- Return type:
- propagate(**kwargs)[source]
Propagate all orbits in the family.
- Parameters:
**kwargs – Additional keyword arguments passed to each orbit’s propagate method.
- Return type:
None
- to_csv(filepath, **kwargs)[source]
Export the contents of the orbit family to a CSV file.
- Parameters:
filepath (str or Path) – Destination CSV file path.
**kwargs – Extra keyword arguments passed to
propagate()
.
- Raises:
ValueError – If no trajectory data is available to export.
- Return type:
None
- to_df(**kwargs)[source]
Return a DataFrame summarising the family.
- Parameters:
**kwargs – Additional keyword arguments passed to
propagate()
.- Return type:
DataFrame
- classmethod from_result(result, parameter_name=None)[source]
Build an OrbitFamily from a ContinuationResult.
- Parameters:
result (ContinuationResult) – Result object returned by the new continuation engine/facade.
parameter_name (str or None, optional) – Name for the continuation parameter. If None, defaults to “param”.
- Returns:
A new OrbitFamily instance containing the orbits from the result.
- Return type:
- classmethod load(filepath, **kwargs)[source]
Load a OrbitFamily from a file (new instance).
- Parameters:
filepath (str or Path) – The path to the file to load the family from.
**kwargs – Additional keyword arguments for the load operation.
- Return type:
- plot(*, dark_mode=True, save=False, filepath='orbit_family.svg', **kwargs)[source]
Visualise the family trajectories in rotating frame.
- Parameters:
- Returns:
The generated plot figure.
- Return type:
- Raises:
ValueError – If orbits have no trajectory data available.