stoner_measurement.instruments.current_source.CurrentSource¶
- class stoner_measurement.instruments.current_source.CurrentSource(transport: BaseTransport, protocol: BaseProtocol)[source]¶
Bases:
BaseInstrumentAbstract base class for precision current-source instruments.
Provides a shared API for DC current level, compliance voltage, and output enable control, with optional AC waveform and balanced-channel extensions advertised via
get_capabilities().- configure_arm(source: str = 'IMM', bypass: bool = False, time: float = 0, direction: str = 'ACC', tlink_in: int | None = None, tlink_out: int | None = None, output: str = 'None') None[source]¶
Configure the instrument arm layer.
- Raises:
NotImplementedError – If arming configuration is not supported by the driver.
- configure_custom_sweep(values: tuple[float, ...], *, delay: float = 0.0, count: int = 1) None[source]¶
Configure a custom point-by-point current sweep.
- Parameters:
values (tuple[float, ...]) – Explicit current values in amps.
- Keyword Parameters:
delay (float) – Source settling delay between points in seconds.
count (int) – Number of sweep repetitions.
- Raises:
NotImplementedError – If sweep is not supported. Check
get_capabilities().has_sweepbefore calling.
- configure_linear_sweep(start: float, stop: float, points: int, *, delay: float = 0.0, count: int = 1) None[source]¶
Configure a linearly spaced current sweep.
- Parameters:
- Keyword Parameters:
delay (float) – Source settling delay between sweep points in seconds.
count (int) – Number of sweep repetitions.
- Raises:
NotImplementedError – If sweep is not supported. Check
get_capabilities().has_sweepbefore calling.
- configure_list_compliance(values: list[float]) None[source]¶
Configure per-point compliance values for list sweeps.
- Raises:
NotImplementedError – If per-point compliance lists are not supported by the driver.
- configure_log_sweep(start: float, stop: float, points: int, *, delay: float = 0.0, count: int = 1) None[source]¶
Configure a logarithmically spaced current sweep.
- Parameters:
- Keyword Parameters:
delay (float) – Source settling delay between sweep points in seconds.
count (int) – Number of sweep repetitions.
- Raises:
NotImplementedError – If sweep is not supported. Check
get_capabilities().has_sweepbefore calling.
- configure_pulsed_sweep(sweep: CurrentSweepConfiguration, pulse: PulsedSweepConfiguration) None[source]¶
Configure a pulsed current sweep.
Each point in sweep becomes a pulse of duration
pulse.widthseconds followed bypulse.off_timeseconds atpulse.low_levelbefore the next sweep point.- Parameters:
sweep (CurrentSweepConfiguration) – Sweep point configuration.
pulse (PulsedSweepConfiguration) – Pulse timing and baseline current configuration.
- Raises:
NotImplementedError – If pulsed sweep is not supported by the driver. Check
get_capabilities().has_pulsed_sweepbefore calling.
- configure_sweep(config: CurrentSweepConfiguration) None[source]¶
Configure a built-in current sweep.
- Parameters:
config (CurrentSweepConfiguration) – Sweep configuration (spacing, start, stop, points, values, delay, count).
- Raises:
NotImplementedError – If sweep is not supported by the driver. Check
get_capabilities().has_sweepbefore calling.
- configure_trigger(source: str = 'IMM', bypass: bool = False, direction: str = 'ACC', tlink_in: int | None = None, tlink_out: int | None = None, output: str = 'None') None[source]¶
Configure the instrument trigger layer.
- Raises:
NotImplementedError – If trigger-layer configuration is not supported by the driver.
- configure_trigger_link(output_line: int, input_line: int) None[source]¶
Configure hardware trigger-link line routing.
- Raises:
NotImplementedError – If trigger-link routing is not supported by the driver.
- abstractmethod get_capabilities() CurrentSourceCapabilities[source]¶
Return the static capability descriptor for this driver.
- get_channel_level(channel: int) float[source]¶
Return programmed current for a specific output channel.
- Raises:
NotImplementedError – If per-channel current control is not supported by the driver.
- get_frequency() float[source]¶
Return AC waveform frequency in Hz.
- Raises:
NotImplementedError – If AC frequency control is not supported by the driver.
- get_offset_current() float[source]¶
Return AC waveform DC offset current in amps.
- Raises:
NotImplementedError – If offset-current control is not supported by the driver.
- get_operating_status() int[source]¶
Read an instrument operating-status register value.
- Raises:
NotImplementedError – If operating-status queries are not supported by the driver.
- get_waveform() CurrentWaveform[source]¶
Return the configured output waveform.
- Raises:
NotImplementedError – If waveform selection is not supported by the driver.
- set_channel_level(channel: int, value: float) None[source]¶
Set current for a specific output channel.
- Raises:
NotImplementedError – If per-channel current control is not supported by the driver.
- set_fixed_range(value: float) None[source]¶
Set a fixed current range for source output.
- Raises:
NotImplementedError – If fixed source range configuration is not supported by the driver.
- set_frequency(value: float) None[source]¶
Set AC waveform frequency in Hz.
- Raises:
NotImplementedError – If AC frequency control is not supported by the driver.
- set_offset_current(value: float) None[source]¶
Set AC waveform DC offset current in amps.
- Raises:
NotImplementedError – If offset-current control is not supported by the driver.
- set_sweep_count(count: int) None[source]¶
Set sweep repeat count.
- Raises:
NotImplementedError – If sweep repeat count is not supported by the driver.
- set_sweep_range_mode(mode: str) None[source]¶
Set current-range behaviour during sweeps.
- Raises:
NotImplementedError – If sweep range mode is not supported by the driver.
- set_waveform(waveform: CurrentWaveform) None[source]¶
Set output waveform mode.
- Raises:
NotImplementedError – If waveform selection is not supported by the driver.
- sweep_abort() None[source]¶
Abort a running or armed sweep.
- Raises:
NotImplementedError – If sweep is not supported by the driver. Check
get_capabilities().has_sweepbefore calling.
- sweep_start() None[source]¶
Arm the configured sweep, making it ready for triggering.
- Raises:
NotImplementedError – If sweep is not supported by the driver. Check
get_capabilities().has_sweepbefore calling.