Gentec-EO¶
Blu
Power Meter¶
- class instruments.gentec_eo.Blu(filelike)[source]¶
Communicate with Gentec-eo BLU power / energy meter interfaces.
These instruments communicate via USB or via bluetooth. The bluetooth sender / receiver that is provided with the instrument is simply emulating a COM port. This routine cannot pair the device with bluetooth, but once it is paired, it can communicate with the port. Alternatively, you can plug the device into the computer using a USB cable.
Warning
If commands are issued too fast, the device will not answer. Experimentally, a 1 ms delay should be enough to get the device into answering mode. Keep this in mind when issuing many commands at once. No wait time included in this class.
Note
The instrument also has a possiblity to read a continuous data stream. This is currently not implemented here since it would have to be threaded out.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.current_value 3.004 W
- class Scale(value)[source]¶
Available scales for Blu devices.
The following list maps available scales of the Blu devices to the respective indexes. All scales are either in watts or joules, depending if power or energy mode is activated. Furthermore, the maximum value that can be measured determines the name of the scale to be set. Prefixes are given in the
enum
class while the unit is omitted since it depends on the mode the head is in.- max1 = '24'¶
- max10 = '26'¶
- max100 = '28'¶
- max100Mega = '40'¶
- max100kilo = '34'¶
- max100micro = '16'¶
- max100milli = '22'¶
- max100nano = '10'¶
- max100pico = '04'¶
- max10Mega = '38'¶
- max10kilo = '32'¶
- max10micro = '14'¶
- max10milli = '20'¶
- max10nano = '08'¶
- max10pico = '02'¶
- max1Mega = '36'¶
- max1kilo = '30'¶
- max1micro = '12'¶
- max1milli = '18'¶
- max1nano = '06'¶
- max1pico = '00'¶
- max3 = '25'¶
- max30 = '27'¶
- max300 = '29'¶
- max300Mega = '41'¶
- max300kilo = '35'¶
- max300micro = '17'¶
- max300milli = '23'¶
- max300nano = '11'¶
- max300pico = '05'¶
- max30Mega = '39'¶
- max30kilo = '33'¶
- max30micro = '15'¶
- max30milli = '21'¶
- max30nano = '09'¶
- max30pico = '03'¶
- max3Mega = '37'¶
- max3kilo = '31'¶
- max3micro = '13'¶
- max3milli = '19'¶
- max3nano = '07'¶
- max3pico = '01'¶
- confirm_connection()[source]¶
Confirm a connection to the device.
Turns of bluetooth searching by confirming a connection.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.confirm_connection()
- disconnect()[source]¶
Disconnect the device.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.disconnect()
- scale_down()[source]¶
Set scale to next lower level.
Sets the power meter to the next lower scale. If already at the lowest possible scale, no change will be made.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.scale_down()
- scale_up()[source]¶
Set scale to next higher level.
Sets the power meter to the next higher scale. If already at the highest possible scale, no change will be made.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.scale_up()
- property anticipation¶
Get / Set anticipation.
This command is used to enable or disable the anticipation processing when the device is reading from a wattmeter. The anticipation is a software-based acceleration algorithm that provides faster readings using the detector’s calibration.
- Returns:
Is anticipation enabled or not.
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.anticipation True >>> inst.anticipation = False
- property auto_scale¶
Get / Set auto scale on the device.
- Returns:
Status of auto scale enabled feature.
- Return type:
- Raises:
ValueError – The command was not acknowledged by the device.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.auto_scale True >>> inst.auto_scale = False
- property available_scales¶
Get available scales from connected device.
- Returns:
Scales currently available on device.
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.available_scales [<Scale.max100milli: '22'>, <Scale.max300milli: '23'>, <Scale.max1: '24'>, <Scale.max3: '25'>, <Scale.max10: '26'>, <Scale.max30: '27'>, <Scale.max100: '28'>]
- property battery_state¶
Get the charge state of the battery.
- Returns:
Charge state of battery
- Return type:
u.percent
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.battery_state array(100.) * %
- property current_value¶
Get the currently measured value (unitful).
- Returns:
Currently measured value
- Return type:
u.Quantity
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.current_value 3.004 W
- property head_type¶
Get the head type information.
- Returns:
Type of instrument head.
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.head_type 'NIG : 104552, Wattmeter, V1.95'
- property measure_mode¶
Get the current measurement mode.
Potential return values are ‘power’, which inidcates power mode in W and ‘sse’, indicating single shot energy mode in J.
- Returns:
‘power’ if in power mode, ‘sse’ if in single shot energy mode.
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.measure_mode 'power'
- property new_value_ready¶
Get status if a new value is ready.
This command is used to check whether a new value is available from the device. Though optional, its use is recommended when used with single pulse operation.
- Returns:
Is a new value ready?
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.new_value_ready False
- property scale¶
Get / Set measurement scale.
The measurement scales are chosen from the the
Scale
enum class. Scales are either in watts or joules, depending on what state the power meter is currently in.Note
Setting a scale manually will automatically turn of auto scale.
- Returns:
Scale that is currently set.
- Return type:
- Raises:
ValueError – The command was not acknowledged by the device. A scale that is not available might have been selected. Use
available_scales
to display scales that are possible on your device.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.scale = inst.Scale.max3 >>> inst.scale <Scale.max3: '25'>
- property single_shot_energy_mode¶
Get / Set single shot energy mode.
- Returns:
Is single shot energy mode turned on?
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.single_shot_energy_mode False >>> inst.single_shot_energy_mode = True
- property trigger_level¶
Get / Set trigger level when in energy mode.
The trigger level must be between 0.001 and 0.998.
- Returns:
Trigger level (absolute) with respect to the currently set scale
- Return type:
- Raises:
ValueError – Trigger level out of range.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.trigger_level = 0.153 >>> inst.trigger_level 0.153
- property usb_state¶
Get status if USB cable is connected.
- Returns:
Is a USB cable connected?
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.usb_state True
- property user_multiplier¶
Get / Set user multiplier.
- Returns:
User multiplier
- Return type:
u.Quantity
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.user_multiplier = 10 >>> inst.user_multiplier 10.0
- property user_offset¶
Get / Set user offset.
The user offset can be set unitful in watts or joules and set to the device.
- Returns:
User offset
- Return type:
u.Quantity
- Raises:
ValueError – Unit not supported or value for offset is out of range.
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.user_offset = 10 >>> inst.user_offset array(10.) * W
- property version¶
Get device information.
- Returns:
Version and device type
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.version 'Blu firmware Version 1.95'
- property wavelength¶
Get / Set the wavelength.
The wavelength can be set unitful. Specifying zero as a wavelength or providing an out-of-bound value as a parameter restores the default settings, typically 1064nm. If no units are provided, nm are assumed.
- Returns:
Wavelength in nm
- Return type:
u.Quantity
- Example:
>>> import instruments as ik >>> import instruments.units as u >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.wavelength = u.Quantity(527, u.nm) >>> inst.wavelength array(527) * nm
- property zero_offset¶
Get / Set zero offset.
Gets the status if zero offset is enabled. When set to
True
, the device will read the current level immediately for around three seconds and then set the baseline to the averaged value. If activated and set toTrue
again, a new value for the baseline will be established.- Returns:
Is zero offset enabled?
- Return type:
- Example:
>>> import instruments as ik >>> inst = ik.gentec_eo.Blu.open_serial('/dev/ttyACM0') >>> inst.zero_offset True >>> inst.zero_offset = False