# Path: sucemfem/PostProcessing/circuit.py
# def S11(Zl, Z0):
#     """Calculate reflection coeficient of load
# 
#     @param Zl: Load impedance
#     @param Z0: Characteristic impedance
#     """
#     Zl = np.asarray(Zl)
#     return (Zl - Z0)/(Zl + Z0)


import numpy as np
import pickle
import pylab
import sys
from sucemfem.PostProcessing.circuit import S11
from __future__ import division

mpath = '../../'
sys.path.append(mpath)
#sys.path.remove(mpath)

fname = 'patch_o-2_gmres_Z.pickle'
res = pickle.load(open(fname))

Z0 = 50.
Z = res['Zs']
freqs = res['freqs']

# Path: sucemfem/PostProcessing/circuit.py
# def S11(Zl, Z0):
#     """Calculate reflection coeficient of load
# 
#     @param Zl: Load impedance
#     @param Z0: Characteristic impedance
#     """
#     Zl = np.asarray(Zl)
#     return (Zl - Z0)/(Zl + Z0)


# Path: sandbox/patch/postproc.py
import numpy as np
import pickle
import pylab
import sys
from sucemfem.PostProcessing.circuit import S11

from __future__ import division

mpath = '../../'
sys.path.append(mpath)
#sys.path.remove(mpath)

fname = 'patch_o-2_gmres_Z.pickle'
res = pickle.load(open(fname))

Z0 = 50.
Z = res['Zs']
freqs = res['freqs']

S11 = S11(Z, Z0)