PowerMeterAgilent8164B

class PowerMeterAgilent8164B(gpib_num=None, gpib_dev_num=None, sensor_num=1, channel_num=1, power_unit='W')[source]

Bases: agilentlightwave._agilent_lightwave_connection.AgilentLightwaveConnection, agilentlightwave._power_meter.PowerMeter

Driver for the Agilent 8164B power meter module that can read power and set the wavelength as well as specify in what units the Agilent 8164B should operate in.

Parameters:
  • gpib_num (int) – The number of the GPIB bus the power meter is sitting on.
  • gpib_dev_num (int) – The device number that the power meter is on the aforementioned bus.
  • channel_num (int) – Either 1 or 2 depending on which power metre channel to use.
  • power_unit (str) – Either ‘W’ or ‘dBm’ depending on whether the power units should be displayed in [W] or [dBm] on the Agielent 8164B’s screen.

Methods Summary

dbm_to_watts(power_dbm) Converts [dBm] to [W].
get_analogue_current_A(analogue_voltage_V) Get the detector photocurrent [A].
get_analogue_power_W(analogue_voltage_V) Calculates the power of the power meter based on the analogue voltage value read.
get_auto_range() Checks what the auto-range is set to.
get_averaging_time_s()
get_power_W([average, read_period_ms]) Read the power meter.
get_power_dbm([average, read_period_ms])
get_power_mW([average, read_period_ms])
get_power_meter_range()
get_power_nW([average, read_period_ms])
get_power_pW([average, read_period_ms])
get_power_uW([average, read_period_ms])
get_range_dbm()
get_responsivity_A_W() Returns the responsivity [A/W] of the detector.
get_unit() Gets the units the power meter is set to display.
get_wavelength_m() Gets the wavelength the power meter is set to read.
get_wavelength_mm()
get_wavelength_nm()
get_wavelength_um()
set_auto_range() Turns on auto-range.
set_averaging_time_s(averaging_time_s)
set_power_meter_range(max_power_dbm) Set the power meter range, range in dBm
set_range_dbm(range_dbm)
set_unit(unit) Sets the units the power meter will display on screen.
set_wavelength_m(wavelength_m) Sets the wavelength the power meter is set to read.
set_wavelength_nm(wavelength_nm)
set_wavelength_um(wavelength_um)
unset_auto_range() Turns off auto-range.
watts_to_dbm(power_W) Converts [W] to [dBm].

Methods Documentation

static dbm_to_watts(power_dbm)

Converts [dBm] to [W].

Parameters:power_dbm (int, float) – Power in [dBm].
Returns:Power in [W].
Return type:float
get_analogue_current_A(analogue_voltage_V)[source]

Get the detector photocurrent [A]. This should be directly propertional to the detector analogue voltage [V] output.

Parameters:analogue_voltage_V (float, np.array) – Analogue voltage [V] representing the current.
Returns:Analogue current [A] corresponding to the given analogue voltage [V].
Return type:float, np.array
get_analogue_power_W(analogue_voltage_V)

Calculates the power of the power meter based on the analogue voltage value read. The analogue voltage should be directly related to the current.

Parameters:analogue_voltage_V (float, np.array) – Analogue voltage [V] representing the current.
Returns:
The power [W] corresponding to the
given analogue voltage [V].
Return type:float, np.array
get_auto_range()[source]

Checks what the auto-range is set to.

Returns:
1 if auto-range is switched on and
0 if auto-range is switched off.
Return type:bool
get_averaging_time_s()[source]
get_power_W(average=1, read_period_ms=250.0)

Read the power meter.

Parameters:
  • average (int) – How many power readings should be averaged over before returning a power.
  • read_period_ms (int, float) – The time to wait between power readings. Only makes sense if average > 1.
Returns:

The, perhaps averaged, power reading.

Return type:

float

get_power_dbm(average=1, read_period_ms=None)
get_power_mW(average=1, read_period_ms=None)
get_power_meter_range()[source]
get_power_nW(average=1, read_period_ms=None)
get_power_pW(average=1, read_period_ms=None)
get_power_uW(average=1, read_period_ms=None)
get_range_dbm()[source]
get_responsivity_A_W()[source]

Returns the responsivity [A/W] of the detector.

Returns:Responsivity [A/W] of the detector.
Return type:float
get_unit()[source]

Gets the units the power meter is set to display.

Returns:
The unit the power meter is set to display.
Either ‘W’ or ‘dBm’
Return type:str
get_wavelength_m()[source]

Gets the wavelength the power meter is set to read.

Returns:The wavelength in [m] the power meter is operating in.
Return type:float
get_wavelength_mm()
get_wavelength_nm()
get_wavelength_um()
set_auto_range()[source]

Turns on auto-range.

Returns:
1 if auto-range is switched on and
0 if auto-range is switched off.
Return type:bool
set_averaging_time_s(averaging_time_s)[source]
set_power_meter_range(max_power_dbm)[source]

Set the power meter range, range in dBm

set_range_dbm(range_dbm)[source]
set_unit(unit)[source]

Sets the units the power meter will display on screen.

Parameters:unit (str) – Either ‘W’ or ‘dBm’ depending on whether the power units should be displayed in [W] or [dBm] on the Agielent 8164B’s screen.
Returns:
The unit the power meter is set to display.
Either ‘W’ or ‘dBm’
Return type:str
set_wavelength_m(wavelength_m)[source]

Sets the wavelength the power meter is set to read.

Parameters:wavelength_m (int, float) – The wavelength in [m] to set the power meter to.
Returns:
The wavelength the power meter is operating
in.
Return type:float
set_wavelength_nm(wavelength_nm)
set_wavelength_um(wavelength_um)
unset_auto_range()[source]

Turns off auto-range.

Returns:
1 if auto-range is switched on and
0 if auto-range is switched off.
Return type:bool
static watts_to_dbm(power_W)

Converts [W] to [dBm].

Parameters:power_W (int, float) – Power in [W].
Returns:Power in [dBm].
Return type:float