In [9]:
from numpy import *
from os import path, listdir
import plotly.plotly as py
from plotly.graph_objs import *
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
from myfunctions import analyze, plotS21

In [32]:
def plot_disp_shift(sample):
    datapath = '\\\\128.230.72.36\labshare\Experiments\JPM\\' + sample
    files = listdir(datapath)

    data = []
    layout = dict(
        title="Dispersive shift of " + sample,
        xaxis=dict(title="Frequency (GHz)"),
        yaxis=dict(title="S21 (dB)"),
        annotations = []
    )


    for f in files:
        if f.endswith('.s2p'):
            result = analyze(path.join(datapath, f));
            data.append(Scatter(
                x = result['freq'],
                y = result['dBm'],
                name = f))
            descr = "$F_0 = " + str(round(result['f0']/1e9, 6)) + "\\text{GHz}\quad "
            descr = descr + "Q = " + str(round(result['Q'], 3)) + "\quad "
            descr = descr + "\kappa = " + str(round(result['kappa']/(2*pi*1e6), 3)) + "\\text{MHz}$"
            layout['annotations'].append(dict(
                text=descr,
                x=result['f0'],
                y=max(result['dBm']),
                xref='x',
                yref='y'))

    fig = Figure(data=data, layout=layout)
    iplot(fig)

CH002


In [33]:
plot_disp_shift("CH002")


\\128.230.72.36\labshare\Experiments\JPM\CH002\CH002_-65dB.s2p
Drawing...
f0 = 4.663204+/- 0.00007 (0.0016%) GHz
kappa = 75025636.2564+/- 1018438.59039 (1.4%)
Q = 9.892+/- 0.012 (0.12%)
Drawing...
\\128.230.72.36\labshare\Experiments\JPM\CH002\CH002_-30dB.s2p
Drawing...
f0 = 4.667625+/- 0.00001 (0.00014%) GHz
kappa = 35453798.4659+/- 83121.18786 (0.23%)
Q = 20.953+/- 0.012 (0.058%)
Drawing...
Drawing...

In [31]:
plot_disp_shift("CH003")


\\128.230.72.36\labshare\Experiments\JPM\CH003\CH003_-70dB.s2p
Drawing...
f0 = 4.643699+/- 0.00008 (0.0018%) GHz
kappa = 59570983.6913+/- 1129399.75453 (1.9%)
Q = 12.407+/- 0.012 (0.095%)
Drawing...
\\128.230.72.36\labshare\Experiments\JPM\CH003\CH003_-30dB.s2p
Drawing...
f0 = 4.647256+/- 0.00001 (0.00027%) GHz
kappa = 39231542.4827+/- 165491.15060 (0.42%)
Q = 18.853+/- 0.012 (0.064%)
Drawing...
Drawing...

In [ ]: