curryer.correction.parameters

Parameter set generation for the correction pipeline.

This module provides load_param_sets(), which generates parameter sets for correction analysis. Three search strategies are supported:

RANDOM (default)

Monte Carlo random walk. Each parameter is sampled from a normal distribution centered on current_value with the configured sigma, clipped to bounds. Controlled by seed and n_iterations.

GRID_SEARCH

Deterministic cartesian-product sweep. grid_points_per_param evenly-spaced offset values are produced for each parameter (spanning its full bounds range) and the cartesian product of all per-parameter grids is enumerated. n_iterations is ignored for this strategy.

SINGLE_OFFSET

Deterministic single-parameter sweep. Each parameter is varied independently across n_iterations evenly-spaced values while all other parameters are held at their nominal current_value.

Supported parameter types: - CONSTANT_KERNEL – 3-D attitude corrections (roll, pitch, yaw) stored as

a pandas.DataFrame with ugps, angle_x, angle_y, angle_z.

  • OFFSET_KERNEL – single-axis angle bias (float, in radians).

  • OFFSET_TIME – timing correction (float, in seconds).

Attributes

Functions

_arcsec_to_rad(→ float)

Convert arcseconds to radians.

_bounds_to_rad(→ list[float])

_val_to_rad(→ float)

_val_to_seconds(→ float)

_bounds_to_seconds(→ list[float])

_make_ck_dataframe(→ pandas.DataFrame)

Wrap [angle_x, angle_y, angle_z] (radians) into the pipeline DataFrame format.

_scalar_current_value(→ float)

Return param.spec.current_value as a scalar float.

_get_nominal_value(→ Any)

Return the un-perturbed, unit-converted value for param.

_get_grid_values(→ list[Any])

Return n_points evenly-spaced sampled values for param.

_generate_random(...)

Generate random parameter sets – exact current behaviour preserved.

_generate_grid_search(...)

Generate parameter sets via deterministic cartesian-product grid sweep.

_generate_single_offset(...)

Generate parameter sets by sweeping one parameter at a time.

_log_param_set_summary(→ None)

Log a structured summary of the generated parameter sets.

load_param_sets(...)

Generate parameter sets for correction iterations.

Module Contents

curryer.correction.parameters.logger
curryer.correction.parameters._UGPS_EPOCH_END = 2209075218000000
curryer.correction.parameters._arcsec_to_rad(value: float) float

Convert arcseconds to radians.

curryer.correction.parameters._bounds_to_rad(bounds: list[float], units: str | None) list[float]
curryer.correction.parameters._val_to_rad(value: float, units: str | None) float
curryer.correction.parameters._val_to_seconds(value: float, units: str | None) float
curryer.correction.parameters._bounds_to_seconds(bounds: list[float], units: str | None) list[float]
curryer.correction.parameters._make_ck_dataframe(angle_vals: list[float]) pandas.DataFrame

Wrap [angle_x, angle_y, angle_z] (radians) into the pipeline DataFrame format.

curryer.correction.parameters._scalar_current_value(param: curryer.correction.config.ParameterConfig) float

Return param.spec.current_value as a scalar float.

Raises:

TypeError – If current_value is not a scalar numeric type. This helps surface misconfigured parameters early instead of silently coercing them to 0.0.

curryer.correction.parameters._get_nominal_value(param: curryer.correction.config.ParameterConfig) Any

Return the un-perturbed, unit-converted value for param.

For CONSTANT_KERNEL, returns a DataFrame with angles equal to the current_value in radians. For OFFSET_KERNEL / OFFSET_TIME, returns a float in radians / seconds respectively.

curryer.correction.parameters._get_grid_values(param: curryer.correction.config.ParameterConfig, n_points: int) list[Any]

Return n_points evenly-spaced sampled values for param.

Offsets are linearly spaced over [bounds[0], bounds[1]] (in the parameter’s native units before conversion) and added to the converted current_value.

For CONSTANT_KERNEL the scalar offset is applied uniformly to all three rotation axes.

Parameters:
  • param (ParameterConfig) – Parameter specification.

  • n_points (int) – Number of evenly-spaced points (>= 2).

Returns:

List of n_points values; each element matches what the pipeline expects for that parameter type (DataFrame or float).

Return type:

list

curryer.correction.parameters._generate_random(sweep: curryer.correction.config.Sweep) list[list[tuple[curryer.correction.config.ParameterConfig, Any]]]

Generate random parameter sets – exact current behaviour preserved.

Generate parameter sets via deterministic cartesian-product grid sweep.

Produces grid_points_per_param ^ len(parameters) parameter sets. n_iterations is not used for this strategy.

Raises:

ValueError – If the total number of parameter sets would exceed sweep.max_grid_sets. Increase max_grid_sets deliberately, reduce grid_points_per_param or the number of parameters, or use SearchStrategy.SINGLE_OFFSET instead.

curryer.correction.parameters._generate_single_offset(sweep: curryer.correction.config.Sweep) list[list[tuple[curryer.correction.config.ParameterConfig, Any]]]

Generate parameter sets by sweeping one parameter at a time.

For each parameter in sweep.parameters: - n_iterations evenly-spaced values are generated spanning the

parameter’s full bounds offset range.

  • All other parameters are held at their nominal current_value.

Total parameter sets produced: len(parameters) × n_iterations.

curryer.correction.parameters._log_param_set_summary(output: list[list[tuple[curryer.correction.config.ParameterConfig, Any]]]) None

Log a structured summary of the generated parameter sets.

High-level counts are always emitted at INFO. The full per-set detail (angles / offsets for every set) is emitted at DEBUG only, so large GRID_SEARCH / SINGLE_OFFSET sweeps do not flood the INFO log.

curryer.correction.parameters.load_param_sets(sweep: curryer.correction.config.Sweep) list[list[tuple[curryer.correction.config.ParameterConfig, Any]]]

Generate parameter sets for correction iterations.

Dispatches to the appropriate generator based on sweep.search_strategy:

  • RANDOM – Monte Carlo random walk (default).

  • GRID_SEARCH – deterministic cartesian-product sweep across grid_points_per_param evenly-spaced values per parameter.

  • SINGLE_OFFSET – deterministic single-parameter sweep; each parameter is varied independently while others stay at nominal.

Parameters:

sweep (Sweep) – The parameter-variation experiment: parameters, search strategy, and sampling settings.

Returns:

Outer list: one element per parameter set (iteration). Inner list: one (ParameterConfig, sampled_value) pair per parameter. sampled_value is a DataFrame for CONSTANT_KERNEL and a float for OFFSET_KERNEL / OFFSET_TIME.

Return type:

list[list[tuple[ParameterConfig, Any]]]