The procedure for requesting AWR support has changed. Please read all about the new AWR product support process.
Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This first section imports pyawr, matplotlib and numpy. Then awrde object is created. Next, the active project name is read and the project name read back is compared against the desired project name.

Code Block
languagepy
import pyawr.mwoffice as mwo
import matplotlib.pyplot as plt
import numpy as np

#Establish AWRDE link--------------------------------------------------------------
DesiredProjectName = 'pyawr_PlotMeasurementData.emp'
awrde = mwo.CMWOffice()               #create awrde object
ProjectName = awrde.Project.Name      #Read active project name
if ProjectName != DesiredProjectName: #Check to make sure active project is the desire one
    raise RuntimeError('Incorrect Opened Project')

This section demonstrates creating a frequency array using the numpy linspace function. The frequency array is then used to update global project frequencies.

Code Block
languagepy
#Change Project Frequencies----------------------------------------------------------
StartFreq = 0
StopFreq = 5e9
NumFreqPts = 201
Freq_ay = np.linspace(StartFreq, StopFreq, NumFreqPts)  #Create Frequency vector
awrde.Project.Frequencies.AddMultiple(Freq_ay)          #Write frequency vector to
                                                        #Options > Project Options > Freqencies tab

...