bhpy Package
Top-level
Modules
- class bhpy.bh_connect.BHConnect(host=None, port=None)[source]
Bases:
object- IMAGE_TYPES
alias of
Literal[‘1stMoment’, ‘Fit’, ‘Fitted’, ‘TauChannel’]
- class bhpy.bh_connect.CustomTCPServer(server_address, request_handler_class, request_handler_queue, done_queue=None, bind_and_activate=True, all_windows=False, file_name=None)[source]
Bases:
TCPServer
- class bhpy.bh_device_scan_wrapper.BHDeviceScan(dll_path=None)[source]
Bases:
object- version_str = ''
- version_str_buf = <ctypes.c_char_Array_128 object>
- class bhpy.bh_device_scan_wrapper.HardwareScanResult[source]
Bases:
Structure- firmwareVersion
Structure/Union member
- friendlyName
Structure/Union member
- serialNumber
Structure/Union member
- class bhpy.bh_lv_wrapper.LVConnectBDU(dll_path: Path | str | None = None, machine_name: str | None = None, default_timeout_s: int = 3, error_string_buffer_len: int = 512, result_string_buffer_len: int = 512)[source]
Bases:
objectWrapper class for interfacing with a BDU laser via the BDU application.
- - command(command
INSTRUCTIONS | str, command_arg: str = None) -> str
- - close() -> bool
- Properties:
arming
power
frequency
- Read only properties:
firmware_version
emission
serial_number
wavelength
frequencies
connected
Note that reading or writing any property as well as sending any command without an instance of the BDU application will raise a ChildProcessError.
- INSTRUCTIONS
alias of
Literal[‘Armed’, ‘GetArmed’, ‘Power’, ‘GetPower’, ‘Frequ’, ‘GetFreq’, ‘GetFreqStrings’, ‘GetEmissionStatus’, ‘GetSN’, ‘GetWL’, ‘GetFwVersion’, ‘Stop’]
- property arming: bool
Sets/Returns the state of the arming control in the BDU application.
When enabled the laser and the laser power is set to greater than 0.0 the laser might emit light given that external conditions do not prevent the BDU from doing so.
- command(command: Literal['Armed', 'GetArmed', 'Power', 'GetPower', 'Frequ', 'GetFreq', 'GetFreqStrings', 'GetEmissionStatus', 'GetSN', 'GetWL', 'GetFwVersion', 'Stop'] | str, command_arg: str = None) str[source]
Sends a command and optional arguments to the connected BDU application.
This can be used to facilitate functionalities/commands that are not yet wrapped by this library.
As long as the application is still loading the command is blocking.
- property connected: bool
Returns the connection state of a BDU laser and the BDU application.
- property emission: bool
Returns the emission state of the connected BDU.
External factors like laser interlock or external trigger signals can result in a false positive. Meaning the emission state merely indicates the possibility on part of the software for the laser actually emitting light.
- property firmware_version: str
Returns the firmware version string of the connected BDU
- property frequencies: list[str]
Returns the pulse frequency names (if present including CW) of the connected BDU laser as a list of strings.
These names are the possible names that can be used to set the frequency property.
- property frequency: str
Sets/Returns the current pulse frequency of the connected BDU laser.
Raises a ValueError if the given frequency name is not one of the puls frequency names of the connected BDU laser.
- property power: float
Sets/Returns the current laser power of the connected BDU laser in %.
Raises a ValueError if set to something outside of the allowed range from 0.0 to 100.0 [%].
- property serial_number: str | None
Returns the serial number string of the connected BDU.
- property wavelength: float | None
Returns the wavelength of the connected BDU in nm.
- class bhpy.bh_lv_wrapper.LVConnectQC008(dll_path: Path | str | None = None, machine_name: str | None = None, default_timeout_s: int = 3, error_string_buffer_len: int = 512, result_string_buffer_len: int = 512)[source]
Bases:
object- INSTRUCTIONS
alias of
Literal[‘AutoAdjust’, ‘HideAnalysis’, ‘HideCardSettings’, ‘HideCorrelation’, ‘HideDebugInfo’, ‘HideDeltaT’, ‘HideMCS’, ‘LoadAutoSavedSettings’, ‘RepeatMeasurement’, ‘ScanThreshold’, ‘ShowAnalysis’, ‘ShowCardSettings’, ‘ShowCorrelation’, ‘ShowDebugInfo’, ‘ShowDeltaT’, ‘ShowMCS’, ‘StartMeasurement’, ‘StopMeasurement’]
- MEASUREMENT_STATUS
alias of
Literal[‘repeating’, ‘measuring’, ‘noData’, ‘DataAvailable’]
- command(command: Literal['AutoAdjust', 'HideAnalysis', 'HideCardSettings', 'HideCorrelation', 'HideDebugInfo', 'HideDeltaT', 'HideMCS', 'LoadAutoSavedSettings', 'RepeatMeasurement', 'ScanThreshold', 'ShowAnalysis', 'ShowCardSettings', 'ShowCorrelation', 'ShowDebugInfo', 'ShowDeltaT', 'ShowMCS', 'StartMeasurement', 'StopMeasurement'])[source]
- property dll_version: str
- property file_saving_path: Path
- property firmware_version: str
- property gap_events: int
- property initialized: bool
- property measurement_status: Literal['repeating', 'measuring', 'noData', 'DataAvailable']
- property rates: list[int]
- property serial_number: str
- class bhpy.spc_tdc_config.Pms800Conf[source]
Bases:
object- default_path = 'appdirs.user_data_dir/Pms800/Config.json'
- class bhpy.spc_tdc_config.SpcQcX04Conf(config_path: str = 'appdirs.user_data_dir/SpcQcX04/Config.json')[source]
Bases:
object- DELTA_TIME_MODE = 'Δt'
- NEGATIVE_EDGE = '͞ |͟ (falling)'
- POSITIVE_EDGE = '͟ |͞ (rising)'
- POS_NEG_LIST = ['͟ |͞ (rising)', '͞ |͟ (falling)']
- default_path = 'appdirs.user_data_dir/SpcQcX04/Config.json'
- restore_config() None[source]
Resets the Hardware settings.
Settings that require little or no changes after initial setup because they are tied to the measurement system’s components and their assembly, get set to values that are either the hardware defaults or good starting point
- restore_defaults() None[source]
Resets all settings and parameters
Dispatcher call for all different categories of settings and parameters
- class bhpy.spc_tdc_config.SpcQcX08Conf[source]
Bases:
object- default_path = 'appdirs.user_data_dir/SpcQcX08/Config.json'
- class bhpy.spc_tdc_wrapper.Markers[source]
Bases:
TypedDict- frame: bool | Literal['Falling', 'Rising', 0, 1] = 0
- line: bool | Literal['Falling', 'Rising', 0, 1] = 0
- marker3: bool | Literal['Falling', 'Rising', 0, 1] = 0
- pixel: bool | Literal['Falling', 'Rising', 0, 1] = 0
- class bhpy.spc_tdc_wrapper.ModuleInit[source]
Bases:
Structure- device_nr
Structure/Union member
- device_type_str
Structure/Union member
- initialized
Structure/Union member
- serial_nr_str
Structure/Union member
- class bhpy.spc_tdc_wrapper.Pms800(dll_path: Path | str | None = None)[source]
Bases:
__8ChannelDllWrapper,__EventStream32Bit- INPUT_MODES
alias of
Literal[‘Input’, ‘Gated Input’, ‘Calibration Input’, 0, 1, 2]
- property event_count_thresholds
- input_modes = {'Calibration Input': 2, 'Gated Input': 1, 'Input': 0}
- property inputmodes
- modes_input = {0: 'Input', 1: 'Gated Input', 2: 'Calibration Input'}
- class bhpy.spc_tdc_wrapper.SpcQcX04(dll_path: Path | str | None = None)[source]
Bases:
__EventStream32Bit- property cfd_thresholds: list[float]
- property cfd_zero_cross: list[float]
- property channel_delays: list[float]
- property channel_divider
- property dithering_enable
- get_events_from_buffer(buffer: numpy.typing.NDArray.numpy.uint32, max_events, card_number, filter_mtos: bool = False)[source]
- property hardware_collection_timer_expired
- property hardware_fifo_empty
- property hardware_fifo_full
- property marker_polarities
- property marker_status
- property module_is_armed
- property module_is_measuring
- property module_status
- property routing_compensation
- property routing_enables
- property trigger_polarity: Literal['Falling', 'Rising', 0, 1]
- property waiting_for_trigger
- class bhpy.spc_tdc_wrapper.SpcQcX08(dll_path: Path | str | None = None)[source]
Bases:
__8ChannelDllWrapper- INPUT_MODES
alias of
Literal[‘Input’, ‘Calibration Input’, 0, 2]
- get_event_triplets_from_buffer(buffer: numpy.typing.NDArray.numpy.uint32, card_number: int, max_event_triplets: int | None = None) tuple[numpy.typing.NDArray.numpy.uint32, int][source]
- get_event_triplets_from_buffer_to_file(card_number: int, dir_path: str, idx: int, min_event_triplets: int, max_event_triplets: int | None = None, timeout_ms: int = 10000) tuple[str, int][source]
- input_modes = {'Calibration Input': 2, 'Input': 0}
- property inputmodes
- modes_input = {0: 'Input', 2: 'Calibration Input'}
- property sync_channel