suboptimumg.loganalysis.variables#

Log introspection utilities: variable enumeration, frequency analysis, config loading.

suboptimumg.loganalysis.variables.dump_variables(analyzer)[source]#

Enumerate every variable in a loaded PERDA log.

Variable IDs are intentionally excluded because they are log-internal and must not be used for access.

Parameters:

analyzer (Analyzer) – A loaded PERDA Analyzer instance.

Returns:

Columns: cpp_name, num_points, start_time, end_time, duration_s, min_value, max_value, median_freq_hz.

Return type:

pd.DataFrame

suboptimumg.loganalysis.variables.load_vehicle_setup(path='parameters/vehicle_setup.yaml')[source]#

Load a vehicle_setup.yaml configuration file.

Any YAML mapping containing both data (list of [x, y] pairs) and poly_order (int) is automatically converted to a FittedCurve. Everything else passes through as plain Python types.

Parameters:

path (str or Path) – Path to the YAML file.

Returns:

Parsed YAML contents with curve entries as FittedCurve objects. Typical top-level keys: alignment, steering, suspension.

Return type:

dict

suboptimumg.loganalysis.variables.logging_frequencies(analyzer, var_names)[source]#

Compute sample-rate statistics for a list of variables.

Parameters:
  • analyzer (Analyzer) – A loaded PERDA Analyzer instance.

  • var_names (list[str]) – CAN variable names (cpp_name) to analyse.

Returns:

Columns: var_name, median_freq_hz, mean_freq_hz, min_freq_hz, max_freq_hz, num_samples, num_gaps. num_gaps counts intervals exceeding 3x the median interval, indicating dropped samples.

Return type:

pd.DataFrame

suboptimumg.loganalysis.variables.sample_log(df, patterns=None, percentiles=None)[source]#

Print sampled values at key points through the log for debugging.

By default matches columns containing ‘pos’, ‘lat’, ‘latitude’, ‘lon’, ‘long’, or ‘longitude’ (case-insensitive).

Parameters:
  • df (pd.DataFrame) – The log DataFrame (output of perda_to_dataframe).

  • patterns (list[str] or None) – Substrings to match against column names.

  • percentiles (list[int] or None) – Which percentile indices to sample. Default: [0, 25, 50, 75, 100].

Return type:

None