AQ6370D module
Created on Tue Dec 14 12:58:27 2021
@author: Martin.Mihaylov
- class Instruments_Libraries.AQ6370D.AQ6370D(resource_str, visa_library='@py', **kwargs)[source]
Bases:
BaseInstrumentThis class uses BaseInstrument to connect to a Yokogawa AQ6370D. Need to have python ‘pyvisa’, ‘pandas’ and ‘numpy’ libraries installed!
- Parameters:
resource_str (str)
visa_library (str)
- get_average_count()[source]
Queries the number of times averaging for each measured point.
- Return type:
float
- get_central_wavelenght()[source]
Queries the center wavelength of the X-axis of the display scale
- Return type:
float
- get_data(state)[source]
Get data on X and Y Traces from OSA. Data Output is CST File. Data is Saved in X Column and Y Column state = ‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’
- Parameters:
state (str)
- Return type:
DataFrame
- get_data_format()[source]
Queries the format used for data transfer via GP-IB.
ASCii = ASCII format (default) REAL[,64] = REAL format (64bits) REAL,32 = REAL format (32bits)
- Return type:
str
- get_display_auto_y()[source]
Queries the automatic setting function of the subscale of the level axis. Response 0 = OFF, 1 = ON
- Return type:
str
- get_display_y_unit()[source]
Queries the units of the main scale of the level axis. DBM = dBm W = W DBM/NM = dBm/nm or dBm/THz W/NM = W/nm or W/THz
- Return type:
str | None
- get_params_osa()[source]
Parameters set on the Yokogawa AQ6370D
- Return type:
tuple[list[str], list]
- get_sample_points_auto()[source]
Queries the function of automatically setting the sampling number to be measured
Response 0 = OFF, 1 = ON
- Return type:
str
- get_segment_points()[source]
Queries the number of sampling points to be measured at one time when performing SEGMENT MEASURE.
- Return type:
float
- get_sweep_mode()[source]
Queries the sweep mode [‘SINGle’,’REPeat’,’AUTO’,’SEGMent’]
- Return type:
str | None
- get_sweep_speed()[source]
Queries the sweep speed 1x|0: Standard 2x|1: Twice as fast as standard
- Return type:
str
- get_trace_active()[source]
Queries the trace to be transferred.
Outputs - (TRA|TRB|TRC|TRD|TRE|TRF|TRG)
- Return type:
str
- get_trace_attribute(state)[source]
Queries the attributes of the specified trace [‘WRITe’,’FIX’,’MAX’,’MIN’,’RAVG’,’CALC’] WRITe = WRITE FIX = FIX MAX = MAX HOLD MIN = MIN HOLD RAVG = ROLL AVG CALC = CALC
- Parameters:
state (str) – Name of the trace that should be extract/selected. state_list = [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]
- Raises:
ValueError – Error message
- Return type:
str
- get_trace_data_x(state)[source]
Queries the wavelength axis data of the specified trace.
- Parameters:
state (str) – Name of the trace that should be extract/selected. state = [TRA|TRB|TRC|TRD|TRE|TRF|TRG]
- Raises:
ValueError – Error message
- Return type:
list
- get_trace_data_y(state)[source]
Queries the level axis data of specified trace.
- Parameters:
state (str) – Name of the trace that should be extract/selected. state = [TRA|TRB|TRC|TRD|TRE|TRF|TRG]
- Raises:
ValueError – Error message
- Return type:
list
- get_trace_resolution(state)[source]
Queries the actual resolution data of the specified trace.
- Parameters:
state (str) – Trace selected - [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]
- Raises:
ValueError – Error message
- Return type:
list
- get_unit_x()[source]
Queries the units for the X axis.
For AQ6370C, AQ6373 or AQ6373B WAVelength = Wavelength FREQuency = Frequency
- Return type:
str | None
- get_wavelength_start()[source]
Queries the measurement condition measurement start wavelength
- Return type:
float
- get_wavelength_stop()[source]
Queries the measurement condition measurement start wavelength
- Return type:
float
- set_average_count(value)[source]
- Parameters:
value (int) – Set the number of times averaging for each measured point.
- Return type:
None
- set_bw_resolution(value, unit)[source]
- Parameters:
value (int/float) – Set the measurement resolution.
unit (str) – unit_list = [‘M’,’HZ’]
- Raises:
ValueError – Error message
- Return type:
None
- set_center_wavelenght(value, unit)[source]
- Parameters:
value (int/float) – Set the center wavelength of the X-axis of the display scale
unit (str) – Units = [‘M’,’HZ’]
- Raises:
ValueError – Error message
- Return type:
None
- set_data_format(unit)[source]
- Parameters:
unit (str) – unit_list = [‘ASCii’, ‘REAL[,64]’, ‘REAL,32’] Sets the parameter format displayed in an SNP data file.
- Return type:
None
Notes
When the format is set to REAL (binary) using this command, the output data of the following commands is produced in REAL format:
:CALCulate:DATA:CGAin? :CALCulate:DATA:CNF? :CALCulate:DATA:CPOWers? :CALCulate:DATA:CSNR? :CALCulate:DATA:CWAVelengths? :TRACe[:DATA]:X? :TRACe[:DATA]:Y?
The default is ASCII mode.
When the
*RSTcommand is executed, the format is reset to ASCII.The ASCII format outputs a comma-delimited list of numerics (e.g.,
12345,12345,...).By default, the REAL format outputs 64-bit floating-point binary numbers. Specify
REAL,32for 32-bit floating-point.The fixed-length block is defined by IEEE 488.2 and starts with
#, followed by a digit indicating the number of bytes used to encode the length, then the length digits, then the binary payload, for example:
#18<8-byte data> #280<80-byte data> #48008<8008-byte data>
- Raises:
ValueError – Error message
- Parameters:
unit (str)
- Return type:
None
- set_display_y_unit(state)[source]
- Parameters:
state (str) – Set the units of the main scale of the level axis [‘dBm’,’W’,’DBM/NM’,’W/NM’]
- Raises:
ValueError – Error message
- Return type:
None
- set_sample_points(value)[source]
- Parameters:
value (int) – Set the number of samples measured
- Return type:
None
- set_sample_points_auto(state)[source]
- Parameters:
state (str) – Set the function of automatically setting the sampling number to be measured [‘ON’|’OFF’]
- Raises:
ValueError – Error message
- Return type:
None
- set_segment_points(value)[source]
- Parameters:
value (int) – Set the number of sampling points to be measured at one time when performing SEGMENT MEASURE.
- Return type:
None
- set_sensitivity(unit)[source]
- Parameters:
unit (str) –
- Set the measurement sensitivity.
NHLD = NORMAL HOLD NAUT = NORMAL AUTO NORMal = NORMAL MID = MID HIGH1 = HIGH1 or HIGH1/CHOP HIGH2 = HIGH2 or HIGH2/CHOP HIGH3 = HIGH3 or HIGH3/CHOP
- Raises:
ValueError – Error message
- Return type:
None
- set_span(value, unit)[source]
- Parameters:
value (int/float) – Set the measurement span.
unit (str) – unit_lists = [‘M’,’HZ’]
- Return type:
None
- set_sweep_mode(state)[source]
- Parameters:
state (str) – Set the sweep mode [‘SINGle’,’REPeat’,’AUTO’,’SEGMent’]
- Raises:
ValueError – Error message
- Return type:
None
- set_sweep_speed(value)[source]
- Parameters:
value (int) – Set the sweep speed. 1 - Standard 2 - Twice as fast as standard
- Return type:
None
- set_trace_active(state)[source]
- Parameters:
state (str) – Sets the active trace. state_list = [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]
- Raises:
ValueError – Error message
- Return type:
None
- set_trace_attribute(trace, state)[source]
- Parameters:
trace (str) – Sets the active trace. state_list = [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]
state (str) –
Set the attributes of the specified trace [‘WRITe’,’FIX’,’MAX’,’MIN’,’RAVG’,’CALC’]
WRITe = WRITE FIX = FIX MAX = MAX HOLD MIN = MIN HOLD RAVG = ROLL AVG CALC = CALC
- Raises:
ValueError – Error message
- Return type:
None
- set_unit_x(unit)[source]
- Parameters:
unit (str) – Set the units for the X axis. unit_list = [‘WAV’,’FREQ’,’WNUM’]
- Raises:
ValueError – Error message
- Return type:
None
- set_wavelength_start(value, unit)[source]
- Parameters:
value (int/float) – Set the measurement condition
unit (str) – units - [M|HZ].
- Raises:
ValueError – Error message
- Return type:
None