make_optimizer
- ssapy.correlate_tracks.make_optimizer(mode, param, lsq=False)[source][source]
Creates and returns an optimizer object or function for orbital parameter estimation based on the specified mode and configuration.
Parameters:
- modestr
The optimization mode to use. Must be one of: - ‘rv’: Radial velocity-based optimization. - ‘angle’: Angular-based optimization. - ‘equinoctial’: Equinoctial orbital parameter optimization.
- paramlist or array-like
Initial parameters for the optimizer. - For ‘angle’ mode, the last six elements are expected to represent the initial position (last 6 to -3) and velocity (last 3).
- lsqbool, optional
If True, the optimizer will use a least-squares approach. Default is False.
Returns:
- outcallable
A callable optimizer object or function configured for the specified mode and parameters.
Raises:
- ValueError
If an unknown mode is provided.
Notes:
When lsq is True, the function wraps the optimizer in a least-squares optimizer (LeastSquaresOptimizer) and uses the appropriate translator class based on the mode.
For ‘angle’ mode, the function extracts the initial position and velocity from the param argument and passes them to the optimizer.
The function relies on the rvsampler module for optimizer classes and partial function creation.