Skip to content

Settings

This page lists the shared settings for the techniques.

There are two ways to adjust these settings, either via the method constructor.

For example, adjusting the post measurement settings:

import pypalmsens as ps

cv = ps.LinearSweepVoltammetry(
    ...,
    post_measurement = {
        'cell_on_after_measurement': True,
        'standby_potential': 0.5,
        'standby_time': 30,
    } # (1)!
)
  1. Note that you can either pass a dictionary or the associated ps.settings.PostMeasurement class.

Or by setting the values on the attribute:

lsv = ps.LinearSweepVoltammetry()

lsv.post_measurement.cell_on_after_measurement = True
lsv.post_measurement.standby_potential = 0.5
lsv.post_measurement.standby_time = 30

See the technique reference pages to see which settings are supported.

pypalmsens.settings

This module contains the public api for classes for method configuration.

Classes:

CurrentRange

Set the autoranging current.

Attributes:

max class-attribute instance-attribute

max: AllowedCurrentRanges = '10mA'

Maximum current range.

See pypalmsens.settings.AllowedCurrentRanges for options.

min class-attribute instance-attribute

min: AllowedCurrentRanges = '1uA'

Minimum current range.

See pypalmsens.settings.AllowedCurrentRanges for options.

start class-attribute instance-attribute

start: AllowedCurrentRanges = '100uA'

Start current range.

See pypalmsens.settings.AllowedCurrentRanges for options.

PotentialRange

Set the autoranging potential.

Attributes:

max class-attribute instance-attribute

Maximum potential range.

See pypalmsens.settings.AllowedPotentialRanges for options.

min class-attribute instance-attribute

Minimum potential range.

See pypalmsens.settings.AllowedPotentialRanges for options.

start class-attribute instance-attribute

start: AllowedPotentialRanges = '1V'

Start potential range.

See pypalmsens.settings.AllowedPotentialRanges for options.

Pretreatment

Set the measurement pretreatment settings.

Attributes:

deposition_potential class-attribute instance-attribute

deposition_potential: float = 0.0

Deposition potential in V.

deposition_time class-attribute instance-attribute

deposition_time: float = 0.0

Deposition time in s.

conditioning_potential class-attribute instance-attribute

conditioning_potential: float = 0.0

Conditioning potential in V.

conditioning_time class-attribute instance-attribute

conditioning_time: float = 0.0

Conditioning time in s.

VersusOCP

Set the versus OCP settings.

Attributes:

mode class-attribute instance-attribute

mode: int = 0

Set versus OCP mode.

Possible values:

  • 0 = disable versus OCP
  • 1 = vertex 1 potential
  • 2 = vertex 2 potential
  • 3 = vertex 1 & 2 potential
  • 4 = begin potential
  • 5 = begin & vertex 1 potential
  • 6 = begin & vertex 2 potential
  • 7 = begin & vertex 1 & 2 potential

max_ocp_time class-attribute instance-attribute

max_ocp_time: float = 20.0

Maximum OCP time in s.

stability_criterion class-attribute instance-attribute

stability_criterion: float = 0.0

Stability criterion (potential/time) in mV/s.

If equal to 0 means no stability criterion. If larger than 0, then the value is taken as the stability threshold.

BiPot

Set the bipot settings.

Attributes:

mode class-attribute instance-attribute

mode: Literal['constant', 'offset'] = 'constant'

Set the bipotential mode.

Possible values: constant or offset

potential class-attribute instance-attribute

potential: float = 0.0

Set the bipotential in V.

current_range class-attribute instance-attribute

current_range: AllowedCurrentRanges | BiPotCurrentRange = '1uA'

Set the bipotential current range.

Can be a fixed current range or a ranging current. See the specifications for your instrument. Internally, a fixed current range is represented by an autoranging current with equal min/max ranges.

See pypalmsens.settings.AllowedCurrentRanges for options.

ELevel

Create a multi-step amperometry level method object.

Methods:

  • from_psobj

    Construct ELevel dataclass from PalmSens.Techniques.ELevel object.

Attributes:

level class-attribute instance-attribute

level: float = 0.0

Level in V.

duration class-attribute instance-attribute

duration: float = 1.0

Duration in s.

record class-attribute instance-attribute

record: bool = True

Record the current.

limit_current_max class-attribute instance-attribute

limit_current_max: float | None = None

Limit current max in µA. Set to None to disable.

limit_current_min class-attribute instance-attribute

limit_current_min: float | None = None

Limit current min in µA. Set to None to disable.

trigger_lines class-attribute instance-attribute

trigger_lines: Sequence[Literal[0, 1, 2, 3]] = field(default_factory=list)

Trigger at level lines.

Set digital output lines at start of measurement, end of equilibration. Accepted values: 0 for d0, 1 for d1, 2 for d2, 3 for d3.

use_limits property

use_limits: bool

Return True if instance sets current limits.

from_psobj classmethod

from_psobj(psobj: ELevel)

Construct ELevel dataclass from PalmSens.Techniques.ELevel object.

