PM100D module
Created on Thu Dec 2 08:27:01 2021
@author: MartinMihaylov
- class Instruments_Libraries.PM100D.PM100D(resource_str, visa_library='@py', **kwargs)[source]
Bases:
BaseInstrumentThorlabs PM100-series power meter wrapper using PyVISA.
- You can construct either with:
resource_str=”P00XXXXX” # serial only (legacy behavior)
resource_str=”USB0::…::INSTR” # full VISA resource (also works)
- Parameters:
resource_str (str | None) – Either the device serial (e.g., ‘P00XXXXX’) or a full VISA string. Kept for backward compatibility.
visa_library (str) – Optional PyVISA backend string, e.g., ‘@py’ for pyvisa-py.
- adjust_current_range()[source]
Legacy function. Do not use. Adjust the Current Measurement interactively.
- adjust_energy_meas()[source]
Legacy function. Do not use. Adjust the Energy Measurement interactively.
- adjust_power_meas()[source]
Legacy function. Do not use. Adjust the power measurement interactively.
- Return type:
None
- adjust_voltage_range()[source]
Legacy function. Do not use. Adjust the Voltage Measurement interactively.
- config_resistance()[source]
Configure for sensor presence resistance measurement.
- Return type:
None
- default_power_meas(wavelength)[source]
Legacy function. Do not use! Use get_Power instead. Performs a power measurement with hard coded parameters! PowerRange is set to auto.
- Parameters:
wavelength (float) – Wavelength in nm.
- Returns:
Power in dBm.
- Return type:
float
- default_power_meas_w(wavelength)[source]
Legacy function. Do not use! Use get_Power instead. Performs a power measurement with hard coded parameters! PowerRange is set to auto.
- Parameters:
WaveLength (float) – Wavelength in nm.
wavelength (float | int)
- Returns:
Power in W.
- Return type:
float
- display_param(type)[source]
Legacy function. Do not use. This function will print all the adjusted parameters.
- Parameters:
Type (str) – Can be set to Type = [‘Power’,’Energy’,’Current’,’Voltage’]
type (str)
- Return type:
None
- display_param_dict(type)[source]
This function will print all the adjusted parameters.
- Parameters:
type (str) – Can be set to Type = [‘Power’,’Energy’,’Current’,’Voltage’]
- Returns:
Headers (str) – String with [‘Power’,’Energy’,’Current’,’Voltage’]
Data (list) – Data from the instrument.
Params (list) – List with str for different data that are extracted from the instrument.
- Return type:
tuple[list, list, list]
- fetch_data(allow_NaN=False, delay=None)[source]
Reads last measurement data. WILL NOT START THE MEASUREMENT! Use readData() instead. Returns ‘nan’ if no data is available.
- Parameters:
allow_NaN (bool)
delay (float | None)
- Return type:
float
- get_freq_range(state)[source]
Queries the frequency range.
- Parameters:
state (str) – Can be [‘MAX’,’MIN’]
- Return type:
str | None
- get_power(unit=None, wavelength=None, *, allow_NaN=False, delay=None)[source]
Performs a Power measurement.
- Parameters:
unit (str, optional) – Power unit [‘W’,’dBm’]. The default is (keep unchanged).
waveLength (float, optional) – Wavelength in nm. The default is (keep unchanged).
allow_NaN (bool, optional) – If True, returns ‘nan’ if no data is available. The default is False.
delay (float, optional) – Delay in seconds between query and read. The default is (standard delay).
wavelength (float | None)
- Returns:
Power in dBm or W.
- Return type:
float
- meas_current()[source]
Performs a current measurement. Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- meas_energy()[source]
Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- meas_energy_density()[source]
Performs an energy density measurement. Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- meas_freq()[source]
Performs a frequency measurement. Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- meas_power()[source]
Performs a Power measurement. Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- meas_power_density()[source]
Performs a power density measurement. Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- meas_resistance()[source]
Performs a sensor presence resistance measurement. Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- meas_temp()[source]
Performs a sensor temperature measurement. Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- meas_voltage()[source]
Performs a voltage measurement. Maxim: Does nothing? Measure with Init() or readData() instead!
- Return type:
None
- power_meas()[source]
Legacy function. Do not use! Use get_Power instead. Performs a power measurement interactively, returning data from the measurement.
- Return type:
float
- power_specifications()[source]
Legacy function. Do not use. This function will print all the adjusted parameters for the power measurement.
- Return type:
None
- read_data(allow_NaN=False, delay=1)[source]
Starts a measurement and reads last measurement data. Returns last measurement data or ‘nan’ if no data is available.
- Parameters:
allow_NaN (bool)
delay (float | None)
- Return type:
float
- self_test()[source]
Use this query command to perform the instrument self-test routine. The command places the coded result in the Output Queue. A returned value of zero (0) indicates that the test passed, other values indicate that the test failed.
- set_adapter_type(state)[source]
- Parameters:
state (str) –
- Sets default sensor adapter type:
Allow senor types are: [‘PHOTodiode’,’THERmal’,’PYRo’]
- Return type:
None
- set_auto_current_range(state)[source]
Switches the auto-ranging function on and off.
- Parameters:
state (str/int) – Can be set to [‘ON’,’OFF’,1,0].
- Return type:
None
- set_auto_power_range(state)[source]
Switches the auto-ranging function on and off.
- Parameters:
state (str/int) – Can be set to [‘ON’,’OFF’,1,0].
- Return type:
None
- set_auto_voltage_range(state)[source]
Switches the auto-ranging function on and off.
- Parameters:
state (str/int) – Can be [‘ON’,’OFF’,1,0]
- Return type:
None
- set_average(value)[source]
- Parameters:
value (float/int) – Sets the averaging rate (1 sample takes approx. 3ms)
- Return type:
None
- set_current_range(value)[source]
- Parameters:
value (float/int) – Sets the current range in A.
- Return type:
None
- set_energy_range(value)[source]
- Parameters:
value (float) – Sets the energy range in J
- Return type:
None
- set_parameters(type)[source]
Legacy function. Do not use. This function will set the measurement parameters interactively.
- Parameters:
type (str) – Can be set to Type = [‘Power’,’Energy’,’Current’,’Voltage’]
- Return type:
None
- set_pd(state)[source]
- Parameters:
state (str/int) –
- Sets the bandwidth of the photodiode input stage.
Can be [‘ON’,’OFF’,1,0]
- Return type:
None
- set_power_range(value)[source]
- Parameters:
value (float/int) – Sets the current range in W
- Return type:
None
- set_power_units(state)[source]
- Parameters:
state (str) – Sets the power unit W or dBm. Can be [‘W’,’dBm’].
- Return type:
None