In [2]:
import os
import pandas as pd
from pyawr import connect, AwrMeas, as_list, meas_from_graph, open_example
In [3]:
# connect to AWRDE
awrde, awrc = connect() # awrde is the pointed to the awrde COM object while awrc is the AWR defined constants
In [4]:
# Open the lumped filter example
open_example(awrde, 'LPF_lumped.emp')
In [5]:
# Let's see what graphs it has
[x.Name for x in awrde.Project.Graphs]
Out[5]:
In [6]:
# We need to simulate before we can get results
awrde.Project.Simulate()
In [7]:
# Get all the measurements on the Passband and Stopband graph
measurements = as_list(awrde.Project.Graphs('Passband and Stopband').Measurements)
measurements
Out[7]:
In [8]:
m1 = AwrMeas(measurements[0]) # it takes a measurement object as an argument
print(m1)
In [9]:
# the AWR measurement has several useful properties
print(m1.name)
print(m1.source)
print(m1.type)
print(m1.plot_dim)
print(m1.x_units)
print(m1.y_units)
In [10]:
# as well as the data
m1.df.head()
Out[10]:
In [15]:
open_example(awrde, 'BJT_Characterization.emp')
ms = as_list(awrde.Project.Graphs('Dynamic Load Line').Measurements)
In [35]:
swept_meas = AwrMeas(ms[0])
In [36]:
swept_meas.df.head()
Out[36]:
Here we see that this dataframe has additional columns for Istep, the swept variable, and Istep_unit, the units for the Istep variable.