Yokogawa Optical Spectrum Analyzer AQ6370D module

Created on Tue Dec 14 12:58:27 2021

@author: Martin.Mihaylov

class AQ6370D.AQ6370D(hostname)[source]

Bases: Instrument

This class uses vxi11 library to connect to a Yokogawa AQ6370D. Need to have python ‘vxi11’, ‘pandas’ and ‘numpy’ libraries installed!

Close()[source]
StartSweep()[source]

Makes a sweep

Stop()[source]
Returns:

OSA.ask_SweepMode()

Return type:

None.

ask_AverageCount()[source]
Returns:

Queries the number of times averaging for each measured point.

Return type:

float

ask_BWResolution()[source]
Returns:

Queries the measurement resolution.

Return type:

float

ask_CenterWavelenght()[source]
Returns:

Queries the synchronous sweep function.

Return type:

float

ask_CentralWavelenght()[source]
Returns:

Queries the center wavelength of the X-axis of the display scale

Return type:

str

ask_DataFormat()[source]
Returns:

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

ask_DisplayAutoY()[source]
Returns:

Queries the automatic setting function of the subscale of the level axis. Response 0 = OFF, 1 = ON

Return type:

str

ask_DisplayYUnit()[source]
Returns:

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 Response 0 = dBm

1 = W 2 = DBM/NM 3 = W/NM

Return type:

str

ask_SamplePoints()[source]
Returns:

Queries the number of samples measured

Return type:

float

ask_SamplePointsAuto()[source]
Returns:

Queries the function of automatically setting the sampling number to be measured

Response 0 = OFF, 1 = ON

Return type:

str

ask_SegmentPoints()[source]
Returns:

Queries the number of sampling points to be measured at one time when performing SEGMENT MEASURE.

Return type:

float

ask_Sensitivity()[source]
Returns:

Queries the measurement sensitivity.

Return type:

str

ask_Span()[source]
Returns:

Queries the measurement condition measurement span.

Return type:

float

ask_SweepMode()[source]
Returns:

Queries the sweep mode [‘SINGle’,’REPeat’,’AUTO’,’SEGMent’]

Return type:

str

ask_SweepSpeed()[source]
Returns:

Queries the sweep speed 1x|0: Standard 2x|1: Twice as fast as standard

Return type:

str

ask_TraceActive()[source]
Returns:

Queries the trace to be transferred.

Outputs - (TRA|TRB|TRC|TRD|TRE|TRF|TRG)

Return type:

str

ask_TraceAttribute(state)[source]
Parameters:

state (str) – Name of the trace that should be extract/selected. sState = [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]

Raises:

ValueError – Error message

Returns:

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

Return type:

str

ask_TraceDataX(state)[source]
Parameters:

state (str) – Name of the trace that should be extract/selected. state = [TRA|TRB|TRC|TRD|TRE|TRF|TRG]

Raises:

ValueError – Error message

Returns:

Queries the wavelength axis data of the specified trace.

Return type:

list of floats

ask_TraceDataY(state)[source]
Parameters:

state (str) – Name of the trace that should be extract/selected. state = [TRA|TRB|TRC|TRD|TRE|TRF|TRG]

Raises:

ValueError – Error message

Returns:

data – Queries the level axis data of specified trace.

Return type:

list of floats

ask_TraceResolution(state)[source]
Parameters:

state (str) – Trace selected - [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]

Raises:

ValueError – Error message

Returns:

Queries the actual resolution data of the specified trace.

Return type:

list of floats

ask_TraceState()[source]
Returns:

Queries the display status of the specified trace.

Return type:

str

ask_UnitX()[source]
Returns:

Queries the units for the X axis.

Return type:

str

For AQ6370C, AQ6373 or AQ6373B WAVelength = Wavelength FREQuency = Frequency

ask_WavelengthStart()[source]
Returns:

Queries the measurement condition measurement start wavelength

Return type:

float

ask_WavelengthStop()[source]
Returns:

Queries the measurement condition measurement start wavelength

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’

get_ParamsOSA()[source]
Returns:

Parameters set on the Yokogawa AQ6370D

Return type:

srt

print_ParamsOSA()[source]
Returns:

Parameters set on the Yokogawa AQ6370D

Return type:

srt

query(message)[source]
set_AverageCount(value)[source]
Parameters:

value (int) – Set the number of times averaging for each measured point.

Return type:

None.

set_BWResolution(value, unit)[source]
Parameters:
  • value (int/float) – Set the measurement resolution.

  • unit (str) – sUnit = [‘M’,’HZ’]

Raises:

ValueError – Error message

Return type:

None.

set_CenterWavelenght(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_DataFormat(unit)[source]
Parameters:

unit – sUnit = [‘ASCii’, ‘REAL[,64]’, ‘REAL,32’]

Raises:

ValueError – Error message

Return type:

None.

set_DisplayYUnit(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_SamplePoints(value)[source]
Parameters:

value (int) – Set the number of samples measured

Return type:

None.

set_SamplePointsAuto(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_SegmentPoints(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) – sUnits = [‘M’,’HZ’]

Return type:

None.

set_SweepMode(state)[source]
Parameters:

state (str) – Set the sweep mode [‘SINGle’,’REPeat’,’AUTO’,’SEGMent’]

Raises:

ValueError – Error message

Return type:

None.

set_SweepSpeed(value)[source]
Parameters:

value (int) – Set the sweep speed. 1 - Standard 2 - Twice as fast as standard

Return type:

None.

set_TraceActive(state)[source]
Parameters:

state (str) – Sets the active trace. sState = [‘TRA’,’TRB’,’TRC’,’TRD’,’TRE’,’TRF’,’TRG’]

Raises:

ValueError – Error message

Return type:

None.

set_TraceAttribute(trace, state)[source]
Parameters:
  • trace (str) – Sets the active trace. sState = [‘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_UnitX(unit)[source]
Parameters:

unit (str) – Set the units for the X axis. sUnit = [‘WAV’,’FREQ’,’WNUM’]

Raises:

ValueError – Error message

Return type:

None.

set_WavelengthStart(value, unit)[source]
Parameters:
  • value (int/float) – Set the measurement condition

  • unit (str) – units - [M|HZ].

Raises:

ValueError – Error message

Return type:

None.

set_WavelengthStop(value, unit)[source]

Set the measurement condition measurement stop wavelength

[M|HZ]