pylablib.devices.HighFinesse package¶
Submodules¶
pylablib.devices.HighFinesse.wlm module¶
-
pylablib.devices.HighFinesse.wlm.
muxchannel
(*args, **kwargs)[source]¶ Multiplex the function over its channel argument
-
class
pylablib.devices.HighFinesse.wlm.
TDeviceInfo
(model, serial_number, revision_number, compilation_number)¶ Bases:
tuple
-
compilation_number
¶
-
count
()¶ Return number of occurrences of value.
-
index
()¶ Return first index of value.
Raises ValueError if the value is not present.
-
model
¶
-
revision_number
¶
-
serial_number
¶
-
-
class
pylablib.devices.HighFinesse.wlm.
WLM
(version=None, dll_path=None, app_path=None, autostart=True)[source]¶ Bases:
pylablib.core.devio.interface.IDevice
Generic HighFinesse wavemeter.
Parameters: - version (int) – wavemeter version; if
None
, use any available version - dll_path – path to
wlmData.dll
; ifNone
, use standard locations or search based on the version - app_path – path to the wavemeter server application (looks like
wlm_ws.exe
orwlm_ws7.exe
); ifNone
, try to autodetect, or rely on the server already running - autostart – if
True
, start measurements automatically (if the wavemeter server app is not running, it will launch with the measurements stopped).
-
Error
= <Mock name='mock.HighFinesseError' id='140259570238288'>¶
-
get_device_info
()[source]¶ Get the wavemeter info.
Return tuple
(model, serial_number, revision_number, compilation_number)
.
-
set_read_mode
(mode)[source]¶ Set value read mode, which applies to
get_frequency()
andget_wavelength()
.Can be
"latest"
(always return the latest measurement result; default), or"single"
(if there’s no new measurement since the last call, the result is"noval"
which, depending on the arguments, causes wait, is returned as is, or raises an error).
-
get_read_mode
()[source]¶ Get value read mode, which applies to
get_frequency()
andget_wavelength()
.Can be
"latest"
(always return the latest measurement result; default), or"single"
(if there’s no new measurement since the last call, the result is"noval"
which, depending on the arguments, causes wait, is returned as is, or raises an error).
-
set_default_channel
(channel)[source]¶ Set the default channel (starting from 1) which is used for querying
-
get_frequency
(channel=None, error_on_invalid=True, wait=True, timeout=5.0)[source]¶ Get the wavemeter readings (in Hz) on a given channel.
channel is the measurement channel (starting from 1); if
None
, use the default channel. Iferror_on_invalid==True
, raise an error if the measurement is invalid (e.g., over- or underexposure); otherwise, the method can return"under"
if the meter is underexposed or"over"
is it is overexposed,"badsig"
if there is no calculable signal,"noval"
if there are no values acquired yet, or"nosig"
if there is no signal. Ifwait==True
and the result is"noval"
(e.g., if the read mode is"single"
and no new value has been acquired since the last call), wait for at mosttimeout
until a new value appears; if thetimeout
has passed, use the default behavior (error or"noval"
result).
-
get_wavelength
(channel=None, error_on_invalid=True, wait=True, timeout=5.0)[source]¶ Get the wavemeter readings (in m, and in vacuum).
channel is the measurement channel (starting from 1); if
None
, use the default channel. Iferror_on_invalid==True
, raise an error if the measurement is invalid (e.g., over- or underexposure); otherwise, the method can return"under"
if the meter is underexposed or"over"
is it is overexposed,"badsig"
if there is no calculable signal,"noval"
if there are no values acquired yet, or"nosig"
if there is no signal. Ifwait==True
and the result is"noval"
(e.g., if the read mode is"single"
and no new value has been acquired since the last call), wait for at mosttimeout
until a new value appears; if thetimeout
has passed, use the default behavior (error or"noval"
result).
-
get_exposure_mode
(channel=None)[source]¶ Get the exposure mode (
"manual"
or"auto"
) at the given channel
-
set_exposure_mode
(mode='auto', channel=None)[source]¶ Set the exposure mode (
"manual"
or"auto"
) at the given channel
-
get_exposure
(sensor=1, channel=None)[source]¶ Get the exposure for a given channel and sensor (starting from 1)
-
set_exposure
(exposure, sensor=1, channel=None)[source]¶ Manually set the exposure for a given channel and sensor (starting from 1)
-
get_switcher_mode
()[source]¶ Get the switcher mode (
"off"
for manual switching or"on"
for cycling mode)
-
set_switcher_mode
(mode='on')[source]¶ Set the switcher mode (
"off"
for manual switching or"on"
for cycling mode)
-
set_active_channel
(channel, automode=True)[source]¶ Set the current switcher channel.
Only makes sense in the manual (
"off"
) switcher mode. Ifautomode==True
, switch to this mode automatically.
-
is_switcher_channel_enabled
(channel, automode=True)[source]¶ Check whether the switcher channel enabled.
Only works in the cycling (
"on"
) switcher mode. Ifautomode==True
, switch to this mode automatically.
-
is_switcher_channel_shown
(channel, automode=True)[source]¶ Check whether the switcher channel is shown in the wavemeter control application.
Only works in the cycling (
"on"
) switcher mode. Ifautomode==True
, switch to this mode automatically.
-
enable_switcher_channel
(channel, enable=True, show=None, automode=True)[source]¶ Enable or disable the current switcher channel in the switch mode.
Only works in the cycling (
"on"
) switcher mode. Ifautomode==True
, switch to this mode automatically.
-
get_pulse_mode
()[source]¶ Get the current pulse mode.
Can be
"cw"
(CW laser mode),"int"
(standard single-laser internally triggered mode),"ext"
(single- or double-laser mode with external TTL trigger), or"opt"
(double-laser mode with optical triggering).
-
set_pulse_mode
(mode)[source]¶ Set the current pulse mode.
Can be
"cw"
(CW laser mode),"int"
(standard single-laser internally triggered mode),"ext"
(single- or double-laser mode with external TTL trigger), or"opt"
(double-laser mode with optical triggering).
-
get_measurement_interval
()[source]¶ Set measurement interval (per channel), or
None
if the interval mode is off
-
set_measurement_interval
(interval=None)[source]¶ Set measurement interval (per channel).
None
means that the interval mode is off.
-
calibrate
(source_type, source_frequency, channel=None)[source]¶ Initialize the calibration.
source_type is the calibration source type, which can be
"hene_633"
(HeNe 633nm laser),"hene_1152"
(HeNe 1152nm laser),"hene_free"
(free-running HeNe laser),"nel"
(Ne lamp), or"other"
(other source). source_frequency is the exact source frequency (in Hz) sent through the given channel.
-
get_autocalibration_parameters
()[source]¶ Get up the automatic calibration parameters.
Return tuple
(enable, unit, period)
, whereenable
determines if it is enabled, andunit
andperiod
together specify the calibration period.unit
can be"start"
(once on the measurement start;period
is irrelevant here),"meas"
(once everyperiod
frequency measurements),"min"
(once everyperiod
minutes),"hours"
, or"days"
.
-
setup_autocalibration
(enable=True, unit=None, period=None)[source]¶ Set up the automatic calibration parameters.
enable determines if it is enabled. unit and period together specify the calibration period. unit can be
"start"
(once on the measurement start; period is irrelevant here),"meas"
(once every period frequency measurements),"min"
(once every period minutes),"hours"
, or"days"
. AnyNone
parameters are kept at the present value.
-
class
NoParameterCaller
(device, kind)¶ Bases:
object
Class to simplify calling functions without a parameter
-
apply_settings
(settings)¶ Apply the settings.
settings is the dict
{name: value}
of the device available settings. Non-applicable settings are ignored.
-
get_device_variable
(key)¶ Get the value of a settings, status, or full info parameter
-
get_full_info
(include=0)¶ Get dict
{name: value}
containing full device information (including status and settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
-
get_full_status
(include=0)¶ Get dict
{name: value}
containing the device status (including settings).include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
-
get_settings
(include=0)¶ Get dict
{name: value}
containing all the device settings.include specifies either a list of variables (only these variables are returned), a priority threshold (only values with the priority equal or higher are returned), or
"all"
(all available variables). Since the lowest priority is -10, settinginclude=-10
queries all available variables, which is equivalent toinclude="all"
.
-
set_device_variable
(key, value)¶ Set the value of a settings parameter
- version (int) – wavemeter version; if