pylablib.aux_libs.devices package¶
Submodules¶
pylablib.aux_libs.devices.AgilentElectronics module¶
-
class
pylablib.aux_libs.devices.AgilentElectronics.
AWG33220A
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Agilent AWG33220A Arbitrary Wave Generator.
Also partially works with compatible AWGs such as Agilent 33500, Rigol D1000, etc.
-
get_function
()[source]¶ Get output function.
Can be one of the following:
"sine"
,"square"
,"ramp"
,"pulse"
,"noise"
,"prbs"
,"DC"
,"user"
,"arb"
. Not all functions can be available, depending on the particular model of the generator.
-
set_function
(func)[source]¶ Set output function.
Can be one of the following:
"sine"
,"square"
,"ramp"
,"pulse"
,"noise"
,"prbs"
,"DC"
,"user"
,"arb"
. Not all functions can be available, depending on the particular model of the generator.
-
get_range
()[source]¶ Get output voltage range.
Return tuple
(vmin, vmax)
with the low and high voltage values (i.e.,offset-amplitude
andoffset+amplitude
).
-
set_range
(rng)[source]¶ Set output voltage range.
If span is less than
1E-4
, automatically switch to DC mode.
-
get_duty_cycle
()[source]¶ Get output duty cycle (in percent).
Only applies to
"square"
output function.
-
set_duty_cycle
(dcycle)[source]¶ Set output duty cycle (in percent).
Only applies to
"square"
output function.
-
get_ramp_symmetry
()[source]¶ Get output ramp symmetry (in percent).
Only applies to
"ramp"
output function.
-
-
class
pylablib.aux_libs.devices.AgilentElectronics.
AMP33502A
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Agilent AMP3350A amplifier.
-
class
pylablib.aux_libs.devices.AgilentElectronics.
N9310A
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Agilent N9310A microwave generator.
-
class
pylablib.aux_libs.devices.AgilentElectronics.
HP8712B
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
HP8712B Vector Network Analyzer.
-
class
pylablib.aux_libs.devices.AgilentElectronics.
HP8722D
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
HP8722D Vector Network Analyzer.
-
wait_dev
()[source]¶ Pause execution of the device commands until device overlapped commands (e.g., taking sweeps) are complete.
-
static
parse_trace_data
(data, fmt)[source]¶ Parse the data returned by the device. fmt is
DataFormat
description.The data is assumed to be in a (somewhat) standard SCPI format:
b'#'
, then a single digits
denoting length of the size block, thens
digits denoting length of the data (in bytes) followed by the actual data.
-
pylablib.aux_libs.devices.AgilentLasers module¶
-
class
pylablib.aux_libs.devices.AgilentLasers.
HP8168F
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
HP8168F tunable laser.
pylablib.aux_libs.devices.Altera module¶
Home-built Altera NIOS soft-core device.
pylablib.aux_libs.devices.Andor module¶
-
exception
pylablib.aux_libs.devices.Andor.
AndorError
[source]¶ Bases:
RuntimeError
Generic Andor camera error.
-
exception
pylablib.aux_libs.devices.Andor.
AndorTimeoutError
[source]¶ Bases:
pylablib.aux_libs.devices.Andor.AndorError
Timeout while waiting.
-
exception
pylablib.aux_libs.devices.Andor.
AndorNotSupportedError
[source]¶ Bases:
pylablib.aux_libs.devices.Andor.AndorError
Option not supported.
-
class
pylablib.aux_libs.devices.Andor.
AndorCamera
(idx=0, ini_path='')[source]¶ Bases:
pylablib.core.devio.interface.IDevice
Andor camera.
Caution: the manufacturer DLL is designed such that if the camera is not closed on the program termination, the allocated resources are never released. If this happens, these resources are blocked until the complete OS restart.
Parameters: - idx (int) – camera index (use
get_cameras_number()
to get the total number of connected cameras) - ini_path (str) – path to .ini file, if required by the camera
-
class
ModelData
(controller_model, head_model, serial_number)¶ Bases:
tuple
-
controller_model
¶
-
head_model
¶
-
serial_number
¶
-
-
get_model_data
()[source]¶ Get camera model data.
Return tuple
(controller_mode, head_model, serial_number)
.
-
get_status
()[source]¶ Get camera status.
Return either
"idle"
(no acquisition),"acquiring"
(acquisition in progress) or"temp_cycle"
(temperature cycle in progress).
-
get_capabilities
()[source]¶ Get camera capabilities.
For description of the structure, see Andor SDK manual.
-
get_temperature_status
()[source]¶ Get temperature status.
Can return
"off"
(cooler off),"not_reached"
(cooling in progress),"not_stabilized"
(reached but not stabilized yet),"stabilized"
(completely stabilized) or"drifted"
.
-
set_temperature
(temperature, enable_cooler=True)[source]¶ Change the temperature setpoint.
If
enable_cooler==True
, turn the cooler on automatically.
-
get_all_amp_modes
()[source]¶ Get all available pream modes.
Each preamp mode is characterized by an AD channel index, amplifier index, channel speed (horizontal scan speed) index and preamp gain index. Return list of tuples
(channel, channel_bitdepth, oamp, oamp_kind, hsspeed, hsspeed_MHz, preamp, preamp_gain)
, wherechannel
,oamp
,hsspeed
andpreamp
are indices, whilechannel_bitdepth
,oamp_kind
,hsspeed_MHz
andpreamp_gain
are descriptions.
-
set_amp_mode
(channel=None, oamp=None, hsspeed=None, preamp=None)[source]¶ Setup preamp mode.
Can specify AD channel index, amplifier index, channel speed (horizontal scan speed) index and preamp gain index.
None
(default) means leaving the current value.
-
get_channel_bitdepth
(channel=None)[source]¶ Get channel bit depth corresponding to the given channel index (current by default)
-
get_oamp_desc
(oamp=None)[source]¶ Get output amplifier kind corresponding to the given oamp index (current by default)
-
get_hsspeed_frequency
(hsspeed=None)[source]¶ Get horizontal scan frequency (in Hz) corresponding to the given hsspeed index (current by default)
-
get_preamp_gain
(preamp=None)[source]¶ Get preamp gain corresponding to the given preamp index (current by default)
-
get_vsspeed_period
(vsspeed=None)[source]¶ Get vertical scan period corresponding to the given vsspeed index (current by default)
-
set_EMCCD_gain
(gain, advanced=None)[source]¶ Set EMCCD gain.
Gain goes up to 300 if
advanced==False
or higher ifadvanced==True
(in this mode the sensor can be permanently damaged by strong light).
-
init_speeds
()[source]¶ Initialize the camera channel, frequencies and amp settings to some default mode
-
set_shutter
(mode, ttl_mode=0, open_time=None, close_time=None)[source]¶ Setup shutter.
mode can be
"auto"
,"open"
or"close"
, ttl_mode can be 0 (low is open) or 1 (high is open), open_time and close_time specify opening and closing times (required to calculate the minimal exposure times). By default, these time are minimal allowed times.
-
set_trigger_mode
(mode)[source]¶ Set trigger mode.
Can be
"int"
(internal),"ext"
(external),"ext_start"
(external start),"ext_exp"
(external exposure),"ext_fvb_em"
(external FVB EM),"software"
(software trigger) or"ext_charge_shift"
(external charge shifting).For description, see Andor SDK manual.
-
setup_ext_trigger
(level, invert, term_highZ=True)[source]¶ Setup external trigger (level, inversion, and high-Z termination)
-
set_acquisition_mode
(mode)[source]¶ Set acquisition mode.
Can be
"single"
,"accum"
,"kinetics"
,"fast_kinetics"
or"cont"
(continuous). For description of each mode, see Andor SDK manual and corresponding setup_*_mode functions.
-
setup_accum_mode
(num, cycle_time=0)[source]¶ Setup accum acquisition mode.
num is the number of accumulated frames, cycle_time is the acquisition period (by default the minimal possible based on exposure and transfer time).
-
setup_kinetic_mode
(num, cycle_time=0.0, num_acc=1, cycle_time_acc=0, num_prescan=0)[source]¶ Setup kinetic acquisition mode.
num is the number of kinetic cycles frames, cycle_time is the acquisition period between accum frames, num_accum is the number of accumulated frames, cycle_time_acc is the accum acquisition period, num_prescan is the number of prescans.
-
setup_fast_kinetic_mode
(num, cycle_time_acc=0.0)[source]¶ Setup fast kinetic acquisition mode.
num is the number of accumulated frames, cycle_time is the acquisition period (by default the minimal possible based on exposure and transfer time).
-
setup_cont_mode
(cycle_time=0)[source]¶ Setup continuous acquisition mode.
cycle_time is the acquisition period (by default the minimal possible based on exposure and transfer time).
-
enable_frame_transfer_mode
(enable=True)[source]¶ Enable frame transfer mode.
For description, see Andor SDK manual.
-
class
AcqTimes
(exposure, accum_cycle_time, kinetic_cycle_time)¶ Bases:
tuple
-
accum_cycle_time
¶
-
exposure
¶
-
kinetic_cycle_time
¶
-
-
get_timings
()[source]¶ Get acquisition timing.
Return tuple
(exposure, accum_cycle_time, kinetic_cycle_time)
. In continuous mode, the relevant cycle time iskinetic_cycle_time
.
-
prepare_acquisition
()[source]¶ Prepare acquisition.
Isn’t required (called automatically on acquisition start), but decreases time required for starting acquisition later.
-
start_acquisition
(setup=True)[source]¶ Start acquisition.
If
setup==True
, setup the acquisition parameters before the start (they don’t apply automatically when the mode is changed).
-
get_progress
()[source]¶ Get acquisition progress.
Return tuple
(frames_done, cycles_done)
(these are different in accum or kinetic mode).
-
wait_for_frame
(since='lastwait', timeout=20.0)[source]¶ Wait for a new camera frame.
since specifies what constitutes a new frame. Can be
"lastread"
(wait for a new frame after the last read frame),"lastwait"
(wait for a new frame after lastwait_for_frame()
call), or"now"
(wait for a new frame acquired after this function call). If timeout is exceeded, raiseAndorTimeoutError
.
-
pausing_acquisition
()[source]¶ Context manager which temporarily pauses acquisition during execution of
with
block.Useful for applying certain settings which can’t be changed during the acquisition.
-
set_read_mode
(mode)[source]¶ Set camera read mode.
Can be
"fvb"
(average all image vertically and return it as one row),"single_track"
(read a single row or several rows averaged together),"multi_track"
(read multiple rows or averaged sets of rows),"random_track"
(read several arbitrary lines), or"image"
(read a whole image or its rectangular part).
-
setup_single_track_mode
(center=0, width=1)[source]¶ Setup singe-track read mode.
center and width specify selection of the rows to be averaged together.
-
setup_multi_track_mode
(number=1, height=1, offset=1)[source]¶ Setup multi-track read mode.
number is the number of rows (or row sets) to read, height is number of one row set (1 for a single row), offset is the distance between the row sets.
-
setup_random_track_mode
(tracks=None)[source]¶ Setup random track read mode.
tracks is a list of tuples
(start, stop)
specifying track span (start are inclusive, stop are exclusive, starting from 0)
-
setup_image_mode
(hstart=0, hend=None, vstart=0, vend=None, hbin=1, vbin=1)[source]¶ Setup image read mode.
hstart and hend specify horizontal image extent, vstart and vend specify vertical image extent (start are inclusive, stop are exclusive, starting from 0), hbin and vbin specify binning.
-
set_roi
(hstart=0, hend=None, vstart=0, vend=None, hbin=1, vbin=1)[source]¶ Setup camera ROI.
hstart and hend specify horizontal image extent, vstart and vend specify vertical image extent (start are inclusive, stop are exclusive, starting from 0), hbin and vbin specify binning. By default, all non-supplied parameters take extreme values.
-
get_roi_limits
()[source]¶ Get the minimal and maximal ROI parameters.
Return tuple
(min_roi, max_roi)
, where each element is in turn 6-tuple describing the ROI.
-
get_data_dimensions
(mode=None, params=None)[source]¶ Get readout data dimensions for given read mode and read parameters (current by default)
-
read_newest_image
(peek=False)[source]¶ Read the newest image.
If
peek==True
, return the image but not mark it as read.
-
read_oldest_image
()[source]¶ Read the oldest un-read image in the buffer.
dim specifies image dimensions (by default use dimensions corresponding to the current camera settings).
-
get_new_images_range
()[source]¶ Get the range of the new images.
Return tuple
(first, last)
with images range (inclusive). If no images are available, returnNone
.
- idx (int) – camera index (use
-
pylablib.aux_libs.devices.Andor.
get_cameras_number_SDK3
()[source]¶ Get number of connected Andor cameras
-
class
pylablib.aux_libs.devices.Andor.
AndorSDK3Camera
(idx=0)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
Andor SDK3 camera.
Parameters: idx (int) – camera index (use get_cameras_number_SDK3()
to get the total number of connected cameras)-
get_value
(name, kind='auto', enum_str=True, default='error')[source]¶ Get current value of the given feature.
kind determines feature kind, can be
"int"
,"float"
,"str"
,"bool"
or"enum
”; by default ("auto"
), auto-determine value kind (might not work for newer features). Ifenum_str==True
, return enum values as strings; otherwise, return as indices. Ifdefault=="error"
, raiseAndorError
if the feature is not implemented; otherwise, return default if it is not implemented.
-
set_value
(name, value, kind='auto', not_implemented_error=True)[source]¶ Set current value of the given feature.
kind determines feature kind, can be
"int"
,"float"
,"str"
,"bool"
or"enum
”; by default ("auto"
), auto-determine value kind (might not work for newer features).If
not_implemented_error==True
and the feature is not implemented, raiseAndorError
; otherwise, do nothing.
-
get_value_range
(name, kind='auto', enum_str=True)[source]¶ Get allowed rande of the given value.
kind determines feature kind, can be
"int"
,"float"
,"str"
,"bool"
or"enum
”; by default ("auto"
), auto-determine value kind (might not work for newer features).For
"int"
or"float"
values return tuple(min, max)
(inclusive); for"enum"
return list of possible values (ifenum_str==True
, return list of string values, otherwise return list of indices). For all other value kinds returnNone
.
-
get_all_values
(enum_str=True)[source]¶ Get all readable values.
If
enum_str==True
, return enum values as strings; otherwise, return as indices.
-
class
ModelData
(camera_model, serial_number, firmware_version, software_version)¶ Bases:
tuple
-
camera_model
¶
-
firmware_version
¶
-
serial_number
¶
-
software_version
¶
-
-
get_model_data
(enum_str=True)[source]¶ Get camera model data.
Return tuple
(camera_model, serial_number, firmware_version, software_version)
.
-
get_trigger_mode
()[source]¶ Get trigger mode.
- Can be
"int"
(internal),"ext"
(external),"software"
(software trigger), "ext_start"
(external start), or"ext_exp"
(external exposure).
- Can be
-
set_trigger_mode
(mode)[source]¶ Set trigger mode.
Can be
"int"
(internal),"ext"
(external), or"software"
(software trigger).
-
set_temperature
(temperature, enable_cooler=True)[source]¶ Change the temperature setpoint.
If
enable_cooler==True
, turn the cooler on automatically.
-
class
AcqTimes
(exposure, accum_cycle_time, kinetic_cycle_time)¶ Bases:
tuple
-
accum_cycle_time
¶
-
exposure
¶
-
kinetic_cycle_time
¶
-
-
get_timings
()[source]¶ Get acquisition timing.
Return tuple
(exposure, accum_cycle_time, kinetic_cycle_time)
. In continuous mode, the relevant cycle time iskinetic_cycle_time
.
-
class
BufferManager
(cam)[source]¶ Bases:
object
Buffer manager: stores, constantly reads and re-schedules buffers, keeps track of acquired and read frames, and of buffer overflow events
-
allocate_buffers
(nbuff, size, queued_buffers=None)[source]¶ Allocate and queue buffers.
queued_buffers` specifies number of allocated buffers to keep queued at aagiven time (by default, all of them)
-
-
start_acquisition
(mode='sequence', nframes=None)[source]¶ Start acquisition.
mode can be either
"snap"
(since frame or sequency acquisition) or"sequence"
(continuous acquisition). nframes determines number of frames to acquire in"snap"
mode, or size of the ring buffer in the"sequence"
mode (by default, 100).
-
pausing_acquisition
()[source]¶ Context manager which temporarily pauses acquisition during execution of
with
block.Useful for applying certain settings which can’t be changed during the acquisition.
-
wait_for_frame
(since='lastread', timeout=20.0, period=0.001)[source]¶ Wait for a new camera frame.
since specifies what constitutes a new frame. Can be
"lastread"
(wait for a new frame after the last read frame),"lastwait"
(wait for a new frame after lastwait_for_frame()
call), or"now"
(wait for a new frame acquired after this function call). If timeout is exceeded, raiseAndorTimeoutError
. period specifies camera polling period.
-
create_ring_buffer
(nframes=None)[source]¶ Create and set up a new ring buffer.
If a ring buffer is already allocated, remove it and create a new one. Called automatically on acquisition start, doesn’t usually need to be called explicitly.
-
remove_ring_buffer
()[source]¶ Remove the ring buffer and clean up the memory.
Called automatically on acquisition stop, doesn’t usually need to be called explicitly.
-
get_frame_counter_status
()[source]¶ Get frame counter status.
Return tuple
(acquired, read, missed, buffer_size, buffer_overflows)
with number of acquired frames, read (or skipped) frames, missed frame, and number of buffer overflows.
-
set_roi
(hstart=0, hend=None, vstart=0, vend=None, hbin=1, vbin=1)[source]¶ Set current ROI.
By default, all non-supplied parameters take extreme values. Binning is the same for both axes.
-
get_roi_limits
()[source]¶ Get the minimal and maximal ROI parameters.
Return tuple
(min_roi, max_roi)
, where each element is in turn 6-tuple describing the ROI.
-
get_new_images_range
()[source]¶ Get the range of the new images.
Return tuple
(first, last)
with images range (inclusive). If no images are available, returnNone
.
-
read_multiple_images
(rng=None, return_metadata=False)[source]¶ Read multiple images specified by rng (by default, all un-read images).
If
return_metadata==True
, return raw metadata along with images. Metadata is a dictionary{section: data}
, wheresection
is the section number (usually 1 or 7), anddata
is the corresponding binary data string.
-
pylablib.aux_libs.devices.AndorSDK3_lib module¶
Used by autodoc_mock_imports.
pylablib.aux_libs.devices.AndorShamrock module¶
-
exception
pylablib.aux_libs.devices.AndorShamrock.
ShamrockError
[source]¶ Bases:
RuntimeError
Generic Andor Shamrock error.
-
exception
pylablib.aux_libs.devices.AndorShamrock.
ShamrockNotSupportedError
[source]¶ Bases:
pylablib.aux_libs.devices.AndorShamrock.ShamrockError
Option not supported.
-
pylablib.aux_libs.devices.AndorShamrock.
get_spectrographs_number
()[source]¶ Get number of connected Andor cameras
-
class
pylablib.aux_libs.devices.AndorShamrock.
ShamrockSpectrograph
(idx=0)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
Shaprock spectrograph.
Parameters: idx (int) – spectrograph index (starting from 0; use get_spectrographs_number()
to get the total number of connected spectrogaphs)-
class
OpticalParameters
(focal_length, angular_deviation, focal_tilt)¶ Bases:
tuple
-
angular_deviation
¶
-
focal_length
¶
-
focal_tilt
¶
-
-
get_optical_parameters
()[source]¶ Get device optical parameters.
Return tuple
(focal_length, angular_deviation, focal_tilt)
.
-
set_grating
(grating, force=False)[source]¶ Set current grating (counting from 1)
Call blocks until the grating is exchanged (up to 10-20 seconds). If
force==False
and the current grating index is the same as requested, skip the call; otherwise, call the grating set command regardless (takes about a second in the grating is unchaged).
-
class
GratingInfo
(lines, blaze_wavelength, home, offset)¶ Bases:
tuple
-
blaze_wavelength
¶
-
home
¶
-
lines
¶
-
offset
¶
-
-
get_grating_info
(grating=None)[source]¶ Get info of a given grating (by default, current grating).
Return tuple
(lines, blaze_wavelength, home, offset)
(blazing wavelength is in nm).
-
get_grating_offset
(grating=None)[source]¶ Get grating offset (in steps) for a given grating (by default, current grating)
-
set_grating_offset
(offset, grating=None)[source]¶ Set grating offset (in steps) for a given grating (by default, current grating)
-
get_wavelength_limits
(grating=None)[source]¶ Get wavelength limits (in m) for a given grating (by default, current grating)
-
is_slit_present
(slit)[source]¶ Check if the slit is present.
slit cen be either a slit index (starting from 1), or one of the following:
"input_side"
,"input_direct"
,"output_side"
, or"output_direct"
.
-
get_slit_width
(slit)[source]¶ Get slit width (in m).
slit cen be either a slit index (starting from 1), or one of the following:
"input_side"
,"input_direct"
,"output_side"
, or"output_direct"
.
-
set_slit_width
(slit, width)[source]¶ Set slit width (in m).
slit cen be either a slit index (starting from 1), or one of the following:
"input_side"
,"input_direct"
,"output_side"
, or"output_direct"
.
-
reset_slit
(slit)[source]¶ Reset slit to the default width (10 um).
slit cen be either a slit index (starting from 1), or one of the following:
"input_side"
,"input_direct"
,"output_side"
, or"output_direct"
.
-
is_flipper_present
(flipper)[source]¶ Check if the flipper is present.
flipper cen be either a flipper index (starting from 1), or one of the following:
"input"
, or “output”`.
-
get_flipper_port
(flipper)[source]¶ Get flipper port.
flipper cen be either a flipper index (starting from 1), or one of the following:
"input"
, or “output”`. Return either"direct"
or"side"
.
-
set_flipper_port
(flipper, port)[source]¶ Set flipper port.
flipper cen be either a flipper index (starting from 1), or one of the following:
"input"
, or “output”`. Port can be a numerical value (0 or 1),"direct"
, or"side"
.
-
reset_flipper
(flipper)[source]¶ Reset flipper to the default state.
flipper cen be either a flipper index (starting from 1), or one of the following:
"input"
, or “output”`.
-
set_accessory_state
(line, state)[source]¶ Set current accessory state (0 or 1) on a given line (1 or 2)
-
class
pylablib.aux_libs.devices.AndorShamrock_lib module¶
-
exception
pylablib.aux_libs.devices.AndorShamrock_lib.
ShamrockLibError
(func, code)[source]¶ Bases:
RuntimeError
Generic Andor Shamrock library error
-
pylablib.aux_libs.devices.AndorShamrock_lib.
errcheck
(passing=None)[source]¶ Build an error checking function.
Return a function which checks return codes of Andor Shamrock library functions. passing is a list specifying which return codes are acceptable (by default only 20002, which is success code, is acceptable).
pylablib.aux_libs.devices.Andor_lib module¶
Used by autodoc_mock_imports.
pylablib.aux_libs.devices.Arcus module¶
-
exception
pylablib.aux_libs.devices.Arcus.
ArcusError
[source]¶ Bases:
RuntimeError
Generic Arcus error.
-
class
pylablib.aux_libs.devices.Arcus.
GenericPerformaxStage
(lib_path=None, idx=0)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
Generic Arcus Performax translation stage.
Parameters:
-
class
pylablib.aux_libs.devices.Arcus.
Performax4EXStage
(lib_path=None, idx=0)[source]¶ Bases:
pylablib.aux_libs.devices.Arcus.GenericPerformaxStage
Arcus Performax 4EX translation stage.
Parameters: -
ignore_limit_errors
(do_ignore=True)[source]¶ Switch ignoring limit errors on or off.
If on, limit error on one axis doesn’t stop other axes.
-
is_ignoring_limit_errors
()[source]¶ Check if ignoring limit errors is on.
If on, limit error on one axis doesn’t stop other axes.
-
enable_output
(axis, enable=True)[source]¶ Enable axis output.
If the output is disabled, the steps are generated by the controller, but not sent to the motors.
-
set_position_reference
(axis, position=0)[source]¶ Set the current axis position as a reference.
Re-calibrate the position encoder so that the current position is set as position (0 by default).
-
jog
(axis, direction)[source]¶ Jog a given axis in a given direction.
direction can be either
"-"
(negative) or"+"
(positive). The motion continues until it is explicitly stopped, or unitl a limit is hit.
-
-
pylablib.aux_libs.devices.Arcus.
PerformaxStage
¶
pylablib.aux_libs.devices.Arduino module¶
Home-built Arduino devices.
-
class
pylablib.aux_libs.devices.Arduino.
IArduinoDevice
(port_addr, rate=9600, timeout=10.0, term_write='n', term_read='n')[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Generic Arduino device.
-
class
pylablib.aux_libs.devices.Arduino.
FilterCavityLock
(port_addr)[source]¶ Bases:
pylablib.aux_libs.devices.Arduino.IArduinoDevice
-
lock
(sync=False)[source]¶ Lock the access to the device from other threads/processes (isn’t necessarily implemented).
-
pylablib.aux_libs.devices.Attocube module¶
-
exception
pylablib.aux_libs.devices.Attocube.
AttocubeError
[source]¶ Bases:
RuntimeError
Generic Attocube error
-
class
pylablib.aux_libs.devices.Attocube.
ANC300
(conn, backend='auto', pwd='123456')[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Attocube ANC300 controller.
Parameters: -
update_available_axes
()[source]¶ Update the list of available axes.
Need to call only if the hardware configuration of the ANC module has changed.
-
set_mode
(axis='all', mode='stp')[source]¶ Set axis mode.
axis is either an axis index (starting from 1), or
"all"
(all axes). mode is"gnd"
(ground) or"stp"
(step).
-
get_mode
(axis='all')[source]¶ Get axis mode
axis is either an axis index (starting from 1), or
"all"
(all axes).
-
measure_capacitance
(axis='all', wait=True)[source]¶ Measure axis capacitance; finish in the GND mode.
If
wait==True
, wait until the capacitance measurement is finished (takes about a second per axis).
-
get_capacitance
(axis, measure=False)[source]¶ Get capacitance measurement on the axis.
If
measure==True
, re-measure axis capacitance (takes about a second); otherwise, get the last measurement value.
-
get_all_capacitances
(measure=False)[source]¶ Get the list of all axes capacitances
If
measure==True
, re-measure axes capacitances (takes about a secon0d per axis); otherwise, get the last measurement values.
-
set_all_voltages
(voltages)[source]¶ Get all axes step voltages.
voltages is a list of step voltage, whose length is equal to the number of active (connected) axes.
-
set_all_offsets
(offsets)[source]¶ Get all axes offset voltages
offsets is a list of offset voltags, whose length is equal to the number of active (connected) axes.
-
set_all_frequencies
(frequencies)[source]¶ Get all axes step frequencies
frequencies is a list of step frequencies, whose length is equal to the number of active (connected) axes.
-
set_axis_correction
(axis, factor=1.0)[source]¶ Set axis correction factor.
The factor is automatically applied when the motion is in the negative direction.
-
-
pylablib.aux_libs.devices.Attocube.
ANCDevice
¶
-
class
pylablib.aux_libs.devices.Attocube.
ANC350
(conn=0, timeout=5.0)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Attocube ANC350 controller.
Parameters: - conn – connection parameters - index of the Attocube ANC350 in the system (for a single controller leave 0)
- timeout (float) – default operation timeout
-
class
Telegram
(opcode, address, index, data, corr_number)¶ Bases:
tuple
-
address
¶
-
corr_number
¶
-
data
¶
-
index
¶
-
opcode
¶
-
-
set_value
(address, index, value, ack=False, return_reason=False)[source]¶ Set device value at the given address and index.
If
ack==True
, request ACK responds and return its value; otherwise, return immediately after set. Ifreturn_reason==True
, return tuple(result, reason)
; otherwise, simply return result.
-
get_value
(address, index, as_int=True, return_reason=False)[source]¶ Get device value at the given address and index.
If
as_int==True
, convert the result into a signed integer; otherwise return raw byte string. Ifreturn_reason==True
, return tuple(result, reason)
; otherwise, simply return result.
-
set_all_voltages
(voltages)[source]¶ Get all axes step voltages.
voltages is a list of step voltage, whose length is equal to the number of active (connected) axes.
-
set_all_offsets
(offsets)[source]¶ Get all axes offset voltages
offsets is a list of offset voltags, whose length is equal to the number of active (connected) axes.
-
set_all_frequencies
(frequencies)[source]¶ Get all axes step frequencies
frequencies is a list of step frequencies, whose length is equal to the number of active (connected) axes.
-
is_target_reached
(axis, precision=1e-09)[source]¶ Check if the target position is reached.
Precision sets the final positioning precision (in m).
pylablib.aux_libs.devices.Cryomagnetics module¶
-
class
pylablib.aux_libs.devices.Cryomagnetics.
LM500
(conn)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Cryomagnetics LM500/510 level monitor.
Channels are enumerated from 1. To abort filling or reset a timeout, call
SCPIDevice.reset()
method.Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate) -
get_mode
()[source]¶ Get measurement mode at the current channel (
"S"
for sample/hold,"C"
for continuous)
-
set_mode
(mode)[source]¶ Set measurement mode at the current channel (
"S"
for sample/hold,"C"
for continuous)
-
measure_level
(channel=1)[source]¶ Measure the level (initialize a measurement and return the result) on a given channel
-
pylablib.aux_libs.devices.DCAM module¶
-
exception
pylablib.aux_libs.devices.DCAM.
DCAMError
[source]¶ Bases:
RuntimeError
Generic Hamamatsu camera error.
-
exception
pylablib.aux_libs.devices.DCAM.
DCAMTimeoutError
[source]¶ Bases:
pylablib.aux_libs.devices.DCAM.DCAMError
Timeout while waiting.
-
pylablib.aux_libs.devices.DCAM.
get_cameras_number
()[source]¶ Get number of connected Hamamatsu cameras
-
class
pylablib.aux_libs.devices.DCAM.
DCAMCamera
(idx=0)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
-
class
ModelData
(vendor, model, serial_number, camera_version)¶ Bases:
tuple
-
camera_version
¶
-
model
¶
-
serial_number
¶
-
vendor
¶
-
-
get_model_data
()[source]¶ Get camera model data.
Return tuple
(vendor, model, serial_number, camera_version)
.
-
get_value
(name, error_on_missing=True, default=None)[source]¶ Get value of a property with the given name.
If the value doesn’t exist and
error_on_missing==True
, raiseDCAMError
; otherwise, return default.
-
set_value
(name, value, error_on_missing=True)[source]¶ Set value of a property with the given name.
If the value doesn’t exist and
error_on_missing==True
, raiseDCAMError
; otherwise, do nothing.
-
set_trigger_mode
(mode)[source]¶ Set trigger mode.
Can be
"int"
(internal),"ext"
(external), or"software"
(software trigger).
-
get_trigger_mode
()[source]¶ Get trigger mode.
Can be
"int"
(internal),"ext"
(external), or"software"
(software trigger).
-
class
FrameInfo
(framestamp, timestamp_us, camerastamp, left, top, pixeltype)¶ Bases:
tuple
-
camerastamp
¶
-
framestamp
¶
-
left
¶
-
pixeltype
¶
-
timestamp_us
¶
-
top
¶
-
-
get_frame
(buffer, return_info=False)[source]¶ Get a frame at the given buffer index.
If
return_info==True
, return tuple(data, info)
, where info is theFrameInfo
instance describing frame index and timestamp, camera stamp, frame location on the sensor, and pixel type. Does not advance the read frames counter.
-
get_roi
()[source]¶ Get current ROI.
Return tuple
(hstart, hend, vstart, vend, bin)
(binning is the same for both axes).
-
set_roi
(hstart=0, hend=None, vstart=0, vend=None, bin=1)[source]¶ Set current ROI.
By default, all non-supplied parameters take extreme values. Binning is the same for both axes.
-
get_roi_limits
()[source]¶ Get the minimal and maximal ROI parameters.
Return tuple
(min_roi, max_roi)
, where each element is in turn 5-tuple describing the ROI.
-
start_acquisition
(mode='sequence', nframes=None)[source]¶ Start acquisition.
mode can be either
"snap"
(since frame or sequency acquisition) or"sequence"
(continuous acquisition). nframes determines number of frames to acquire in"snap"
mode, or size of the ring buffer in the"sequence"
mode (by default, 100).
-
pausing_acquisition
()[source]¶ Context manager which temporarily pauses acquisition during execution of
with
block.Useful for applying certain settings which can’t be changed during the acquisition.
-
get_status
()[source]¶ Get acquisition status.
Can be
"busy"
(capturing in progress),"ready"
(ready for capturing),"stable"
(not prepared for capturing),"unstable"
(can’t be prepared for capturing), or"error"
(some other error).
-
get_transfer_info
()[source]¶ Get frame transfer info.
Return tuple
(last_buff, frame_count)
, wherelast_buff
is the index of the last filled buffer, andframe_count
is the total number of acquired frames.
-
get_new_images_range
()[source]¶ Get the range of the new images.
Return tuple
(first, last)
with images range (inclusive). If no images are available, returnNone
. If some images were in the buffer were overwritten, exclude them from the range.
-
read_multiple_images
(rng=None, return_info=False, peek=False)[source]¶ Read multiple images specified by rng (by default, all un-read images).
If
return_info==True
, return tuple(data, info)
, where info is theFrameInfo
instance describing frame index and timestamp, camera stamp, frame location on the sensor, and pixel type. Ifpeek==True
, return images but not mark them as read.
-
wait_for_frame
(since='lastread', timeout=20.0, period=0.001)[source]¶ Wait for a new camera frame.
since specifies what constitutes a new frame. Can be
"lastread"
(wait for a new frame after the last read frame),"lastwait"
(wait for a new frame after lastwait_for_frame()
call), or"now"
(wait for a new frame acquired after this function call). If timeout is exceeded, raiseDCAMTimeoutError
.
-
class
pylablib.aux_libs.devices.DCAM_lib module¶
Used by autodoc_mock_imports.
pylablib.aux_libs.devices.DCAM_lib_const module¶
pylablib.aux_libs.devices.HighFinesse module¶
-
exception
pylablib.aux_libs.devices.HighFinesse.
HFError
[source]¶ Bases:
RuntimeError
Generic HighFinesse wavemeter error
-
class
pylablib.aux_libs.devices.HighFinesse.
WS
(lib_path=None, idx=1, serv_path=None, version=None, hide_app=False, timeout=10.0)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
HighFinesse WS6/7 precision wavemeter.
Parameters: - lib_path (str) – path to the wlmData6.dll or wlmData7.dll (default is to use the library supplied with the package)
- idx (int) – wavemeter input index (starts from 1)
- serv_path – path to server executable (last executed by default)
- version – wavemeter version (3-4 digit id number)
- hide_app – if
True
, start the wavemeter application hidden; otherwise, start it on top
-
get_frequency
(return_exp_error=True)[source]¶ Get the wavemeter readings (in Hz).
If
return_exp_error==True
, return"under"
if the meter is underexposed or"over"
is it is overexposed. Otherwise, raise an error.
-
get_wavelength
(return_exp_error=True)[source]¶ Get the wavemeter readings (in m, and in vacuum).
If
return_exp_error==True
, return"under"
if the meter is underexposed or"over"
is it is overexposed. Otherwise, raise an error.
pylablib.aux_libs.devices.IMAQ module¶
-
exception
pylablib.aux_libs.devices.IMAQ.
IMAQGenericError
[source]¶ Bases:
RuntimeError
Generic IMAQ camera error.
-
exception
pylablib.aux_libs.devices.IMAQ.
IMAQTimeoutError
[source]¶ Bases:
pylablib.aux_libs.devices.IMAQ.IMAQGenericError
Timeout while waiting.
-
pylablib.aux_libs.devices.IMAQ.
list_cameras
()[source]¶ List all cameras available through IMAQ interface
-
class
pylablib.aux_libs.devices.IMAQ.
IMAQCamera
(name='img0')[source]¶ Bases:
pylablib.core.devio.interface.IDevice
Generic IMAQ camera interface.
Parameters: name – interface name (can be learned by list_cameras()
; usually, but not always, starts with"cam"
)-
get_float_value
(attr, default=None)[source]¶ Get value of a floating point attribute with a given name
-
set_roi
(hstart=0, hend=None, vstart=0, vend=None)[source]¶ Setup camera ROI.
By default, all non-supplied parameters take extreme values.
-
get_roi_limits
()[source]¶ Get the minimal and maximal ROI parameters.
Return tuple
(min_roi, max_roi)
, where each element is in turn 4-tuple describing the ROI.
-
configure_trigger_in
(trig_type, trig_line=0, trig_pol='high', action='none', timeout=None)[source]¶ Configure input trigger.
Parameters: - trig_type (str) – trigger source type; can be
"ext"
,"rtsi"
,"iso_in"
, or"software"
- trig_line (int) – trigger line number
- trig_pol (str) – trigger polarity; can be
"high"
or"low"
- action (str) – trigger action; can be
"none"
(disable trigger),"capture"
(start capturing),"stop"
(stop capturing),"buffer"
(capture a single frame), or"bufflist"
(capture the whole buffer list once) - timeout (float) – timeout in seconds;
None
means not timeout.
- trig_type (str) – trigger source type; can be
-
configure_trigger_out
(trig_type, trig_line=0, trig_pol='high', trig_drive='disable')[source]¶ Configure trigger output.
Parameters: - trig_type (str) – trigger drive destination type; can be
"ext"
,"rtsi"
, or"iso_out"
- trig_line (int) – trigger line number
- trig_pol (str) – trigger polarity; can be
"high"
or"low"
- trig_drive (str) – trigger output signal; can be
"disable"
(disable drive),"acq_in_progress"
(asserted when acquisition is started),``”acq_done”`` (asserted when acquisition is done),"unasserted"
(force unasserted level),"asserted"
(force asserted level),"hsync"
(asserted on start of a single line start),"vsync"
(asserted on start of a frame scan),"frame_start"
(asserted when a single frame is captured), or"frame_done"
(asserted when a single frame is done)
- trig_type (str) – trigger drive destination type; can be
-
read_trigger
(trig_type, trig_line=0, trig_pol='high')[source]¶ Read current value of a trigger (input or output).
Parameters:
-
setup_serial_params
(write_term='', datatype='bytes')[source]¶ Setup default serial communication parameters.
Parameters: - write_term – default termintor character to be added to the sent messages
- datatype – type of the result of read commands; can be
"bytes"
(return raw bytes), or"str"
(convert into UTF-8 string)
-
serial_write
(msg, timeout=3.0, term=None)[source]¶ Write message into CameraLink serial port.
Parameters: - timeout – operation timeout (in seconds)
- term – additional write terminator character to add to the message;
if
None
, use the value set up usingsetup_serial_params()
(by default, no additional terminator)
-
serial_read
(n, timeout=3.0, datatype=None)[source]¶ Read specified number of bytes from CameraLink serial port.
Parameters: - n – number of bytes to read
- timeout – operation timeout (in seconds)
- datatype – return datatype; can be
"bytes"
(return raw bytes), or"str"
(convert into UTF-8 string) ifNone
, use the value set up usingsetup_serial_params()
(by default,"bytes"
)
-
serial_readline
(timeout=3.0, datatype=None)[source]¶ Read bytes from CameraLink serial port until the termination character (defined in camera file) is encountered.
Parameters: - timeout – operation timeout (in seconds)
- datatype – return datatype; can be
"bytes"
(return raw bytes), or"str"
(convert into UTF-8 string) ifNone
, use the value set up usingsetup_serial_params()
(by default,"bytes"
)
-
setup_acquisition
(continuous, frames)[source]¶ Setup acquisition mode.
continuous determines whether acquisition runs continuously, or stops after the given number of frames (note that
IMAQCamera.acquisition_in_progress()
would still returnTrue
in this case, even though new frames are no longer acquired). frames sets up number of frame buffers. Ifstart==True
, start acquisition directly after setup.
-
pausing_acquisition
()[source]¶ Context manager which temporarily pauses acquisition during execution of
with
block.Useful for applying certain settings which can’t be changed during the acquisition (e.g., ROI or bit depth).
-
get_buffer_status
()[source]¶ Get buffer fill status.
Return tuple
(unread, lost, size)
, whereunread
is the number of acquired but not read frames,lost
is the number of lost (written over) frames andsize
is the total buffer size (in frames).
-
get_new_images_range
()[source]¶ Get the range of the new images.
Return tuple
(first, last)
with images range (inclusive). If no images are available, returnNone
.
-
wait_for_frame
(since='lastread', timeout=20.0)[source]¶ Wait for a new camera frame.
since specifies what constitutes a new frame. Can be
"lastread"
(wait for a new frame after the last read frame),"lastwait"
(wait for a new frame after lastwait_for_frame()
call), or"now"
(wait for a new frame acquired after this function call). If timeout is exceeded, raiseIMAQLibError
. period specifies camera polling period.
-
read_multiple_images
(rng=None, peek=False, missing_frame='skip')[source]¶ Read multiple images specified by rng (by default, all un-read images).
If
peek==True
, return images but not mark them as read. missing_frame determines what to do with frames which are out of range (missing or lost): can be"none"
(replacing them withNone
),"zero"
(replacing them with zero-filled frame), or"skip"
(skipping them).
-
read_multiple_images_fastbuff
(rng=None)[source]¶ Read multiple images specified by rng (by default, all un-read images).
Some frames in the result are “stuck together” in a single buffer, if their memory locations are continuous. Return list
[(number_of_frames, raw_data)]
, where number_of_frames specifies number of frames in a given array element, and raw_data is the binary string corresponding to these frames (of the sizeself._frame_size*number_returned
). Compared toread_multiple_images()
, always assumespeek==False
andmissing_frame="skip"
(default values). Also, always return frames in"rct"
format (row-first indexing, going from the top).Function exists only to speed up reading of large number of small frames.
-
grab
(n, buff_frames=5000, frame_timeout=20.0, missing_frame='none', return_buffer_status=False)[source]¶ Snap n images (with preset image read mode parameters)
buff_frames determines buffer size. Timeout is specified for a single-frame acquisition, not for the whole acquisition time. missing_frame determines what to do with frames which have been lost: can be
"none"
(replacing them withNone
),"zero"
(replacing them with zero-filled frame), or"skip"
(skipping them, while still keeping total frames number to n).
-
pylablib.aux_libs.devices.IMAQ_lib module¶
Used by autodoc_mock_imports.
pylablib.aux_libs.devices.IMAQ_lib_const module¶
pylablib.aux_libs.devices.IMAQdx module¶
-
class
pylablib.aux_libs.devices.IMAQdx.
IMAQdxAttribute
(sid, name)[source]¶ Bases:
object
Object representing an IMAQdx camera parameter.
Allows to query and set values and get additional information. Usually created automatically by an
IMAQdxCamera
instance, but could be created manually.-
name
¶ attribute name
-
display_name
¶ attribute display name (short description name)
-
tooltip
¶ longer attribute description
-
description
¶ full attribute description (usually, same as tooltip)
-
units
¶ attribute units (if applicable)
-
values
¶ list of possible attribute values (if applicable)
-
-
pylablib.aux_libs.devices.IMAQdx.
list_cameras
(connected=True)[source]¶ List all cameras available through IMAQdx interface
-
class
pylablib.aux_libs.devices.IMAQdx.
IMAQdxCamera
(name='cam0', mode='controller', default_visibility='simple')[source]¶ Bases:
pylablib.core.devio.interface.IDevice
Generic IMAQdx camera interface.
Parameters: - name – interface name (can be learned by
list_cameras()
; usually, but not always, starts with"cam"
) - mode – connection mode; can be
"controller"
(full control) or"listener"
(only reading) - default_visibility – default attribute visibility when listing attributes;
can be
"simple"
,"intermediate"
or"advanced"
(higher mode exposes more attributes).
-
list_attributes
(root='', visibility=None, add_builtin=True)[source]¶ List all attributes at a given root.
Return list of
IMAQdxAttribute
objects, which allow querying and settings values and getting additional information (description, limits, increment).
-
set_value
(name, value, ignore_missing=False, truncate=True)[source]¶ Set value of the attribute with a given name.
If
truncate==True
, truncate value to lie within attribute range.
-
get_all_attributes
(root='', as_dict=False)[source]¶ Get values of all attributes with the given root.
If
as_dict==True
, returndict
object; otherwise, returnDictionary
object.
-
set_all_attributes
(settings, root='', truncate=True)[source]¶ Set values of all attributes with the given root.
If
truncate==True
, truncate value to lie within attribute range.
-
class
ModelData
(vendor, model, serial_number, bus_type)¶ Bases:
tuple
-
bus_type
¶
-
model
¶
-
serial_number
¶
-
vendor
¶
-
-
get_model_data
()[source]¶ Get camera model data.
Return tuple
(vendor, model, serial_number, bus_type)
.
-
set_roi
(hstart=0, hend=None, vstart=0, vend=None)[source]¶ Setup camera ROI.
By default, all non-supplied parameters take extreme values.
-
get_roi_limits
()[source]¶ Get the minimal and maximal ROI parameters.
Return tuple
(min_roi, max_roi)
, where each element is in turn 4-tuple describing the ROI.
-
setup_acquisition
(continuous, frames)[source]¶ Setup acquisition mode.
continuous determines whether acquisition runs continuously, or stops after the given number of frames (note that
IMAQdxCamera.acquisition_in_progress()
would still returnTrue
in this case, even though new frames are no longer acquired). frames sets up number of frame buffers.
-
refresh_acquisition
(delay=0.005)[source]¶ Stop and restart the acquisition, waiting delay seconds in between
-
pausing_acquisition
()[source]¶ Context manager which temporarily pauses acquisition during execution of
with
block.Useful for applying certain settings which can’t be changed during the acquisition.
-
get_new_images_range
()[source]¶ Get the range of the new images.
Return tuple
(first, last)
with images range (inclusive). If no images are available, returnNone
.
-
wait_for_frame
(since='lastread', timeout=20.0, period=0.001)[source]¶ Wait for a new camera frame.
since specifies what constitutes a new frame. Can be
"lastread"
(wait for a new frame after the last read frame),"lastwait"
(wait for a new frame after lastwait_for_frame()
call), or"now"
(wait for a new frame acquired after this function call). If timeout is exceeded, raiseIMAQdxGenericError
. period specifies camera polling period.
- name – interface name (can be learned by
-
class
pylablib.aux_libs.devices.IMAQdx.
IMAQdxPhotonFocusCamera
(name, mode='controller', default_visibility='simple', small_packet_size=True)[source]¶ Bases:
pylablib.aux_libs.devices.IMAQdx.IMAQdxCamera
IMAQdx interface to a PhotonFocus camera.
Parameters: - name – interface name (can be learned by
list_cameras()
; usually, but not always, starts with"cam"
) - mode – connection mode; can be
"controller"
(full control) or"listener"
(only reading) - default_visibility – default attribute visibility when listing attributes;
can be
"simple"
,"intermediate"
or"advanced"
(higher mode exposes more attributes). - small_packet_size – if
True
, automatically set up Ethernet packet size to 1500 bytes.
-
setup_acquisition
(continuous, frames)[source]¶ Setup acquisition mode.
continuous determines whether acquisition runs continuously, or stops after the given number of frames (note that
IMAQdxCamera.acquisition_in_progress()
would still returnTrue
in this case, even though new frames are no longer acquired). frames sets up number of frame buffers.
-
peek_frame
(mode='last', buffer_num=0)[source]¶ Read a frame without marking it as read
mode specifies frame selection mode: can be
"first"
(first available),"last"
(last read), or"number"
(index determined by buffer_num).Return tuple
(frame, buffer_num)
.
-
read_multiple_images
(rng=None, peek=False, skip=False, missing_frame='skip')[source]¶ Read multiple images specified by rng (by default, all un-read images).
If
peek==True
, return images but not mark them as read. Ifskip==True
, mark frames as read but don’t read them (i.e., reading withpeek==True
andskip==True
does nothing). missing_frame determines what to do with frames which are out of range (missing or lost): can be"none"
(replacing them withNone
),"zero"
(replacing them with zero-filled frame), or"skip"
(skipping them).
- name – interface name (can be learned by
pylablib.aux_libs.devices.IMAQdx_lib module¶
Used by autodoc_mock_imports.
pylablib.aux_libs.devices.Janis module¶
Janis Jacob controller (custom hardware, probably not applicable to other devices).
pylablib.aux_libs.devices.Lakeshore module¶
-
class
pylablib.aux_libs.devices.Lakeshore.
Lakeshore218
(conn)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Lakeshore 218 temperature controller.
All channels are enumerated from 0.
Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate) -
get_sensor_type
(group)[source]¶ Get sensort type for a given group (
"A"
or"B"
).For type descriptions, see Lakeshore 218 programming manual.
-
-
class
pylablib.aux_libs.devices.Lakeshore.
Lakeshore370
(conn)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Lakeshore 370 temperature controller.
All channels are enumerated from 0.
Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate) -
setup_channel
(channel=None, mode='V', exc_range=1, res_range=22, autorange=True)[source]¶ Setup a measurement channel (current channel by default).
mode is the excitation mode (
"I"
or"V"
), exc_range is the excitation range, res_range is the resistance range. For range descriptions, see Lakeshore 370 programming manual.
-
setup_heater_openloop
(heater_range, heater_percent, heater_res=100.0)[source]¶ Setup a heater in the open loop mode.
heater_range is the heating range, heater_percent is the excitation percentage within the range, heater_res is the heater resistance (in Ohm). For range descriptions, see Lakeshore 370 programming manual.
-
get_heater_settings_openloop
()[source]¶ Get heater settings in the open loop mode.
Return tuple
(heater_range, heater_percent, heater_res)
, where heater_range is the heating range, heater_percent is the excitation percentage within the range, heater_res is the heater resistance (in Ohm). For range descriptions, see Lakeshore 370 programming manual.
-
pylablib.aux_libs.devices.LaserQuantum module¶
-
class
pylablib.aux_libs.devices.LaserQuantum.
Finesse
(conn)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Laser Quantum Finesse pump laser
Parameters: conn – serial connection parameters (usually port)
pylablib.aux_libs.devices.LighthousePhotonics module¶
-
class
pylablib.aux_libs.devices.LighthousePhotonics.
SproutG
(conn)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Lighthouse Photonics Sprout G laser.
Parameters: conn – serial connection parameters (usually port) -
query
(comm, allowed_resp=None)[source]¶ Send a query to the device and parse the reply.
allowed_resp is a list of valid responses (by default, only
"0"
).
-
get_output_mode
()[source]¶ Get output mode.
Can be
"on"
,"off"
,"idle"
(power standby mode),"calibrate"
,"interlock"
(manual interlock is off),"warmup"
(warmup mode), or"calibration"
(calibration mode).
-
pylablib.aux_libs.devices.M2 module¶
-
exception
pylablib.aux_libs.devices.M2.
M2Error
[source]¶ Bases:
RuntimeError
M2 communication error.
-
class
pylablib.aux_libs.devices.M2.
M2ICE
(addr, port, timeout=5.0, start_link=True, use_websocket=True, only_websocket=False)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
M2 ICE device.
Parameters: - addr (str) – IP address of the ICE device.
- port (int) – port of the ICE device.
- timeout (float) – default timeout of synchronous operations.
- start_link (bool) – if
True
, initialize device link on creation. - use_websocket (bool) – if
True
, use websocket interface (same as used by the web interface) for additional functionality (wavemeter connection, etalon value, improved operation stopping) - only_websocket (bool) – if
True
, only use websocket operations (raises error on most standard methods, mostly used to monitor status).
-
query
(op, params, reply_op='auto', report=False)[source]¶ Send a query using the standard device interface.
reply_op is the name of the reply operation (by default, its the operation name plus
"_reply"
). Ifreport==True
, request completion report (doesn’t apply to all operation).
-
wait_for_report
(op, error_msg=None, timeout=None)[source]¶ Wait for a report for the given operation
error_msg specifies the exception message if the report results in an error.
-
connect_wavemeter
(sync=True)[source]¶ Connect to the wavemeter (if
sync==True
, wait until the connection is established)
-
disconnect_wavemeter
(sync=True)[source]¶ Disconnect from the wavemeter (if
sync==True
, wait until the connection is broken)
-
get_full_web_status
()[source]¶ Get full websocket status.
Return a large dictionary containing all the information available in the web interface.
-
get_full_tuning_status
()[source]¶ Get full fine-tuning status (see M2 ICE manual for
"poll_wave_m"
command)
-
lock_wavemeter
(lock=True, sync=True, error_on_fail=True)[source]¶ Lock or unlock the laser to the wavemeter (if
sync==True
, wait until the operation is complete)
-
tune_wavelength
(wavelength, sync=True, timeout=None)[source]¶ Fine-tune the wavelength.
Only works if the wavemeter is connected. If
sync==True
, wait until the operation is complete (might take from several seconds up to several minutes).
-
check_tuning_report
()[source]¶ Check wavelength fine-tuning report
Return
"success"
or"fail"
if the operation is complete, orNone
if it is still in progress.
-
get_tuning_status
()[source]¶ Get fine-tuning status.
Return either
"idle"
(no tuning or locking),"nolink"
(no wavemeter link),"tuning"
(tuning in progress), or"locked"
(tuned and locked to the wavemeter).
-
tune_wavelength_table
(wavelength, sync=True)[source]¶ Coarse-tune the wavelength.
Only works if the wavemeter is disconnected. If
sync==True
, wait until the operation is complete.
-
get_full_tuning_status_table
()[source]¶ Get full coarse-tuning status (see M2 ICE manual for
"poll_move_wave_t"
command)
-
get_tuning_status_table
()[source]¶ Get coarse-tuning status.
Return either
"done"
(tuning is done),"tuning"
(tuning in progress), or"fail"
(tuning failed).
-
get_wavelength_table
()[source]¶ Get course-tuned wavelength.
Only works if the wavemeter is disconnected.
-
tune_etalon
(perc, sync=True)[source]¶ Tune the etalon to perc percent.
Only works if the wavemeter is disconnected. If
sync==True
, wait until the operation is complete.
-
lock_etalon
(sync=True)[source]¶ Lock the etalon (if
sync==True
, wait until the operation is complete).
-
unlock_etalon
(sync=True)[source]¶ Lock the etalon (if
sync==True
, wait until the operation is complete).
-
get_etalon_lock_status
()[source]¶ Get etalon lock status.
Return either
"off"
(lock is off),"on"
(lock is on),"debug"
(lock in debug condition),"errorr"
(lock had an error),"search"
(lock is searching), or"low"
(lock is off due to low output).
-
tune_reference_cavity
(perc, fine=False, sync=True)[source]¶ Tune the reference cavity to perc percent.
If
fine==True
, adjust fine tuning; otherwise, adjust coarse tuning. Only works if the wavemeter is disconnected. Ifsync==True
, wait until the operation is complete.
-
lock_reference_cavity
(sync=True)[source]¶ Lock the laser to the reference cavity.
If
sync==True
, wait until the operation is complete.
-
unlock_reference_cavity
(sync=True)[source]¶ Unlock the laser from the reference cavity.
If
sync==True
, wait until the operation is complete.
-
get_reference_cavity_lock_status
()[source]¶ Get the reference cavity lock status.
Return either
"off"
(lock is off),"on"
(lock is on),"debug"
(lock in debug condition),"errorr"
(lock had an error),"search"
(lock is searching), or"low"
(lock is off due to low output).
-
tune_laser_resonator
(perc, fine=False, sync=True)[source]¶ Tune the laser cavity to perc percent.
If
fine==True
, adjust fine tuning; otherwise, adjust coarse tuning. Only works if the wavemeter is disconnected. Ifsync==True
, wait until the operation is complete.
-
setup_terascan
(scan_type, scan_range, rate, trunc_rate=True)[source]¶ Setup terascan.
Parameters: - scan_type (str) – scan type. Can be
"medium"
(BRF+etalon, rate from 100 GHz/s to 1 GHz/s),"fine"
(all elements, rate from 20 GHz/s to 1 MHz/s), or"line"
(all elements, rate from 20 GHz/s to 50 kHz/s). - scan_range (tuple) – tuple
(start,stop)
with the scan range (in Hz). - rate (float) – scan rate (in Hz/s).
- trunc_rate (bool) – if
True
, truncate the scan rate to the nearest available rate (otherwise, incorrect rate would raise an error).
- scan_type (str) – scan type. Can be
-
start_terascan
(scan_type, sync=False, sync_done=False)[source]¶ Start terascan.
Scan type can be
"medium"
(BRF+etalon, rate from 100 GHz/s to 1 GHz/s),"fine"
(all elements, rate from 20 GHz/s to 1 MHz/s), or"line"
(all elements, rate from 20 GHz/s to 50 kHz/s). Ifsync==True
, wait until the scan is set up (not until the whole scan is complete). Ifsync_done==True
, wait until the whole scan is complete.
-
enable_terascan_updates
(enable=True, update_period=0)[source]¶ Enable sending periodic terascan updates.
If enabled, laser will send updates in the beginning and in the end of every terascan segment. If
update_period!=0
, it will also send updates everyupdate_period
percents of the segment (this option doesn’t seem to be working currently).
-
check_terascan_update
()[source]¶ Check the latest terascan update.
Return
None
if none are available, or a dictionary{"wavelength":current_wavelength, "operation":op}
, whereop
is"scanning"
(scanning in progress),"stitching"
(stitching in progress),"finished"
(scan is finished), or"repeat"
(segment is repeated).
-
check_terascan_report
()[source]¶ Check report on terascan start.
Return
"success"
or"fail"
if the operation is complete, orNone
if it is still in progress.
-
stop_terascan
(scan_type, sync=False)[source]¶ Stop terascan of the given type.
If
sync==True
, wait until the operation is complete.
-
get_terascan_status
(scan_type, web_status='auto')[source]¶ Get status of a terascan of a given type.
- Return dictionary with 4 items:
"current"
: current laser frequency"range"
: tuple with the fill scan range"status"
: can be"stopped"
(scan is not in progress),"scanning"
(scan is in progress), or"stitching"
(scan is in progress, but currently stitching)"web"
: where scan is running in web interface (some failure modes still report"scanning"
through the usual interface); only available if the laser web connection is on.
-
start_fast_scan
(scan_type, width, time, sync=False, setup_locks=True)[source]¶ Setup and start fast scan.
Parameters: - scan_type (str) – scan type. Can be
"cavity_continuous"
,"cavity_single"
,"cavity_triangular"
,"etalon_continuous"
,"etalon_single"
,"resonator_continuous"
,"resonator_single"
,"resonator_ramp"
,"resonator_triangular"
,"ecd_continuous"
,"ecd_ramp"
, or"fringe_test"
(see ICE manual for details) - width (float) – scan width (in Hz).
- time (float) – scan time/period (in s).
- sync (bool) – if
True
, wait until the scan is set up (not until the whole scan is complete). - setup_locks (bool) – if
True
, automatically setup etalon and reference cavity locks in the appropriate states.
- scan_type (str) – scan type. Can be
-
check_fast_scan_report
()[source]¶ Check fast scan report.
Return
"success"
or"fail"
if the operation is complete, orNone
if it is still in progress.
-
stop_fast_scan
(scan_type, return_to_start=True, sync=False)[source]¶ Stop fast scan of the given type.
If
return_to_start==True
, return to the center frequency after stopping; otherwise, stay at the current instantaneous frequency. Ifsync==True
, wait until the operation is complete.
-
get_fast_scan_status
(scan_type)[source]¶ Get status of a fast scan of a given type.
- Return dictionary with 4 items:
"status"
: can be"stopped"
(scan is not in progress),"scanning"
(scan is in progress)."value"
: current tuner value (in percent).
-
stop_scan_web
(scan_type)[source]¶ Stop scan of the current type (terascan or fine scan) using web interface.
More reliable than native programming interface, but requires activated web interface.
-
stop_all_operation
(repeated=True, attempt=0)[source]¶ Stop all laser operations (tuning and scanning).
More reliable than native programming interface, but requires activated web interface. If
repeated==True
, repeat trying to stop the operations until succeeded (more reliable, but takes more time). ReturnTrue
if the operation is success otherwiseFalse
.
pylablib.aux_libs.devices.MKS module¶
-
class
pylablib.aux_libs.devices.MKS.
MKS9xx
(conn, dev_addr=254, timeout=10.0)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
MKS 9xx series pressure gauge.
Parameters:
pylablib.aux_libs.devices.NI module¶
-
class
pylablib.aux_libs.devices.NI.
NIGPIBSerialDevice
(port_addr, timeout=10.0)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
National Instruments Serial<->GPIB converter.
-
class
pylablib.aux_libs.devices.NI.
NIGPIBSerialBackend
(bridge_conn, dev_addr, timeout=10.0, term_write=None, term_read=None)[source]¶ Bases:
pylablib.core.devio.backend.IDeviceBackend
Device backend for the National Instruments Serial<->GPIB converter.
-
Error
¶ alias of
builtins.object
-
read
(size=None)[source]¶ Read data from the device.
If size is not None, read size bytes (the standard timeout applies); otherwise, read all available data (return immediately).
-
flush_read
()[source]¶ Flush the device output (read all the available data; return the number of bytes read).
-
write
(data, flush=True, read_echo=False)[source]¶ Write data to the device.
If
flush==True
, flush the write buffer. Ifread_echo==True
, wait for read_echo_delay seconds and then performreadline()
(read_echo_lines times).
-
-
class
pylablib.aux_libs.devices.NI.
NIDAQ
(dev_name='dev0', rate=100.0, buffer_size=100000.0, reset=False)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
National Instruments DAQ device interface (wrapper around nidaqmx library).
Simplified interface to NI DAQ devices. Supports voltage, digital, and counter inputs (all synchronized to the same clock), and digital and voltage outputs (asynchronous).
Parameters: -
setup_clock
(rate, src=None)[source]¶ Setup analog input clock (which is the main system clock).
If
src==None
, use internal clock with the given rate; otherwise use src terminal as a clock source (in this case, rate should be higher than the expected source rate).
-
export_clock
(terminal)[source]¶ Export system clock to the given terminal (
None
to disconnect all terminals)Only terminal one can be active at a time.
-
get_export_clock_terminal
()[source]¶ Return terminal which outputs system clock (
None
if none is connected).
-
add_voltage_input
(name, channel, rng=(-10, 10), term_config='default')[source]¶ Add analog voltage input.
Readout is synchronized to the system clock.
Parameters: - name (str) – channel name.
- channel (str) – terminal name (e.g.,
"ai0"
). - rng – voltage range
- term_config – terminal configuration. Can be
"default"
,"rse"
(single-ended, referenced to AI SENSE input),"nrse"
(single-ended, referenced to AI GND),"diff"
(differential) and"pseudodiff"
(see NIDAQ manual for details).
-
add_counter_input
(name, counter, terminal, clk_src='ai/SampleClock', output_format='rate')[source]¶ Add counter input (value is related to the number of counts).
Readout is synchronized to the system clock.
Parameters: - name (str) – channel name.
- counter (str) – on-board counter name (e.g.,
"ctr0"
). - terminal (str) – terminal name (e.g.,
"pfi0"
). - clk_src (str) – source of the counter sampling clock. By default it is the analog input clock, which requires at least one voltage input channel (could be dummy channel) to operate.
- output_format (str) – output format. Can be
"acc"
(return accumulated number of counts since the sampling start),"diff"
(return number of counts passed between the two consecutive sampling points; essentially, a derivative of"acc"
), or"rate"
(return count rate based on the"diff"
samples).
-
add_clock_period_input
(counter, clk_src='ai/SampleClock')[source]¶ Add clock period counter.
Useful when using external sample clock with unknown period. The clock input can be returned during
read()
operation, and it is used to calculate counter inputs in"rate"
mode. Readout is synchronized to the system clock.Parameters:
-
add_digital_input
(name, channel)[source]¶ Add digital input.
Readout is synchronized to the system clock. :param name: channel name. :type name: str :param channel: terminal name (e.g.,
"port0/line12"
). :type channel: str
-
get_input_channels
(include=('ai', 'ci', 'di'))[source]¶ Get names of all input channels (voltage input and counter input).
include specifies which channel types to include into the list (
"ai"
for voltage inputs,"ci"
for counter inputs,"di"
for digital inputs,"cpi"
for clock period channel). The channels order is always fixed: first voltage inputs, then counter inputs, then digital inputs.
-
get_voltage_input_parameters
()[source]¶ Get parameters (names, channels, output ranges, and terminal configurations) of all analog voltage input channels.
-
get_counter_input_parameters
()[source]¶ Get parameters (names, counters, terminals, clock sources, and output formats) of all counter input channels.
-
get_digital_input_parameters
()[source]¶ Get parameters (names and channels) of all digital input channels.
-
get_clock_period_input_parameters
()[source]¶ Get parameters (counter input) of the clock period input channel
-
read
(n=1, flush_read=1, timeout=10.0, include=('ai', 'ci', 'di'))[source]¶ Read n samples. If the task is not running, automatically start before reading and stop after.
Parameters: - n (int) – number of samples to read. If
n==-1
, read all available samples. - flush_read (int) – number of initial samples to skip if the task starts on read.
If counter channels are used, the first sample is usually unreliable, so
flush_read=1
is recommended; however, if exactly n pulses are required at the clock export channel,flush_read=0
is needed. - include (tuple) – specifies which channel types to include into the list
(
"ai"
for voltage inputs,"ci"
for counter inputs,"di"
for digital inputs,"cpi"
for clock period channel).
Returns: numpy array of values arranged according to
get_input_channels()
order with the given include parameter.- n (int) – number of samples to read. If
-
start
(flush_read=0, finite=None)[source]¶ Start the sampling task.
flush_read specifies number of samples to read and discard after start. If finite is not
None
, it specifies finite number of sample to acquire before stopping.If counter channels are used, the first sample is usually unreliable, so
flush_read=1
is recommended; however, if exactly finite pulses are required at the clock export channel,flush_read=0
is needed (the total number of pulses isflush_read+finite
).
-
wait_for_sample
(num=1, timeout=10.0, wait_time=0.001)[source]¶ Wait until at least num samples are available.
If they are not available immediately, loop while checking every wait_time interval until enough samples are accumulated. Return the number of available samples if successful, or 0 if the execution timed out.
-
get_digital_output_parameters
()[source]¶ Get parameters (names and channels) of all digital output channels.
-
set_digital_outputs
(names, values)[source]¶ Set values of one or several digital outputs.
Parameters:
-
get_digital_outputs
(names=None)[source]¶ Get values of one or several digital outputs.
Parameters: names (str or [str] or None) – name or list of names of outputs ( None
means all outputs).Return list of values ordered by names (or by
get_digital_output_channels()
ifnames==None
).
-
add_voltage_output
(name, channel, rng=(-10, 10), initial_value=0.0)[source]¶ Add analog voltage output.
Parameters:
-
get_voltage_output_parameters
()[source]¶ Get parameters (names, channels and output ranges) of all analog voltage output channels.
-
set_voltage_outputs
(names, values)[source]¶ Set values of one or several analog voltage outputs.
Parameters: - names (str or [str]) – name or list of names of outputs.
- values – output value or list values.
These can be single numbers, or arrays if the output clock is setup (see
setup_voltage_output_clock()
). In the latter case it sets up the output waveforms; not that waveforms for all channels must have the same length (a single number signifying a constant output is also allowed) If the analog output is set up to the finite mode (continuous==False
), the finite waveform output happens right away, with the number of samples determined by samps_per_channel parameter ofsetup_voltage_output_clock()
. In this case, if the supplied waveform is shorter than the number of samples, it gets repeated; if it’s longer, it gets cut off.
-
get_voltage_outputs
(names=None)[source]¶ Get values of one or several analog voltage outputs.
Parameters: names (str or [str] or None) – name or list of names of outputs ( None
means all outputs).Return list of values ordered by names (or by
get_voltage_output_channels()
ifnames==None
). For continuous waveforms, return the array containing a single repetition of the waveform. For finite waveforms, repeat the array containing the last outputted waveform.
-
setup_voltage_output_clock
(rate=0, sync_with_ai=False, continuous=True, samps_per_chan=1000)[source]¶ Setup analog output clock configuration.
Parameters: - rate – clock rate; if 0, assume constant voltage output (default)
- sync_with_ai – if
True
, the clock is synchronized to the analog input clock (the main clock); note that in this case output changes only when the analog read task is running - continuous – if
True
, any written waveform gets repeated continuously; otherwise, it outputs written waveform only once, and then latches the output on the last value - samps_per_chan – if
continuous==False
, it determines number of samples to output before stopping
-
pylablib.aux_libs.devices.NuPhoton module¶
pylablib.aux_libs.devices.OZOptics module¶
-
class
pylablib.aux_libs.devices.OZOptics.
OZOpticsDevice
(port_addr, timeout=20.0)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Generic OZOptics device.
-
class
pylablib.aux_libs.devices.OZOptics.
TF100
(port_addr, timeout=20.0)[source]¶ Bases:
pylablib.aux_libs.devices.OZOptics.OZOpticsDevice
OZOptics TF100 tunable filter.
-
class
pylablib.aux_libs.devices.OZOptics.
DD100
(port_addr, timeout=20.0)[source]¶ Bases:
pylablib.aux_libs.devices.OZOptics.OZOpticsDevice
OZOptics DD100 variable attenuator.
-
class
pylablib.aux_libs.devices.OZOptics.
EPC04
(port_addr, timeout=20.0)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
OZOptics EPC04 polarization controller.
pylablib.aux_libs.devices.Olimex module¶
-
class
pylablib.aux_libs.devices.Olimex.
IMCDevice
(port_addr, timeout=20.0)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Generic Olimex ATMega device.
pylablib.aux_libs.devices.Ophir module¶
-
class
pylablib.aux_libs.devices.Ophir.
OphirDevice
(conn)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Generic Ophir device.
Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate)
-
class
pylablib.aux_libs.devices.Ophir.
VegaPowerMeter
(conn)[source]¶ Bases:
pylablib.aux_libs.devices.Ophir.OphirDevice
Ophir Vega power meter.
Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate) -
class
WavelengthInfo
(mode, rng, curr_idx, presets, curr_wavelength)¶ Bases:
tuple
-
curr_idx
¶
-
curr_wavelength
¶
-
mode
¶
-
presets
¶
-
rng
¶
-
-
get_wavelength_info
()[source]¶ Get wavelength setting info.
Return tuple
(mode, rng, curr_idx, presets, curr_wavelength)
, where mode is the measurement mode ("CONTINUOUS"
or"HOLD"
), rng is full wavelength range (in m), curr_idx is the current wavelength preset index, presets is the list of all preset wavelengths (in m), and curr_wavelength is the current measurement wavelength (in m).
-
get_range_info
()[source]¶ Get power range info.
Return tuple
(curr_idx, ranges, curr_range)
, where curr_idx is the current power range index, ranges is the list of ranges (in W) for all indices and curr_range is the current range (in W).
-
get_range_idx
()[source]¶ Get current power range index
Index goes from 0 (highest) to maximal (lowest); auto-ranging is -1.
-
class
pylablib.aux_libs.devices.PCO_SC2 module¶
-
exception
pylablib.aux_libs.devices.PCO_SC2.
PCOSC2Error
[source]¶ Bases:
RuntimeError
Generic PCO SC2 camera error.
-
exception
pylablib.aux_libs.devices.PCO_SC2.
PCOSC2TimeoutError
[source]¶ Bases:
pylablib.aux_libs.devices.PCO_SC2.PCOSC2Error
Timeout while waiting.
-
exception
pylablib.aux_libs.devices.PCO_SC2.
PCOSC2NotSupportedError
[source]¶ Bases:
pylablib.aux_libs.devices.PCO_SC2.PCOSC2Error
Option not supported.
-
pylablib.aux_libs.devices.PCO_SC2.
get_cameras_number
()[source]¶ Get number of connected PCOSC2 cameras
-
pylablib.aux_libs.devices.PCO_SC2.
reset_api
()[source]¶ Reset API.
All cameras must be closed; otherwise, the prompt to reboot will appear.
-
class
pylablib.aux_libs.devices.PCO_SC2.
PCOSC2Camera
(idx=0, reboot_on_fail=True)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
PCO SC2 camera.
Parameters: - idx (int) – camera index (use
get_cameras_number()
to get the total number of connected cameras) - reboot_on_fail (bool) – if
True
and the camera raised an error during initialization (but after opening), reboot the camera and try to connect again useful when the camera is in a broken state (e.g., wrong ROI or pixel clock settings)
-
reboot
(wait=True)[source]¶ Reboot the camera.
If
wait==True
, wait for the recommended time (10 seconds) after reboot for the camera to fully restart; attempt to open the camera before that can lead to an error.
-
update_full_data
()[source]¶ Update internal full camera data settings.
Takes some time (about 50ms), so more specific function are preferrables for specific parameters.
-
class
ModelData
(model, interface, sensor, serial_number)¶ Bases:
tuple
-
interface
¶
-
model
¶
-
sensor
¶
-
serial_number
¶
-
-
get_model_data
()[source]¶ Get camera model data.
Return tuple
(model, interface, sensor, serial_number)
.
-
get_capabilities
()[source]¶ Get camera capabilities.
For description of the capabilities, see PCO SC2 manual.
-
get_status
(full=False)[source]¶ Get camera status.
If
full==True
, return current camera status as a set of enabled status states; otherwise, return tuple(status, warnings, errors)
with additional information about warnings and error.
-
get_temperature
()[source]¶ Get the current camera temperature
Return tuple
(CCD, cam, power)
with temperatures of the sensor, camera, and power supply respectively.
-
get_trigger_mode
()[source]¶ Get current trigger mode (see
set_trigger_mode()
for description)
-
set_trigger_mode
(mode)[source]¶ Set trigger mode.
Can be
"int"
(internal),"soft"
(software),"ext"
(external+software),"ext_exp"
(external exposure),"ext_sync"
(external PLL sync),"ext_exp_fast"
(fast external exposure),"ext_cds"
(external CDS control),"ext_exp_slow"
(slow external exposure)`, or"ext_sync_hdsdi"
(external synchronized SD/HDI).For description, see PCO SDK manual.
-
class
Buffer
(size, metadata_size=0)[source]¶ Bases:
object
Single frame buffer object, which controls setup, cleanup, and synchronization
-
set_frame_time
(frame_time=0, adjust_exposure=False)[source]¶ Set frame time (frame acquisition period).
If the time can’t be achieved even with zero frame delay and
adjust_exposure==True
, try to reduce the exposure to get the desired frame time; otherwise, keep the exposure the same.
-
set_pixel_rate
(rate=None)[source]¶ Set camera pixel rate (in Hz)
The rate is always rounded to the closest available. If rate is
None
, set the maximal possible rate.
-
start_acquisition
(buffn=None)[source]¶ Start camera acquisition.
buffn specifies number of frames in the ring buffer (automatically capped at 32, which is the SDK limit)
-
stop_acquisition
()[source]¶ Stop acquisition.
Clears buffers as well, so any readout after acquisition stop is impossible.
-
wait_for_frame
(since='lastread', timeout=20.0, period=0.001)[source]¶ Wait for a new camera frame.
since specifies what constitutes a new frame. Can be
"lastread"
(wait for a new frame after the last read frame),"lastwait"
(wait for a new frame after lastwait_for_frame()
call), or"now"
(wait for a new frame acquired after this function call). If timeout is exceeded, raisePCOSC2TimeoutError
. period specifies camera polling period.
-
pausing_acquisition
()[source]¶ Context manager which temporarily pauses acquisition during execution of
with
block.Useful for applying certain settings which can’t be changed during the acquisition (any settings except for exposure).
-
set_roi
(hstart=0, hend=None, vstart=0, vend=None, hbin=1, vbin=1)[source]¶ Setup camera ROI.
hstart and hend specify horizontal image extent, vstart and vend specify vertical image extent (start are inclusive, stop are exclusive, starting from 0), hbin and vbin specify binning. By default, all non-supplied parameters take extreme values.
-
get_roi_limits
()[source]¶ Get the minimal and maximal ROI parameters.
Return tuple
(min_roi, max_roi)
, where each element is in turn 6-tuple describing the ROI.
-
get_bit_aligment
()[source]¶ Get data bit alignment
Can be
"LSB"
(normal alignment) or"MSB"
(if camera data is less than 16 bit, it is padded with zeros on the right to match 16 bit).
-
set_bit_aligment
(mode)[source]¶ Get data bit alignment
Can be
"LSB"
(normal alignment) or"MSB"
(if camera data is less than 16 bit, it is padded with zeros on the right to match 16 bit).
-
get_noise_filter_mode
()[source]¶ Get the noise filter mode (for details, see
set_noise_filter_mode()
)
-
set_noise_filter_mode
(mode='on')[source]¶ Set the noise filter mode.
Can be
"off"
,"on"
, or"on_hpc"
(on + hot pixel correction).
-
set_status_line_mode
(binary=True, ascii=False)[source]¶ Set status line mode.
binary determines if the binary line is present (it occupies first 14 pixels of the image). ascii determines if the ascii line is present (it is plane text timestamp, which takes first 8 rows and about 300 columns).
It is recommended to always have binary option on, since it is used to determine frame index for checking if there are any missing frames.
-
get_status_line_mode
()[source]¶ Get status line mode.
Return tuple
(binary, ascii)
(seeset_status_line_mode()
for description)
-
class
TBufferStatus
(unread, size, scheduled, scheduled_max)¶ Bases:
tuple
-
scheduled
¶
-
scheduled_max
¶
-
size
¶
-
unread
¶
-
-
get_new_images_range
()[source]¶ Get the range of the new images.
Return tuple
(first, last)
with images range (inclusive). If no images are available, returnNone
.
-
read_multiple_images
(rng=None, return_info=False)[source]¶ Read multiple images specified by rng (by default, all un-read images).
If
return_info==True
, return tuple(images, info)
, whereimages
is a list of frames, andinfo
is a list of frame info tuples extracted from the binary status line (with only one member, frame index). Note that if the binary status line is not activated, frame info will be an arbitrary noise. Ifreturn_info==False
, just return a list of frames.Fro technical reasons, frames should be read in successively, and every frame can only be read ones. Hence, if rng is specified, it can lead to either skipping unread frames (if rng starts after the first unread frame), or reduced number of frames compared to request (if rng attempts to read non-acquired or already-read frames).
- idx (int) – camera index (use
pylablib.aux_libs.devices.PCO_SC2_lib module¶
Used by autodoc_mock_imports.
pylablib.aux_libs.devices.Pfeiffer module¶
-
exception
pylablib.aux_libs.devices.Pfeiffer.
PfeifferError
[source]¶ Bases:
RuntimeError
Pfiffer devices reading error.
-
class
pylablib.aux_libs.devices.Pfeiffer.
TPG261
(conn)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
TPG 261 series pressure gauge.
Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate)
pylablib.aux_libs.devices.PhotonFocus module¶
-
exception
pylablib.aux_libs.devices.PhotonFocus.
PFGenericError
[source]¶ Bases:
RuntimeError
Generic IMAQ camera error.
-
class
pylablib.aux_libs.devices.PhotonFocus.
PfcamProperty
(port, name)[source]¶ Bases:
object
Object representing a pfcam camera property.
Allows to query and set values and get additional information. Usually created automatically by an
PhotonFocusIMAQCamera
instance, but could be created manually.-
name
¶ attribute name
-
values
¶ list of possible property values (if applicable)
-
get_value
(enum_as_str=True)[source]¶ Get property value.
If
enum_as_str==True
, return enum-style values as strings; otherwise, return corresponding integer values.
-
-
pylablib.aux_libs.devices.PhotonFocus.
query_camera_name
(port)[source]¶ Query cameras name at a given port in pfcam interface
-
pylablib.aux_libs.devices.PhotonFocus.
list_cameras
(supported=False)[source]¶ List all cameras available through pfcam interface
If
supported==True
, only return cameras which support pfcam protocol.
-
class
pylablib.aux_libs.devices.PhotonFocus.
PhotonFocusIMAQCamera
(imaq_name='img0', pfcam_port=0)[source]¶ Bases:
pylablib.aux_libs.devices.IMAQ.IMAQCamera
IMAQ+PFcam interface to a PhotonFocus camera.
Parameters: - imaq_name – IMAQ interface name (can be learned by
IMAQ.list_cameras()
; usually, but not always, starts with"img"
) - pfcam_port – port number for pfcam interface (can be learned by
list_cameras()
; port number is the first element of the camera data tuple)
-
list_properties
(root='')[source]¶ List all properties at a given root.
Return list of
PfcamProperty
objects, which allow querying and settings values and getting additional information (limits, values).
-
set_value
(name, value, ignore_missing=False, truncate=True)[source]¶ Set value of the property with a given name.
If
truncate==True
, truncate value to lie within property range.
-
call_command
(name, arg=0, ignore_missing=False)[source]¶ If property is a command, call it with a given argument; otherwise, raise an error.
-
get_all_properties
(root='', as_dict=False)[source]¶ Get values of all properties with the given root.
If
as_dict==True
, returndict
object; otherwise, returnDictionary
object.
-
set_all_properties
(settings, root='', truncate=True)[source]¶ Set values of all properties with the given root.
If
truncate==True
, truncate value to lie within attribute range.
-
set_roi
(hstart=0, hend=None, vstart=0, vend=None)[source]¶ Setup camera ROI.
By default, all non-supplied parameters take extreme values.
- imaq_name – IMAQ interface name (can be learned by
-
pylablib.aux_libs.devices.PhotonFocus.
get_status_lines
(frames, check_transposed=True)[source]¶ Extract status lines from the given frames.
frames can be 2D array (one frame), 3D array (stack of frames, first index is frame number), or list of array. Automatically check if the status line is present; return
None
if it’s not. Ifcheck_transposed==True
, check for the case where the image is transposed (i.e., line becomes a column).
-
pylablib.aux_libs.devices.PhotonFocus.
get_status_line_position
(frame, check_transposed=True)[source]¶ Check whether status line is present in the frame, and return its location.
Return tuple
(row, transposed)
, where row is the status line row (can be-1
or-2
) and transposed isTrue
if the line is present in the transposed image. If no status line is found, returnNone
. Ifcheck_transposed==True
, check for the case where the image is transposed (i.e., line becomes a column).
-
pylablib.aux_libs.devices.PhotonFocus.
remove_status_line
(frame, sl_pos='calculate', policy='duplicate', copy=True)[source]¶ Remove status line from the frame.
Parameters: - frame – a frame to process (2D or 3D numpy array; if 3D, the first axis is the frame number)
- sl_pos – status line position (returned by
get_status_line_position()
); if equal to"calculate"
, calculate here; for a 3D array, assumed to be the same for all frames - policy – determines way to deal with the status line;
can be
"keep"
(keep as is),"cut"
(cut off the status line row),"zero"
(set it to zero),"median"
(set it to the image median), or"duplicate"
(set it equal to the previous row; default) - copy – if
True
, make copy of the original frames; otherwise, attempt to remove the line in-place
-
pylablib.aux_libs.devices.PhotonFocus.
find_skipped_frames
(lines, step=1)[source]¶ Check if there are skipped frames based on status line reading.
step specifies expected index step between neighboring frames.
Return list
[(idx, skipped)]
, where idx is the index after which skipped frames were skipped.
pylablib.aux_libs.devices.PurePhotonics module¶
-
class
pylablib.aux_libs.devices.PurePhotonics.
CBDX1
(addr, read_echo=True, comm_delay=0.5, mode_wait_time=5.0, offset_wait_time=5.0, connect_on_operation=True)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
CBDX1 controller for the PurePhotonics PPCL200 laser.
pylablib.aux_libs.devices.Rigol module¶
-
class
pylablib.aux_libs.devices.Rigol.
DSA1030A
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Rigol DSA1030A Spectrum Analyzer.
pylablib.aux_libs.devices.Sirah module¶
-
exception
pylablib.aux_libs.devices.Sirah.
SirahError
[source]¶ Bases:
RuntimeError
Generic Sirah error
-
exception
pylablib.aux_libs.devices.Sirah.
SirahTimeoutError
[source]¶ Bases:
pylablib.aux_libs.devices.Sirah.SirahError
Sirah waiting timeout error
-
class
pylablib.aux_libs.devices.Sirah.
SirahInterface
(conn)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Generic Sirah device interface using Visa communication.
Parameters: conn – VISA connection string (something like "USB0::0x17E7::<DEVICE_ID>::<DEVICE_SN>::INSTR"
)
-
class
pylablib.aux_libs.devices.Sirah.
SirahMatisse
(conn)[source]¶ Bases:
pylablib.aux_libs.devices.Sirah.SirahInterface
Sirah Matisse device interface using Visa communication.
Parameters: conn – VISA connection string (something like "USB0::0x17E7::0x0102::<DEVICE_ID>::INSTR"
)-
get_brf_status_n
()[source]¶ Get BRF motor status as an integer
For the meaning, see Matisse Programmer’s Guide
-
pylablib.aux_libs.devices.SmarAct module¶
-
exception
pylablib.aux_libs.devices.SmarAct.
SmarActError
[source]¶ Bases:
RuntimeError
Generic SmarAct error.
-
class
pylablib.aux_libs.devices.SmarAct.
SCU3D
(lib_path=None, idx=0, axis_mapping='xyz', axis_dir='+++')[source]¶ Bases:
pylablib.core.devio.interface.IDevice
SmarAct SCU3D translation stage.
Parameters: - lib_path (str) – path to the SCU3DControl.dll (default is to use the library supplied with the package)
- idx (int) – stage index
- axis_mapping (str) – 3-symbol string specifying indices of x, y and z axes (can be any permutation of
"xyz"
) - axis_dir (str) – 3-symbol string specifying default directions of the axes (each symbol be
"+"
or"-"
)
-
move_macrostep
(axis, steps, voltage, frequency)[source]¶ Move along a given axis with a given number of steps.
voltage (in Volts) and frequency (in Hz) specify the motion parameters.
-
move
(axis, steps=1, stepsize=10)[source]¶ Move along a given axis with a given number of steps using one of the predefined step size.
stepsize can range from 1 (smallest) to 20 (largest).
pylablib.aux_libs.devices.Tektronix module¶
-
class
pylablib.aux_libs.devices.Tektronix.
ITektronixScope
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Generic Tektronix Oscilloscope.
-
class
pylablib.aux_libs.devices.Tektronix.
DPO2014
(addr)[source]¶ Bases:
pylablib.aux_libs.devices.Tektronix.ITektronixScope
Tektronix DPO2014 Oscilloscope.
-
class
pylablib.aux_libs.devices.Tektronix.
TDS2000
(addr)[source]¶ Bases:
pylablib.aux_libs.devices.Tektronix.ITektronixScope
Tektronix TDS2000 Oscilloscope.
-
class
pylablib.aux_libs.devices.Tektronix.
MDO3000
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Tektronix MDO3000 Oscilloscope with the Spectrum Analyzer add-on.
pylablib.aux_libs.devices.Thorlabs module¶
-
class
pylablib.aux_libs.devices.Thorlabs.
PM100D
(addr)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Thorlabs PM100D optical Power Meter.
Parameters: addr – connection address (usually, a VISA connection string)
-
class
pylablib.aux_libs.devices.Thorlabs.
ThorlabsInterface
(conn)[source]¶ Bases:
pylablib.core.devio.SCPI.SCPIDevice
Generic Thorlabs device interface using Serial communication.
Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate)
-
class
pylablib.aux_libs.devices.Thorlabs.
FW
(conn, respect_bound=True)[source]¶ Bases:
pylablib.aux_libs.devices.Thorlabs.ThorlabsInterface
Thorlabs FW102/202 motorized filter wheels.
Parameters: - conn – serial connection parameters (usually port or a tuple containing port and baudrate)
- respect_bound (bool) – if
True
, avoid crossing the boundary between the first and the last position in the wheel
-
class
pylablib.aux_libs.devices.Thorlabs.
MDT69xA
(conn)[source]¶ Bases:
pylablib.aux_libs.devices.Thorlabs.ThorlabsInterface
Thorlabs MDT693/4A high-voltage source.
Uses MDT693A program interface, so should be compatible with both A and B versions.
Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate)
-
exception
pylablib.aux_libs.devices.Thorlabs.
KinesisError
[source]¶ Bases:
RuntimeError
Generic Kinesis device error.
-
exception
pylablib.aux_libs.devices.Thorlabs.
KinesisTimeoutError
[source]¶ Bases:
pylablib.aux_libs.devices.Thorlabs.KinesisError
Kinesis timeout error.
-
pylablib.aux_libs.devices.Thorlabs.
list_kinesis_devices
(filter_ids=True)[source]¶ List all Thorlabs Kinesis devices connected ot this PC.
- Return list of tuples
(conn, description)
. - If
filter_ids==True
, only leave devices with Tholabs-like IDs (8-digit numbers). Otherwise, show all devices (some of them might not be Thorlabs-related).
- Return list of tuples
-
class
pylablib.aux_libs.devices.Thorlabs.
KinesisDevice
(conn, timeout=3.0)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Generic Kinesis device.
Implements FTDI chip connectivity via pyft232 (virtual serial interface).
Parameters: conn – serial connection parameters (usually 8-digit device serial number). -
static
list_devices
(filter_ids=True)[source]¶ List all connected devices.
Return list of tuples
(conn, description)
. Iffilter_ids==True
, only leave devices with Tholabs-like IDs (8-digit numbers). Otherwise, show all devices (some of them might not be Thorlabs-related).
-
send_comm_nodata
(messageID, param1=0, param2=0, source=1, dest=80)[source]¶ Send a message with no associated data.
For details, see APT communications protocol.
-
send_comm_data
(messageID, data, source=1, dest=80)[source]¶ Send a message with associated data.
For details, see APT communications protocol.
-
class
CommNoData
(messageID, param1, param2, source, dest)¶ Bases:
tuple
-
dest
¶
-
messageID
¶
-
param1
¶
-
param2
¶
-
source
¶
-
-
recv_comm
()[source]¶ Receive a message.
Return either
CommNoData
orCommData
depending on the message type (fixed length with two parameters, or variable length with associated data). For details, see APT communications protocol.
-
recv_comm_nodata
()[source]¶ Receive a fixed-length message with two parameters and no associated data.
If the next message is variable-length, raise error. For details, see APT communications protocol.
-
recv_comm_data
()[source]¶ Receive a variable-length message with associated data.
If the next message is fixed-length, raise error. For details, see APT communications protocol.
-
add_background_comm
(messageID)[source]¶ Mark given messageID as a ‘background’ message, which can be sent at any point without prompt (e.g., some operation confirmation).
If it is received instead during
recv_comm_
operations, it is ignored, and the corresponding counter is increased.
-
check_background_comm
(messageID)[source]¶ Return message counter and the last message value (
None
if not message received yet) of a given ‘background’ message.
-
static
-
class
pylablib.aux_libs.devices.Thorlabs.
MFF
(conn)[source]¶ Bases:
pylablib.aux_libs.devices.Thorlabs.KinesisDevice
MFF (Motorized Filter Flip Mount) device.
Implements FTDI chip connectivity via pyft232 (virtual serial interface).
Parameters: conn – serial connection parameters (usually 8-digit device serial number).
-
class
pylablib.aux_libs.devices.Thorlabs.
KDC101
(conn)[source]¶ Bases:
pylablib.aux_libs.devices.Thorlabs.KinesisDevice
Thorlabs KDC101 DC servo motor controller.
Implements FTDI chip connectivity via pyft232 (virtual serial interface).
Parameters: conn (str) – serial connection parameters (usually 8-digit device serial number). -
get_status_n
()[source]¶ Get numerical status of the device.
For details, see APT communications protocol.
-
status_bits
= [(1, 'sw_bk_lim'), (2, 'sw_fw_lim'), (16, 'moving_bk'), (32, 'moving_fw'), (64, 'jogging_bk'), (128, 'jogging_fw'), (512, 'homing'), (1024, 'homed'), (4096, 'tracking'), (8192, 'settled'), (16384, 'motion_error'), (16777216, 'current_limit'), (2147483648, 'enabled')]¶
-
get_status
()[source]¶ Get device status.
Return list of status strings, which can include
"sw_fw_lim"
(forward limit switch reached),``”sw_bk_lim”`` (backward limit switch reached),"moving_fw"
(moving forward),"moving_bk"
(moving backward),"homing"
(homing),"homed"
(homing done),"tracking"
,"settled"
,"motion_error"
(excessive position error),"current_limit"
(motor current limit exceeded), or"enabled"
(motor is enabled).
-
wait_for_status
(status, enabled, timeout=None, period=0.05)[source]¶ Wait until the given status (or list of status bits) is in the desired state.
status is a string or a list of strings describing the status bits to monitor; for possible values, see
get_status()
. Ifenabled==True
, wait until one of the given statuses is enabled; otherwise, wait until all given statuses are disabled. period specifies status checking period (in s).
-
home
(sync=True, force=False, timeout=None)[source]¶ Home the device.
If
sync==True
, wait until homing is done (with the given timeout). Ifforce==False
, only home if the device isn’t homed already.
-
get_velocity_params
(scale=True)[source]¶ Get current velocity parameters
(max_velocity, acceleration)
If
scale==True
, return these in counts/sec and counts/sec^2 respectively; otherwise, return in internal units.
-
set_velocity_params
(max_velocity, acceleration=None)[source]¶ Set current velocity parameters.
The parameters are given in counts/sec and counts/sec^2 respectively (as returned by
get_velocity_params()
withscale=True
). If acceleration isNone
, use current value.
-
set_position_reference
(position=0)[source]¶ Set position reference (actual motor position stays the same)
-
-
class
pylablib.aux_libs.devices.Thorlabs.
K10CR1
(conn)[source]¶ Bases:
pylablib.aux_libs.devices.Thorlabs.KinesisDevice
Thorlabs K10CR1 rotation stage.
Implements FTDI chip connectivity via pyft232 (virtual serial interface).
Parameters: conn (str) – serial connection parameters (usually 8-digit device serial number). -
get_status_n
()[source]¶ Get numerical status of the device.
For details, see APT communications protocol.
-
status_bits
= [(1, 'sw_bk_lim'), (2, 'sw_fw_lim'), (16, 'moving_bk'), (32, 'moving_fw'), (64, 'jogging_bk'), (128, 'jogging_fw'), (512, 'homing'), (1024, 'homed'), (4096, 'tracking'), (8192, 'settled'), (16384, 'motion_error'), (16777216, 'current_limit'), (2147483648, 'enabled')]¶
-
get_status
()[source]¶ Get device status.
Return list of status strings, which can include
"sw_fw_lim"
(forward limit switch reached),``”sw_bk_lim”`` (backward limit switch reached),"moving_fw"
(moving forward),"moving_bk"
(moving backward),"homing"
(homing),"homed"
(homing done),"tracking"
,"settled"
,"motion_error"
(excessive position error),"current_limit"
(motor current limit exceeded), or"enabled"
(motor is enabled).
-
wait_for_status
(status, enabled, timeout=None, period=0.05)[source]¶ Wait until the given status (or list of status bits) is in the desired state.
status is a string or a list of strings describing the status bits to monitor; for possible values, see
get_status()
. Ifenabled==True
, wait until one of the given statuses is enabled; otherwise, wait until all given statuses are disabled. period specifies status checking period (in s).
-
home
(sync=True, force=False, timeout=None)[source]¶ Home the device.
If
sync==True
, wait until homing is done (with the given timeout). Ifforce==False
, only home if the device isn’t homed already.
-
get_velocity_params
(scale=True)[source]¶ Get current velocity parameters
(max_velocity, acceleration)
If
scale==True
, return these in degree/sec and degree/sec^2 respectively; otherwise, return in internal units.
-
set_velocity_params
(max_velocity, acceleration=None)[source]¶ Set current velocity parameters.
The parameters are given in counts/sec and counts/sec^2 respectively (as returned by
get_velocity_params()
withscale=True
). If acceleration isNone
, use current value.
-
set_position_reference
(position=0)[source]¶ Set position reference (actual motor position stays the same)
-
pylablib.aux_libs.devices.Trinamic module¶
-
exception
pylablib.aux_libs.devices.Trinamic.
TrinamicError
[source]¶ Bases:
RuntimeError
Generic Trinamic error.
-
class
pylablib.aux_libs.devices.Trinamic.
TMCM1100
(conn)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Trinamic stepper motor controller.
Parameters: conn – serial connection parameters (usually port or a tuple containing port and baudrate) -
query
(comm, comm_type, value, result_format='i4', bank=0, addr=0)[source]¶ Send a query to the stage and return the reply.
For details, see TMCM-1110 firmware manual.
-
set_axis_parameter
(parameter, value, addr=0)[source]¶ Set a given axis parameter (volatile; resets on power cycling)
-
store_axis_parameter
(parameter, value=None, addr=0)[source]¶ Store a given axis parameter in EEPROM (by default, value is the current value)
-
get_global_parameter
(parameter, result_format='i4', bank=0, addr=0)[source]¶ Get a given global parameter
-
pylablib.aux_libs.devices.UBNT module¶
The MIT License (MIT)
Copyright (c) 2014 Andrew Rodgers
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
class
pylablib.aux_libs.devices.UBNT.
MfiDevice
(url, user, passwd, cache_timeout=2)[source]¶ Bases:
object
Base class for all mFi devices
-
class
pylablib.aux_libs.devices.UBNT.
MPower
(url, user, passwd, cache_timeout=2)[source]¶ Bases:
pylablib.aux_libs.devices.UBNT.MfiDevice
Provides an interface to a single mPower Device
-
class
pylablib.aux_libs.devices.UBNT.
MPort
(url, user, passwd, cache_timeout=2)[source]¶ Bases:
pylablib.aux_libs.devices.UBNT.MfiDevice
Provides an API to a single mPort Device
pylablib.aux_libs.devices.Vaunix module¶
-
class
pylablib.aux_libs.devices.Vaunix.
IVaunixDevice
(product_id=None, idx=0)[source]¶ Bases:
pylablib.core.devio.backend.IBackendWrapper
Generic Vaunix device.
-
class
pylablib.aux_libs.devices.Vaunix.
LMS
(product_id=None, idx=0)[source]¶ Bases:
pylablib.aux_libs.devices.Vaunix.IVaunixDevice
Vaunix LMS (LabBrick) microwave generator.
pylablib.aux_libs.devices.ZurichInstruments module¶
-
pylablib.aux_libs.devices.ZurichInstruments.
normalize_time
(trace, normalization='full', clockbase=210000000.0)[source]¶
-
pylablib.aux_libs.devices.ZurichInstruments.
trace_filter_compensate
(trace, order, timeconst, truncate=True)[source]¶
-
class
pylablib.aux_libs.devices.ZurichInstruments.
Demod
(n, dev)[source]¶ Bases:
object
-
class
pylablib.aux_libs.devices.ZurichInstruments.
ZIDevice
(dev_id=None, port=8005, api_level=1)[source]¶ Bases:
object
Generic Zurich Instruments device.
-
get_settings
(path='', rel_paths=True, raw=False)¶
-
apply_settings
(branch, path='')¶
-
read_demods
(trace_length, demods=None, save_frequencies_for=None, buffer_size=None, sanitize_data=True, consistent_length=False)[source]¶
-
read_demods_poll
(trace_length, demods=None, save_frequencies_for=None, sanitize_data=True, consistent_length=False)[source]¶
-
-
class
pylablib.aux_libs.devices.ZurichInstruments.
HF2Device
(dev_id=None, port=8005)[source]¶ Bases:
pylablib.aux_libs.devices.ZurichInstruments.ZIDevice
Zurich Instruments HF2 device.
-
class
pylablib.aux_libs.devices.ZurichInstruments.
UHFDevice
(dev_id=None, port=8004)[source]¶ Bases:
pylablib.aux_libs.devices.ZurichInstruments.ZIDevice
Zurich Instruments UHF device.
pylablib.aux_libs.devices.device_manager module¶
pylablib.aux_libs.devices.interfaces module¶
pylablib.aux_libs.devices.misc module¶
-
pylablib.aux_libs.devices.misc.
get_default_lib_folder
(absolute=True)[source]¶ Get default DLL folder withing the package, depending on the Python bitness
If
absolute==True
, get absolute path (including pyLabLib folder); otherwise, get subfolder within pyLabLib folder.
-
pylablib.aux_libs.devices.misc.
get_os_lib_folder
()[source]¶ Get default Windows DLL folder (
System32
orSysWOW64
, depending on Python and Windows bitness)
-
pylablib.aux_libs.devices.misc.
load_lib
(name, locations=('global', ), call_conv='cdecl', locally=False, error_message=None, check_order='location')[source]¶ Load DLL.
Parameters: - name – name or path of the library (can also be a list or a tuple with several names, which are tried in that order).
- locations – list or tuple of locations to search for a library; the function tries locations in order and returns the first successfully loaded library
a location is a string which can be a path to the containing folder,
"local"
(local package path given byget_default_lib_folder()
), or"global"
(load path as is; also searches in the standard OS specified locations determined byPATH
variable, e.g.,System32
folder) - locally (bool) – if
True
, change local path to allow loading of dependent DLLs - call_conv (str) – DLL call convention; can be either
"cdecl"
(corresponds toctypes.cdll
) or"stdcall"
(corresponds toctypes.windll
) - error_message (str) – error message to add in addition to the default error message shown when the DLL is not found
- check_order (str) – determines the order in which possible combinations of names and locations are looped over;
can be
"location"
(loop over locations, and for each location loop over names),"name"
(loop over names, and for each name loop over locations), or a list of tuples[(loc,name)]
specifying order of checking (in the latter case, name and location arguments are ignored, except for generating error mesage).
pylablib.aux_libs.devices.pfcam_lib module¶
Used by autodoc_mock_imports.