SmithChartx

_images/SmithChartx.jpg
class decida.SmithChartx.SmithChartx(parent=None, **kwargs)

Bases: decida.PlotBase.PlotBase

synopsis:

Plot s-parameter data on a Smith chart.

SmithChartx plots s-parameter on a Smith chart. The Smith chart grid is normalized impedance and/or admittance. The grid can be extended beyond the unit circle.

constructor arguments:

parent (Tkinter handle, default=None)

handle of frame or other widget to pack plot in. if this is not specified, top-level is created.

**kwargs (dict)

keyword=value specifications: options or configuration-options

options:

command (list)

list of pairs of data-object, string of freq, RE(s1), IM(s1), ?RE(s2), IM(s2), ...? columns (frequency, and real, imaginary vectors)

example: [d1, “freq RE(s11) IM(s11)”, d2, “freq RE(s11) IM(s11)”]:
s11 curves will be plotted for each data object d1 and d2. Each curve will also be plotted with color, symbol, symbol-size, line-width, and trace-direction selected from the successive item in the respective list of specified configured options: colors, symbols, ssizes, wlines, traces. Selection wraps around if the respective list is shorter than the number of curves.

configuration options:

verbose (bool, default=False)

enable/disable verbose mode

title (str, default=””)

main title

xtitle (str, default=””)

x-axis title

ytitle (str, default=””)

y-axis title

plot_height (str, default=”10i” for MacOS, else “7i”)

Height of plot window (Tk inch or pixelspecification)

plot_width (str, default=”10i” for MacOS, else “7i”)

Width of plot window (Tk inch or pixel specification)

plot_background (str, default=”GhostWhite”)

Background color of plot window

legend_background (str, default=”AntiqueWhite2”)

Background color of legend

grid_color (str, default=”black”)

Color of Smith Chart grid.

unit_color (str, default=”#eeeeff”)

Color of Smith Chart unit-circle.

unit_width (int, default=4)

Width of Smith Chart unit-circle outline.
resistance_list (list of float, default=[
0.1, 0.2, 0.3, 0.5, 0.7, 1, 1.5, 2, 3, 5, 10])

list of normalized resistance values to form grid of Smith Chart.

reactance_list (list of float, default=[
0.1, 0.2, 0.3, 0.5, 0.7, 1, 1.5, 2, 3, 5, 10])

list of normalized reactance values to form grid of Smith Chart.

colors (list of str, default=[
“blue”, “red”, “green”, “orange”, “cyan”, “brown”, “black”, “blue violet”, “cadet blue”, “dark cyan”, “dark goldenrod”, “dark green”, “dark magenta”, “dark olive green”, “dark orange”, “dark red”, “dark slate blue”, “dark slate gray”, “dodger blue”, “forest green”, “steel blue”, “sienna”])

list of colors for curves. Used to populate color menu, and to specify curve colors in scripted “command” option.

symbols (list of str, default=[
“none”, “dot”, “square”, “diamond”, “triangle”, “itriangle”, “dash”, “pipe”, “plus”, “cross”, “spade”, “heart”, “diam”, “club”, “shamrock”, “fleurdelis”, “circle”, “star”])

list of symbols for curves. Used to populate symbol menu, and to specify curve symbols in scripted “command” option.

ssizes (list of float, default = [0.01])

list of symbol sizes for curves. Used to specify curve symbol sizes in scripted “command” option.

wlines (list of int, default = [1])

list of line widths for curves. Used to specify curve line widths in scripted “command” option.

traces (list, default = [“increasing”])

list of traces for curves. each trace can be one of: “increasing”, “decreasing”, or “both”. Used to specify curve trace directions in scripted “command” option.

xaxis (str, default=”lin”)

linear or logarithmic axis: “lin” or “log”

yaxis (str, default=”lin”)

linear or logarithmic axis: “lin” or “log”

xmin (float, default=0.0)

xaxis minimum

xmax (float, default=0.0)

xaxis maximum

ymin (float, default=0.0)

yaxis minimum

ymax (float, default=0.0)

yaxis maximum

grid (bool, default=True)

if True, show grid on plot

legend (bool, default=True)

if True, show legend on plot

postscript (bool, default=False)

if true, generate a PostScript file.

postscript_file (str, default=”plot.ps”)

name of PostScript file to plot to

wait (bool, default=False)

wait in main-loop until window is destroyed.

destroy (bool, default=False)

destroy main window after it has been displayed. useful for displaying, generating PostScript, then destroying window.

example (from test_SmithChartx_2):

from decida.Data import Data
from decida.SmithChartx import SmithChartx

d = Data()
d.read("spars.col")
h=SmithChartx(None, command=[d, "freq REAL(Sdd11) IMAG(Sdd11) REAL(Sdd22) IMAG(Sdd22) REAL(Sdd12) IMAG(Sdd12)"], symbols=["dot"])

public methods:

  • public methods from ItclObjectx
  • public methods from PlotBase (2-dimensinal plot base class)