nibcq.compensation.ImpedanceTable

class nibcq.compensation.ImpedanceTable(params: List[CompensationParameter])

Single-list table of CompensationParameter with fast lookups via bisect.

  • Stores one ascending-sorted list[CompensationParameter].

  • Uses a frequency-view for O(log n) LOWER/UPPER/NEAREST/LINEAR lookups.

Parameters:

params (List[CompensationParameter])

classmethod from_params(params: List[CompensationParameter]) ImpedanceTable

Creates an ImpedanceTable from a list of CompensationParameters.

Parameters:

params (List[CompensationParameter])

Return type:

ImpedanceTable

classmethod from_dict(d: Dict[float, complex]) ImpedanceTable

Creates an ImpedanceTable from a dictionary of frequency/impedance pairs.

Parameters:

d (Dict[float, complex])

Return type:

ImpedanceTable

classmethod from_rows(rows: list[Dict[str, Any]]) ImpedanceTable

Creates an ImpedanceTable from a list of rows.

Parameters:

rows (list[Dict[str, Any]])

Return type:

ImpedanceTable

classmethod from_file(path: str) ImpedanceTable

Creates an ImpedanceTable from a JSON file.

Parameters:

path (str)

Return type:

ImpedanceTable

value_at(f: float, mode: nibcq.enums.InterpolationMode = InterpolationMode.NEAREST) complex

Returns the compensation value at the specified frequency.

This depends on the specified interpolation mode.

Parameters:
Return type:

complex