Source code in src/pypalmsens/_methods/shared.py
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
@classmethod
def from_psobj(cls, psobj: PalmSens.Techniques.ELevel):
    """Construct ELevel dataclass from PalmSens.Techniques.ELevel object."""
    trigger_lines: list[Literal[0, 1, 2, 3]] = []

    if psobj.UseTriggerOnStart:
        trigger_bools = convert_int_to_bools(psobj.TriggerValueOnStart)
        for i in (0, 1, 2, 3):
            if trigger_bools[i]:
                trigger_lines.append(i)

    return cls(
        level=single_to_double(psobj.Level),
        duration=single_to_double(psobj.Duration),
        record=psobj.Record,
        limit_current_max=single_to_double(psobj.MaxLimit) if psobj.MaxLimit else None,
        limit_current_min=single_to_double(psobj.MinLimit) if psobj.MinLimit else None,
        trigger_lines=trigger_lines,
    )

ILevel

Create a multi-step potentiometry level method object.

Methods:

  • from_psobj

    Construct ILevel dataclass from PalmSens.Techniques.ELevel object.

Attributes:

level class-attribute instance-attribute

level: float = 0.0

Level in I.

This value is multiplied by the applied current range.

duration class-attribute instance-attribute

duration: float = 1.0

Duration in s.

record class-attribute instance-attribute

record: bool = True

Record the potential.

limit_potential_max class-attribute instance-attribute

limit_potential_max: float | None = None

Limit potential max in V. Set to None to disable.

limit_potential_min class-attribute instance-attribute

limit_potential_min: float | None = None

Limit potential min in V. Set to None to disable.

trigger_lines class-attribute instance-attribute

trigger_lines: Sequence[Literal[0, 1, 2, 3]] = field(default_factory=list)

Trigger at level lines.

Set digital output lines at start of measurement, end of equilibration. Accepted values: 0 for d0, 1 for d1, 2 for d2, 3 for d3.

use_limits property

use_limits: bool

Return True if instance sets current limits.

from_psobj classmethod

from_psobj(psobj: ELevel)

Construct ILevel dataclass from PalmSens.Techniques.ELevel object.

Source code in src/pypalmsens/_methods/shared.py
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
@classmethod
def from_psobj(cls, psobj: PalmSens.Techniques.ELevel):
    """Construct ILevel dataclass from PalmSens.Techniques.ELevel object."""
    trigger_lines: list[Literal[0, 1, 2, 3]] = []

    if psobj.UseTriggerOnStart:
        trigger_bools = convert_int_to_bools(psobj.TriggerValueOnStart)
        for i in (0, 1, 2, 3):
            if trigger_bools[i]:
                trigger_lines.append(i)

    return cls(
        level=single_to_double(psobj.Level),
        duration=single_to_double(psobj.Duration),
        record=psobj.Record,
        limit_potential_max=single_to_double(psobj.MaxLimit) if psobj.MaxLimit else None,
        limit_potential_min=single_to_double(psobj.MinLimit) if psobj.MinLimit else None,
        trigger_lines=trigger_lines,
    )

PostMeasurement

Set the post measurement settings.

Attributes:

cell_on_after_measurement class-attribute instance-attribute

cell_on_after_measurement: bool = False

Enable/disable cell after measurement.

standby_potential class-attribute instance-attribute

standby_potential: float = 0.0

Standby potential (V) for use with cell on after measurement.

standby_time class-attribute instance-attribute

standby_time: float = 0.0

Standby time (s) for use with cell on after measurement.

CurrentLimits

Set the limit settings.

Depending on the method, this will: - Abort the measurement - Reverse the scan instead (CV) - Proceed to the next stage (Mixed Mode)

Attributes:

  • max (None | float) –

    Set limit current max in µA.

  • min (None | float) –

    Set limit current min in µA.

max class-attribute instance-attribute

max: None | float = None

Set limit current max in µA.

min class-attribute instance-attribute

min: None | float = None

Set limit current min in µA.

PotentialLimits

Set the limit settings.

Depending on the method, this will: - Abort the measurement - Proceed to the next stage (Mixed Mode)

Attributes:

  • max (None | float) –

    Set limit potential max in V.

  • min (None | float) –

    Set limit potential min in V.

max class-attribute instance-attribute

max: None | float = None

Set limit potential max in V.

min class-attribute instance-attribute

min: None | float = None

Set limit potential min in V.

ChargeLimits

Set the charge limit settings.

Attributes:

  • max (None | float) –

    Set limit charge max in µC.

  • min (None | float) –

    Set limit charge min in µC.

max class-attribute instance-attribute

max: None | float = None

Set limit charge max in µC.

min class-attribute instance-attribute

min: None | float = None

Set limit charge min in µC.

IrDropCompensation

Set the iR drop compensation settings.

Attributes:

resistance class-attribute instance-attribute

resistance: None | float = None

Set the iR compensation resistance in Ω

EquilibrationTriggers

Set the equilibration triggers.

Set one or more digital outputs on the AUX port at the start of equilibration.

The selected digital line(s) will be set to high when triggered and remain high until the end of the equilibration.

See the instrument-specific documentation for more information about the position of the digital pins on your instrument’s auxiliary port.

Methods:

  • clear

    Clear triggers.

Attributes:

  • d0 (bool) –

    If True, enable trigger at d0 high.

  • d1 (bool) –

    If True, enable trigger at d1 high.

  • d2 (bool) –

    If True, enable trigger at d2 high.

  • d3 (bool) –

    If True, enable trigger at d3 high.

d0 class-attribute instance-attribute

d0: bool = False

If True, enable trigger at d0 high.

d1 class-attribute instance-attribute

d1: bool = False

If True, enable trigger at d1 high.

d2 class-attribute instance-attribute

d2: bool = False

If True, enable trigger at d2 high.

d3 class-attribute instance-attribute

d3: bool = False

If True, enable trigger at d3 high.

clear

clear()

Clear triggers.

Source code in src/pypalmsens/_methods/settings.py
444
445
446
447
448
449
def clear(self):
    """Clear triggers."""
    self.d0 = False
    self.d1 = False
    self.d2 = False
    self.d3 = False

MeasurementTriggers

Set the measurement triggers.

Set one or more digital outputs on the AUX port at the start measurement (end of equilibration).

The selected digital line(s) will be set to high when triggered and remain high until the end of the measurement.

See the instrument-specific documentation for more information about the position of the digital pins on your instrument’s auxiliary port.

Methods:

  • clear

    Clear triggers.

Attributes:

  • d0 (bool) –

    If True, enable trigger at d0 high.

  • d1 (bool) –

    If True, enable trigger at d1 high.

  • d2 (bool) –

    If True, enable trigger at d2 high.

  • d3 (bool) –

    If True, enable trigger at d3 high.

d0 class-attribute instance-attribute

d0: bool = False

If True, enable trigger at d0 high.

d1 class-attribute instance-attribute

d1: bool = False

If True, enable trigger at d1 high.

d2 class-attribute instance-attribute

d2: bool = False

If True, enable trigger at d2 high.

d3 class-attribute instance-attribute

d3: bool = False

If True, enable trigger at d3 high.

clear

clear()

Clear triggers.

Source code in src/pypalmsens/_methods/settings.py
497
498
499
500
501
502
def clear(self):
    """Clear triggers."""
    self.d0 = False
    self.d1 = False
    self.d2 = False
    self.d3 = False

Multiplexer

Set the multiplexer settings.

Attributes:

mode class-attribute instance-attribute

mode: Literal['none', 'consecutive', 'alternate'] = 'none'

Set multiplexer mode.

Possible values:

  • none: No multiplexer (disable)
  • consecutive
  • alternate

channels class-attribute instance-attribute

channels: list[int] = Field(default_factory=list)

Set multiplexer channels

This is defined as a list of indexes for which channels to enable (max 128). For example, [0,3,7]. In consecutive mode all selections are valid.

In alternating mode the first channel must be selected and all other channels should be consecutive i.e. (channel 1, channel 2, channel 3 and so on).

connect_sense_to_working_electrode class-attribute instance-attribute

connect_sense_to_working_electrode: bool = False

Connect the sense electrode to the working electrode. Default is False.

combine_reference_and_counter_electrodes class-attribute instance-attribute

combine_reference_and_counter_electrodes: bool = False

Combine the reference and counter electrodes. Default is False.

use_channel_1_reference_and_counter_electrodes class-attribute instance-attribute

use_channel_1_reference_and_counter_electrodes: bool = False

Use channel 1 reference and counter electrodes for all working electrodes. Default is False.

set_unselected_channel_working_electrode class-attribute instance-attribute

set_unselected_channel_working_electrode: int = 0

Set the unselected channel working electrode to 0 = Disconnected / floating, 1 = Ground, 2 = Standby potential. Default is 0.

DataProcessing

Set the data processing settings.

Attributes:

smooth_level class-attribute instance-attribute

smooth_level: int = 0

Set the default curve post processing filter.

Possible values:

  • -1: no filter
  • 0: spike rejection
  • 1: spike rejection + Savitsky-golay window 5
  • 2: spike rejection + Savitsky-golay window 9
  • 3: spike rejection + Savitsky-golay window 15
  • 4: spike rejection + Savitsky-golay window 25

min_height class-attribute instance-attribute

min_height: float = 0.0

Determines the minimum peak height in µA for peak finding.

Peaks lower than this value are rejected.

min_width class-attribute instance-attribute

min_width: float = 0.1

The minimum peak width for peak finding.

The value is in the unit of the curves X axis (V). Peaks narrower than this value are rejected (default: 0.1 V).

General

Sets general/other settings.

Attributes:

save_on_internal_storage class-attribute instance-attribute

save_on_internal_storage: bool = False

Save on internal storage.

use_hardware_sync class-attribute instance-attribute

use_hardware_sync: bool = False

Use hardware synchronization with other channels/instruments.

notes class-attribute instance-attribute

notes: str = ''

Add some user notes for use with this technique.

power_frequency class-attribute instance-attribute

power_frequency: Literal[50, 60] = 50

Set the DC mains filter in Hz.

Adjusts sampling on instrument to account for mains frequency. Set to 50 Hz or 60 Hz depending on your region (default: 50).