stoner_measurement.instruments.lockin_amplifier.LockInAmplifier¶
- class stoner_measurement.instruments.lockin_amplifier.LockInAmplifier(transport: BaseTransport, protocol: BaseProtocol)[source]¶
Bases:
BaseInstrumentAbstract base class for lock-in amplifier instruments.
Provides a common interface for dual-output lock-in amplifiers where the measured signal is available as in-phase/quadrature components (
X,Y) and polar components (magnitudeR, angletheta).- Variables:
transport (BaseTransport) – Transport layer instance.
protocol (BaseProtocol) – Protocol instance.
- auto_gain() None[source]¶
Run instrument auto-gain adjustment.
- Raises:
NotImplementedError – If auto-gain is not supported by the instrument.
- auto_phase() None[source]¶
Run instrument auto-phase adjustment.
- Raises:
NotImplementedError – If auto-phase is not supported by the instrument.
- auto_reserve() None[source]¶
Run instrument auto-reserve adjustment.
- Raises:
NotImplementedError – If auto-reserve is not supported by the instrument.
- abstractmethod get_capabilities() LockInAmplifierCapabilities[source]¶
Return static capability metadata.
- Returns:
Capability descriptor.
- Return type:
- get_dynamic_reserve_db() float[source]¶
Return the dynamic reserve (signal stability) in decibels.
A higher value indicates that the instrument can tolerate larger interfering signals relative to the signal of interest without introducing significant errors.
- Returns:
Dynamic reserve in dB.
- Return type:
(float)
- Raises:
NotImplementedError – If numeric dynamic reserve control is not supported by the instrument.
- get_filter_slope() int[source]¶
Return the output filter roll-off slope in dB/octave.
- Raises:
NotImplementedError – If filter-slope control is not supported by the instrument.
- get_harmonic() int[source]¶
Return the selected detection harmonic.
- Raises:
NotImplementedError – If harmonic selection is not supported by the instrument.
- get_input_coupling() LockInInputCoupling[source]¶
Return the input coupling mode.
- Raises:
NotImplementedError – If input-coupling control is not supported by the instrument.
- get_input_shielding() LockInInputShielding[source]¶
Return the input shield grounding mode.
- Returns:
Active input shield grounding mode.
- Return type:
- Raises:
NotImplementedError – If input shielding control is not supported by the instrument.
- get_input_source() LockInInputSource[source]¶
Return the active input source.
- Returns:
Active input source selection.
- Return type:
- Raises:
NotImplementedError – If input source selection is not supported by the instrument.
- get_line_filter() LockInLineFilter[source]¶
Return the line-frequency notch filter configuration.
- Returns:
Active notch filter configuration.
- Return type:
- Raises:
NotImplementedError – If line filter control is not supported by the instrument.
- get_oscillator_amplitude() float[source]¶
Return the internal oscillator sine output amplitude in volts.
- Returns:
Oscillator amplitude in volts.
- Return type:
(float)
- Raises:
NotImplementedError – If the instrument does not have a controllable internal oscillator.
- get_output_offset(channel: LockInOutputChannel) tuple[float, LockInExpandFactor][source]¶
Return the output offset percentage and expand factor for a channel.
- Parameters:
channel (LockInOutputChannel) – Output channel to query.
- Returns:
(offset_pct, expand_factor)whereoffset_pctis the offset as a percentage andexpand_factoris the expand multiplier.- Return type:
- Raises:
NotImplementedError – If output offset and expand are not supported by the instrument.
- abstractmethod get_reference_frequency() float[source]¶
Return the reference frequency in hertz.
- Returns:
Reference frequency in hertz.
- Return type:
(float)
- abstractmethod get_reference_phase() float[source]¶
Return the reference phase in degrees.
- Returns:
Reference phase in degrees.
- Return type:
(float)
- abstractmethod get_reference_source() tuple[LockInReferenceSource, LockinRefenceEdge][source]¶
Return the active reference source.
- Returns:
Active reference source.
- Return type:
- get_reserve_mode() LockInReserveMode[source]¶
Return the dynamic reserve mode.
- Raises:
NotImplementedError – If reserve-mode control is not supported by the instrument.
- abstractmethod get_sensitivity() float[source]¶
Return the active sensitivity scale.
- Returns:
Sensitivity in volts.
- Return type:
(float)
- get_sync_filter_enabled() bool[source]¶
Return whether the synchronous output filter is enabled.
- Returns:
Truewhen the synchronous filter is enabled.- Return type:
(bool)
- Raises:
NotImplementedError – If synchronous filter control is not supported by the instrument.
- abstractmethod get_time_constant() float[source]¶
Return the active output filter time constant.
- Returns:
Time constant in seconds.
- Return type:
(float)
- abstractmethod measure_rt() tuple[float, float][source]¶
Measure and return magnitude and phase outputs.
- abstractmethod measure_xy() tuple[float, float][source]¶
Measure and return the in-phase and quadrature outputs.
- set_dynamic_reserve_db(value_db: float) None[source]¶
Set the dynamic reserve (signal stability) in decibels.
- Parameters:
value_db (float) – Desired dynamic reserve in dB.
- Raises:
NotImplementedError – If numeric dynamic reserve control is not supported by the instrument.
- set_filter_slope(slope: int) None[source]¶
Set the output filter roll-off slope in dB/octave.
- Raises:
NotImplementedError – If filter-slope control is not supported by the instrument.
- set_harmonic(harmonic: int) None[source]¶
Set the selected detection harmonic.
- Raises:
NotImplementedError – If harmonic selection is not supported by the instrument.
- set_input_coupling(coupling: LockInInputCoupling) None[source]¶
Set the input coupling mode.
- Raises:
NotImplementedError – If input-coupling control is not supported by the instrument.
- set_input_shielding(shielding: LockInInputShielding) None[source]¶
Set the input shield grounding mode.
- Parameters:
shielding (LockInInputShielding) – Shielding mode to select.
- Raises:
NotImplementedError – If input shielding control is not supported by the instrument.
- set_input_source(source: LockInInputSource) None[source]¶
Set the active input source.
- Parameters:
source (LockInInputSource) – Input source to select.
- Raises:
NotImplementedError – If input source selection is not supported by the instrument.
- set_line_filter(filter_config: LockInLineFilter) None[source]¶
Set the line-frequency notch filter configuration.
- Parameters:
filter_config (LockInLineFilter) – Notch filter configuration to apply.
- Raises:
NotImplementedError – If line filter control is not supported by the instrument.
- set_oscillator_amplitude(value: float) None[source]¶
Set the internal oscillator sine output amplitude in volts.
- Parameters:
value (float) – Amplitude in volts.
- Raises:
NotImplementedError – If the instrument does not have a controllable internal oscillator.
- set_output_offset(channel: LockInOutputChannel, offset_pct: float, expand_factor: LockInExpandFactor) None[source]¶
Set the output offset and expand factor for a channel.
- Parameters:
channel (LockInOutputChannel) – Output channel to configure.
offset_pct (float) – Offset as a percentage (typically −105 % to +105 %).
expand_factor (LockInExpandFactor) – Expand multiplier to apply.
- Raises:
NotImplementedError – If output offset and expand are not supported by the instrument.
- abstractmethod set_reference_frequency(value: float) None[source]¶
Set the reference frequency in hertz.
- Parameters:
value (float) – Frequency in hertz.
- abstractmethod set_reference_phase(value: float) None[source]¶
Set the reference phase in degrees.
- Parameters:
value (float) – Phase in degrees.
- abstractmethod set_reference_source(source: LockInReferenceSource, edge: LockinRefenceEdge = LockinRefenceEdge.FALLING) None[source]¶
Set the active reference source.
- Parameters:
source (LockInReferenceSource) – Source to select.
- set_reserve_mode(mode: LockInReserveMode) None[source]¶
Set the dynamic reserve mode.
- Raises:
NotImplementedError – If reserve-mode control is not supported by the instrument.
- abstractmethod set_sensitivity(value: float) None[source]¶
Set the active sensitivity scale.
- Parameters:
value (float) – Sensitivity in volts.