Map Services
Services for map objects in the Hiten framework.
Map Persistence Service
_MapPersistenceService()
Handle persistence for map objects.
- class hiten.algorithms.types.services.maps._MapPersistenceService[source]
Bases:
_PersistenceServiceBase
Handle persistence for map objects.
- Parameters:
save_fn (Callable[..., Any]) – The function to save the object.
load_fn (Callable[..., Any]) – The function to load the object.
load_inplace_fn (Optional[Callable[..., Any]] = None) – The function to load the object in place.
Map Dynamics Service Base
_MapDynamicsServiceBase()
Base class for map dynamics services.
- class hiten.algorithms.types.services.maps._MapDynamicsServiceBase(domain_obj)[source]
Bases:
_DynamicsServiceBase
Base class for map dynamics services with caching.
- Parameters:
domain_obj (Any) – The domain object.
- sections
The sections.
- Type:
dict[str,
_Section
]
- section
The section.
- Type:
_Section
- abstract property map_config
The map configuration.
- get_section(section_coord=None)[source]
Get a computed section by coordinate.
- Parameters:
section_coord (str) – The section coordinate identifier.
- Returns:
The computed section data.
- Return type:
_Section
- Raises:
KeyError – If the section has not been computed.
Notes
This method returns the full section data including points, states, labels, and times. Use this method when you need access to the complete section information.
- list_sections()[source]
List all computed section coordinates.
Notes
This method returns the keys of the internal section cache, indicating which sections are available for access.
- has_section(section_coord)[source]
Check if a section has been computed.
- Parameters:
section_coord (str) – The section coordinate identifier to check.
- Returns:
True if the section has been computed, False otherwise.
- Return type:
Notes
This method provides a safe way to check section availability before attempting to access it.
- clear()[source]
Clear all cached sections.
Notes
This method clears the internal caches for sections, forcing recomputation on the next access. Use this method to free memory or force fresh computation with updated parameters.
- get_points(*, section_coord=None, axes=None)[source]
Return cached points for a section with optional axis projection.
- Parameters:
section_coord (str, optional) – Which stored section to retrieve. If None, uses the default section coordinate from the configuration.
axes (tuple[str, str], optional) – Optional tuple of two axis labels (e.g., (“q3”, “p2”)) requesting a different 2D projection of the stored state. If None, returns the raw stored projection.
- Returns:
Array of 2D points in the section plane, either the raw points or a projection onto the specified axes.
- Return type:
ndarray, shape (n, 2)
Notes
This method provides access to the computed section points with optional axis projection. If the section hasn’t been computed, it triggers computation automatically. The axis projection allows viewing the section data from different coordinate perspectives.
Center Manifold Map Dynamics Service
_CenterManifoldMapDynamicsService()
Provide dynamics services for center manifold maps.
- class hiten.algorithms.types.services.maps._CenterManifoldMapDynamicsService(domain_obj)[source]
Bases:
_MapDynamicsServiceBase
Dynamics service for center manifold maps with caching.
- Parameters:
domain_obj (
CenterManifoldMap
) – The domain object.
- center_manifold
The center manifold.
- Type:
- generator
The generator.
- property center_manifold: CenterManifold
The center manifold.
- property hamsys: _HamiltonianSystem
The Hamiltonian system.
- compute(*, section_coord='q3', overrides=None, **kwargs)[source]
Compute or retrieve the return map for the specified section.
- get_points_with_4d_states(*, section_coord=None, axes=None)[source]
Return 2-D projection of the Poincare map points with 4D state access.
This method extends the base implementation to allow projections mixing plane coordinates with the missing coordinate by using the stored 4-D center manifold states.
- to_synodic(poincare_point, section_coord, tol)[source]
Convert the Poincare point to synodic coordinates.
- property map_config: _CenterManifoldMapConfig
The map configuration.
Synodic Map Dynamics Service
_SynodicMapDynamicsService()
Provide dynamics services for synodic maps.
- class hiten.algorithms.types.services.maps._SynodicMapDynamicsService(domain_obj)[source]
Bases:
_MapDynamicsServiceBase
Dynamics service for synodic maps with detection-based computation.
- Parameters:
domain_obj (
SynodicMap
) – The domain object.
- trajectories
The trajectories.
- Type:
List[
Trajectory
]
- source
The source.
- Type:
Literal[
PeriodicOrbit
,Manifold
]
- property trajectories: List[Trajectory]
The trajectories.
- property source: Literal[PeriodicOrbit, Manifold]
The source.
- compute(*, section_axis, section_offset, plane_coords, direction, overrides=None, **kwargs)[source]
Compute the synodic map.
- property map_config: _SynodicMapConfig
The map configuration.
Map Services
_MapServices()
Encapsulate services for map objects.
- class hiten.algorithms.types.services.maps._MapServices(domain_obj, persistence, dynamics)[source]
Bases:
_ServiceBundleBase
Bundle all map services together.
- Parameters:
domain_obj (
Map
) – The domain object.persistence (_MapPersistenceService)
dynamics (_MapDynamicsServiceBase)
- dynamics
The dynamics service.
- Type:
- persistence
The persistence service.
- Type:
- classmethod default(domain_obj)[source]
Create a default service bundle.
- Parameters:
domain_obj (
Map
) – The domain object.- Returns:
The service bundle.
- Return type:
Create a service bundle with a shared dynamics service.
- Parameters:
dynamics (
_MapDynamicsServiceBase
) – The dynamics service.- Returns:
The service bundle.
- Return type: