hvl_ccb.dev.pfa2_filter.device

Inheritance diagram of hvl_ccb.dev.pfa2_filter.device

The main device class for the PFA-2 filter from Precision Filter Inc..

The PFA-2 filter is a high-precision, low-noise analog filter commonly used in laboratory instrumentation and signal conditioning setups. It is suitable for applications requiring clean signal output, such as spectroscopy, low-level voltage measurements, signal recovery and high-resolution data acquisition.

The class PFA2Filter has been tested with a PFA-2 (with option H) unit. Verify compatibility with your specific filter variant before use, especially for units with custom or user-modified settings.

Product information and technical details: https://pfinc.com/product/precision-pfa-2-filter-amplifier

class Channel(channel: int, com: Pfa2FilterSerialCommunication, option_hpf: bool)[source]

Bases: object

Class to control a single channel of the PFA-2 filter. Will be used for each channel.

property coupling: Pfa2FilterChannelCoupling

Get the coupling of the channel

AC: AC coupling DC: DC coupling

Raises:

Pfa2FilterCommunicationError – When the device does not respond

Returns:

Channel coupling as Pfa2FilterChannelCoupling

property hpf_freq: int

Get the set 3 dB cut of frequency of the high pass filter

Raises:
Returns:

Frequency in Hz

property hpf_state: bool

Get the ON/OFF state of the high pass filter

Raises:
Returns:

ON/OFF state of the high pass filter as bool

property input_mode: Pfa2FilterChannelMode

Get the input mode

OPERATE: Channel is operational CALIBRATION: Channel routed to calibration input SHORT: Channel is shorted to ground

Raises:

Pfa2FilterCommunicationError – When input mode is not set or unknown

Returns:

Input mode as Pfa2FilterChannelMode

property input_overload: bool

Check if the input is overloaded

Raises:

Pfa2FilterCommunicationError – When input overload status is unknown

Returns:

Bool indicating overload

property lpf_freq: int

Get the set 3 dB cut off frequency of the low pass filter

Raises:

Pfa2FilterCommunicationError – When the device does not respond

Returns:

Frequency in Hz

property lpf_mode: Pfa2FilterLPFMode

Get the operation mode of the low pass filter

OFF: Filter is disabled PULSE: For measurements if time domain FLAT: For measurements in frequency domain

Raises:

Pfa2FilterCommunicationError – When LPF mode is not set or unknown

Returns:

LPF filter mode as Pfa2FilterLPFMode

property output_overload: bool

Check if the output is overloaded

Raises:

Pfa2FilterCommunicationError – When output overload is unknown

Returns:

Bool indicating overload

overload_clear() bool[source]

Clear a overload

Raises:

Pfa2FilterCommunicationError – When filter could not be reached

Returns:

True if overload was cleared, False if not, None if in continuous mode

property overload_limit: float

Get the overload limit

Raises:

Pfa2FilterCommunicationError – When overload limit is unknown

Returns:

Overload limit in V

property overload_mode: Pfa2FilterOverloadMode

Get the set overload handling mode

CONTINUOUS: Overload will reset itself LATCHING: Overload must be reset my command or manually at device

Raises:

Pfa2FilterCommunicationError – When overload mode is unknown

Returns:

Overload handling mode

property postgain: Pfa2FilterPostGain

Get the set gain of the post filter amplifier

Raises:

Pfa2FilterCommunicationError – When post filter gain is unknown

Returns:

Gain value from Pfa2FilterPostGain

property pregain: Pfa2FilterPreGain

Get the gain value of the pre-filter amplifier

Raises:

Pfa2FilterCommunicationError – When pre filter gain is unknown

Returns:

Gain value from Pfa2FilterPreGain

class Pfa2Filter(com, dev_config=None)[source]

Bases: SingleCommDevice

Device class to control the PFA-2 filter

static config_cls() type[Pfa2FilterConfig][source]

Return the default configdataclass class.

Returns:

a reference to the default configdataclass class

static default_com_cls() type[Pfa2FilterSerialCommunication][source]

Get the class for the default communication protocol used with this device.

Returns:

the type of the standard communication protocol for this device

start() None[source]

Starting the PFA-2 Filter

stop() None[source]

Stop this device and close the communication protocol.

class Pfa2FilterConfig(device_option_hpf: bool = True, coupling_init: ~hvl_ccb.dev.pfa2_filter.base.Pfa2FilterChannelCoupling | str = <Pfa2FilterChannelCoupling.DC: 'DC'>, mode_init: ~hvl_ccb.dev.pfa2_filter.base.Pfa2FilterChannelMode | str = <Pfa2FilterChannelMode.OPERATE: 'OPERATE'>, pregain_init: ~hvl_ccb.dev.pfa2_filter.base.Pfa2FilterPreGain | float = <Pfa2FilterPreGain.ONE: 1.0>, postgain_init: ~hvl_ccb.dev.pfa2_filter.base.Pfa2FilterPostGain | float = <Pfa2FilterPostGain.ONE: 1.0>, lpf_freq_init: int = 127750, lpf_mode_init: ~hvl_ccb.dev.pfa2_filter.base.Pfa2FilterLPFMode | str = <Pfa2FilterLPFMode.FLAT: 'FLAT'>, hpf_state_init: bool = True, hpf_freq_init: int = 1, overload_limit_init: float = 10, overload_mode_init: ~hvl_ccb.dev.pfa2_filter.base.Pfa2FilterOverloadMode | str = <Pfa2FilterOverloadMode.CONTINUOUS: 'CONTINUOUS'>)[source]

Bases: object

Init configuration of a filter channel.

clean_values()

Cleans and enforces configuration values. Does nothing by default, but may be overridden to add custom configuration value checks.

coupling_init: Pfa2FilterChannelCoupling | str = 'DC'
device_option_hpf: bool = True
force_value(fieldname, value)

Forces a value to a dataclass field despite the class being frozen.

NOTE: you can define post_force_value method with same signature as this method to do extra processing after value has been forced on fieldname.

Parameters:
  • fieldname – name of the field

  • value – value to assign

hpf_freq_init: int = 1
hpf_state_init: bool = True
is_configdataclass = True
classmethod keys() Sequence[str]

Returns a list of all configdataclass fields key-names.

Returns:

a list of strings containing all keys.

lpf_freq_init: int = 127750
lpf_mode_init: Pfa2FilterLPFMode | str = 'FLAT'
mode_init: Pfa2FilterChannelMode | str = 'OPERATE'
classmethod optional_defaults() dict[str, object]

Returns a list of all configdataclass fields, that have a default value assigned and may be optionally specified on instantiation.

Returns:

a list of strings containing all optional keys.

overload_limit_init: float = 10
overload_mode_init: Pfa2FilterOverloadMode | str = 'CONTINUOUS'
postgain_init: Pfa2FilterPostGain | float = 1.0
pregain_init: Pfa2FilterPreGain | float = 1.0
classmethod required_keys() Sequence[str]

Returns a list of all configdataclass fields, that have no default value assigned and need to be specified on instantiation.

Returns:

a list of strings containing all required keys.