nibcq.lcr_compensation.LCRCompensationParameters
- class nibcq.lcr_compensation.LCRCompensationParameters
Bases:
nibcq.measurement.ConfigFileSupportParameters for LCR compensation generation.
This dataclass contains all configuration needed for the 7-step LCR compensation flow. The compensation data is stored on the device’s onboard memory (not in external files).
The parameters are divided into two groups:
- Generate flags - control which perform_lcr_*() methods run:
generate_custom_cable: Custom cable compensation (Step 2)
generate_open: Open compensation (Step 4)
generate_short: Short compensation (Step 4)
generate_load: Load compensation (Step 5)
- Enable flags - set on session for measurements after compensation:
enable_open: Use open compensation from onboard storage
enable_short: Use short compensation from onboard storage
enable_load: Use load compensation (requires open AND short!)
- generate_custom_cable
If True, performs custom cable compensation. Requires physical open and short connections during procedure.
- Type:
- generate_open
If True, performs open compensation. Requires physical open connection (no DUT).
- Type:
- generate_short
If True, performs short compensation. Requires physical short connection.
- Type:
- generate_load
If True, performs load compensation. Requires physical load connection with known reference.
- Type:
- enable_load
Enable load compensation for verification measurement. Note: Requires both enable_open AND enable_short to be True!
- Type:
- additional_frequencies
Extra frequencies for open/short compensation. Default frequencies are always included by the hardware.
- load_compensation_spots
Reference values for load compensation. Each spot specifies frequency and known impedance value.
- Type:
list[nidcpower.LCRLoadCompensationSpot]
- cable_length
Cable length setting for all compensation steps.
- Type:
nidcpower.CableLength
- dc_bias_source
DC bias source setting (OFF, VOLTAGE, or CURRENT).
- Type:
nidcpower.LCRDCBiasSource
- measurement_time
Measurement time setting (SHORT, MEDIUM, LONG, CUSTOM).
- Type:
nidcpower.LCRMeasurementTime
Examples
>>> # Simple open+short compensation >>> params = LCRCompensationParameters( ... generate_open=True, ... generate_short=True, ... enable_open=True, ... enable_short=True, ... ) >>> >>> # Full compensation with load >>> params = LCRCompensationParameters( ... generate_open=True, ... generate_short=True, ... generate_load=True, ... enable_open=True, ... enable_short=True, ... enable_load=True, ... load_compensation_spots=[ ... nidcpower.LCRLoadCompensationSpot( ... frequency=1000.0, ... reference_value_type=nidcpower.LCRReferenceValueType.IMPEDANCE, ... reference_value=complex(0.01, 0.0), # 10 mOhm known load ... ), ... ], ... )
- classmethod from_json(json_data: Dict[str, Any]) LCRCompensationParameters
Create LCRCompensationParameters instance from JSON dictionary.
- Parameters:
json_data (Dict[str, Any]) – Dictionary containing compensation configuration data.
- Returns:
Instance configured from JSON data.
- Return type:
- Raises:
LCRParameterError – If parameters are invalid.
KeyError – If expected keys are not found.
- classmethod from_file(file_path: str) LCRCompensationParameters
Create LCRCompensationParameters instance from JSON configuration file.
- Parameters:
file_path (str) – Path to JSON configuration file.
- Returns:
Instance configured from file.
- Return type:
- Raises:
FileNotFoundError – If configuration file is not found.
LCRParameterError – If file content is invalid.
json.JSONDecodeError – If file contains invalid JSON.