In [1]:
#general settings
%matplotlib inline
%load_ext autoreload
%autoreload 2
In [2]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import pytimber
from pytimber import BSRT
In [3]:
db = pytimber.LoggingDB()
In [4]:
t1=pytimber.parsedate("2016-08-24 03:34:00.000")
t2=pytimber.parsedate("2016-08-24 04:08:00.000")
print(t1)
print(t2)
1472002440.0
1472004480.0

Getting the BSRT data from timber

generate the BSRT instance, which automatically calculates the emittances using the data stored in timber.

In [5]:
bsrt = BSRT.fromdb(t1,t2,beam='B1')
WARNING:cmmnbuild_dep_manager:JVM is already started

Dictionary with emittances and timestamps for each slot

In [6]:
bsrt.emit
Out[6]:
sigh sigv lsfh lsfv beth betv emith emitv energy
slots time
50.0 1.472002e+09 1.320667 1.472667 0.528 0.437 204.1 317.3 3.450456 2.995828 449.9
1.472002e+09 1.329000 1.458333 0.528 0.437 204.1 317.3 3.502757 2.932353 449.9
1.472002e+09 1.310000 1.417333 0.528 0.437 204.1 317.3 3.384469 2.754310 449.9
1.472003e+09 1.311333 1.444333 0.528 0.437 204.1 317.3 3.392553 2.870786 449.9
1.472003e+09 1.328333 1.480333 0.528 0.437 204.1 317.3 3.498055 3.029378 449.9
1.472003e+09 1.341000 1.474000 0.528 0.437 204.1 317.3 3.577259 3.002379 449.9
1.472003e+09 1.318333 1.469000 0.528 0.437 204.1 317.3 3.436147 2.979287 449.9
1.472003e+09 1.319000 1.426667 0.528 0.437 204.1 317.3 3.439612 2.794376 449.9
1.472003e+09 1.324667 1.470000 0.528 0.437 204.1 317.3 3.474794 2.983160 449.9
1.472003e+09 1.333333 1.493667 0.528 0.437 204.1 317.3 3.529190 3.089547 449.9
1.472003e+09 1.335667 1.433333 0.528 0.437 204.1 317.3 3.543758 2.821990 449.9
1.472003e+09 1.336667 1.476667 0.528 0.437 204.1 317.3 3.550462 3.013544 449.9
1.472003e+09 1.332667 1.486667 0.528 0.437 204.1 317.3 3.524955 3.058646 449.9
1.472003e+09 1.348000 1.438000 0.528 0.437 204.1 317.3 3.622983 2.844169 449.9
1.472003e+09 1.342667 1.518000 0.528 0.437 204.1 317.3 3.587833 3.200539 449.9
1.472003e+09 1.321667 1.431333 0.528 0.437 204.1 317.3 3.456156 2.813692 449.9
1.472003e+09 1.340000 1.502000 0.528 0.437 204.1 317.3 3.571362 3.128166 449.9
1.472003e+09 1.342000 1.439333 0.528 0.437 204.1 317.3 3.583801 2.848469 449.9
1.472003e+09 1.346000 1.439333 0.528 0.437 204.1 317.3 3.609062 2.851196 449.9
1.472003e+09 1.324333 1.476000 0.528 0.437 204.1 317.3 3.472937 3.010372 449.9
1.472003e+09 1.335333 1.461333 0.528 0.437 204.1 317.3 3.542941 2.944856 449.9
1.472003e+09 1.340000 1.457000 0.528 0.437 204.1 317.3 3.571536 2.927416 449.9
1.472003e+09 1.313333 1.482333 0.528 0.437 204.1 317.3 3.404745 3.038491 449.9
1.472003e+09 1.335000 1.513333 0.528 0.437 204.1 317.3 3.539582 3.178936 449.9
1.472003e+09 1.348000 1.469667 0.528 0.437 204.1 317.3 3.621839 2.981832 449.9
1.472003e+09 1.324000 1.524667 0.528 0.437 204.1 317.3 3.470648 3.231133 449.9
1.472003e+09 1.331000 1.468333 0.528 0.437 204.1 317.3 3.514856 2.977273 449.9
1.472003e+09 1.344000 1.479000 0.528 0.437 204.1 317.3 3.597079 3.023918 449.9
1.472003e+09 1.343000 1.492333 0.528 0.437 204.1 317.3 3.590078 3.086293 449.9
1.472003e+09 1.348667 1.440667 0.528 0.437 204.1 317.3 3.626199 2.854015 449.9
... ... ... ... ... ... ... ... ... ... ...
3136.0 1.472004e+09 1.286000 1.550667 0.528 0.437 204.1 317.3 3.237250 3.354052 449.9
1.472004e+09 1.287333 1.551333 0.528 0.437 204.1 317.3 3.245270 3.355924 449.9
1.472004e+09 1.316000 1.551667 0.528 0.437 204.1 317.3 3.420870 3.357737 449.9
1.472004e+09 1.278667 1.551667 0.528 0.437 204.1 317.3 3.192947 3.357175 449.9
1.472004e+09 1.307667 1.558333 0.528 0.437 204.1 317.3 3.369758 3.388416 449.9
1.472004e+09 1.310667 1.598333 0.528 0.437 204.1 317.3 3.388132 3.579582 449.9
1.472004e+09 1.294667 1.568000 0.528 0.437 204.1 317.3 3.290788 3.434166 449.9
1.472004e+09 1.307000 1.508000 0.528 0.437 204.1 317.3 3.365765 3.156169 449.9
1.472004e+09 1.319000 1.589667 0.528 0.437 204.1 317.3 3.439526 3.537737 449.9
1.472004e+09 1.297000 1.539667 0.528 0.437 204.1 317.3 3.304814 3.300888 449.9
1.472004e+09 1.311667 1.593000 0.528 0.437 204.1 317.3 3.394078 3.553862 449.9
1.472004e+09 1.323667 1.595667 0.528 0.437 204.1 317.3 3.468506 3.566583 449.9
1.472004e+09 1.310667 1.596667 0.528 0.437 204.1 317.3 3.389714 3.577809 449.9
1.472004e+09 1.305333 1.584667 0.528 0.437 204.1 317.3 3.355507 3.515774 449.9
1.472004e+09 1.310667 1.608667 0.528 0.437 204.1 317.3 3.387974 3.630872 449.9
1.472004e+09 1.308667 1.595667 0.528 0.437 204.1 317.3 3.376269 3.568231 449.9
1.472004e+09 1.316667 1.553000 0.528 0.437 204.1 317.3 3.425100 3.363745 449.9
1.472004e+09 1.319667 1.559000 0.528 0.437 204.1 317.3 3.443837 3.393170 449.9
1.472004e+09 1.314000 1.578000 0.528 0.437 204.1 317.3 3.408660 3.482169 449.9
1.472004e+09 1.318333 1.645333 0.528 0.437 204.1 317.3 3.435569 3.810726 449.9
1.472004e+09 1.306667 1.546667 0.528 0.437 204.1 317.3 3.364588 3.334496 449.9
1.472004e+09 1.305667 1.581000 0.528 0.437 204.1 317.3 3.357669 3.497247 449.9
1.472004e+09 1.316000 1.508333 0.528 0.437 204.1 317.3 3.420901 3.159801 449.9
1.472004e+09 1.314000 1.575667 0.528 0.437 204.1 317.3 3.408901 3.471836 449.9
1.472004e+09 1.322000 1.556000 0.528 0.437 204.1 317.3 3.458241 3.377815 449.9
1.472004e+09 1.314667 1.585667 0.528 0.437 204.1 317.3 3.412618 3.522609 449.9
1.472004e+09 1.322000 1.557000 0.528 0.437 204.1 317.3 3.458265 3.382909 449.9
1.472004e+09 1.311000 1.612667 0.528 0.437 204.1 317.3 3.389938 3.650581 449.9
1.472004e+09 1.314667 1.570000 0.528 0.437 204.1 317.3 3.412608 3.444425 449.9
1.472004e+09 1.315667 1.589667 0.528 0.437 204.1 317.3 3.419331 3.538076 449.9

4448 rows × 9 columns

what slots do we have?

In [7]:
print(np.unique(bsrt.emit.index.get_level_values(0)))
[  50.   62.   74.   86.  300.  312.  324.  336.  550.  562.  574.  586.
  800.  812.  824.  836. 1050. 1062. 1074. 1086. 1300. 1312. 1324. 1336.
 1550. 1562. 1574. 1586. 1800. 1812. 1824. 1836. 2050. 2062. 2074. 2086.
 2300. 2312. 2324. 2336. 2550. 2562. 2574. 2586. 3100. 3112. 3124. 3136.]
In [8]:
print(len(np.unique(bsrt.emit.index.get_level_values(1))))
1867

Plotting the data

We can plot the emittance

In [9]:
plt.figure()
bsrt.plot(plane='v',t1=t1,t2=t2,slots=None,avg=None,fit=False)
Out[9]:
<pytimber.LHCBSRT.BSRT at 0x7f356d6994e0>

... and we can also perform a moving average over the data

In [10]:
plt.figure()
bsrt.plot(plane='h',t1=t1,t2=t2,slots=None,avg=10,fit=False)
Out[10]:
<pytimber.LHCBSRT.BSRT at 0x7f356d6994e0>

... or plot only specific slots

In [11]:
plt.figure()
bsrt.plot(plane='h',t1=t1,t2=t2,slots=[50,62],avg=10,fit=False)
Out[11]:
<pytimber.LHCBSRT.BSRT at 0x7f356d6994e0>

With error estimates

In [12]:
window = 5

roll_std = bsrt.emit.groupby(level=0)['emith', 'emitv'].rolling(window).std().reset_index(level=0, drop=True)/np.sqrt(window)
roll_avg = bsrt.emit.groupby(level=0)['emith', 'emitv'].rolling(window).mean().reset_index(level=0, drop=True)

# set time index to datetime object to have a nice time axis
roll_std.index = roll_std.index.set_levels([roll_std.index.levels[0], 
                                            pd.to_datetime(roll_std.index.levels[1], unit='s')])
roll_avg.index = roll_avg.index.set_levels([roll_avg.index.levels[0], 
                                            pd.to_datetime(roll_avg.index.levels[1], unit='s')])
In [13]:
slot = 50
roll_avg.loc[slot].plot(yerr=roll_std.loc[slot],
                        grid=True,
                        title='slot {}, window {}, mean with std/np.sqrt(window) errbars'.format(slot, window))
/home/lcoyle/anaconda2/envs/python3/lib/python3.6/site-packages/numpy/core/numeric.py:501: UserWarning: Warning: converting a masked element to nan.
  return array(a, dtype, copy=False, order=order)
Out[13]:
<matplotlib.axes._subplots.AxesSubplot at 0x7f3504399c50>

Fitting the emittance

fit the emittance between tstart and tend

In [14]:
tstart=pytimber.parsedate("2016-08-24 03:45:00.000")
tend=pytimber.parsedate("2016-08-24 04:00:00.000")

The raw data can be also fitted with an exponential:
$\epsilon(t) = \epsilon_0\cdot e^{((t-t_{\rm start})/\tau)}$

In [15]:
plt.figure()
bsrt.plot(plane='h',t1=tstart,t2=tend,slots=[50,62],avg=10,fit=True)
Out[15]:
<pytimber.LHCBSRT.BSRT at 0x7f356d6994e0>

The fit data from tstart to tend ist then stored in bsrt.emit_fit.

In [16]:
bsrt.emit_fit
Out[16]:
ah sigah tauh sigtauh av sigav tauv sigtauv
slots t1 t2
50.0 1.472003e+09 1.472004e+09 3.592037 0.020030 3.963225e+04 1.691920e+04 3.009981 0.026124 -4.094221e+10 3.017460e+16
62.0 1.472003e+09 1.472004e+09 3.315585 0.021582 2.375362e+04 7.065574e+03 2.929291 0.046162 -1.795588e+09 6.247949e+13
74.0 1.472003e+09 1.472004e+09 3.748482 0.021306 2.523570e+04 6.972492e+03 3.257827 0.029117 -4.320898e+10 2.818150e+16
86.0 1.472003e+09 1.472004e+09 3.506898 0.020028 3.886294e+04 1.665643e+04 3.146739 0.031172 -1.767006e+10 3.514587e+15
300.0 1.472003e+09 1.472004e+09 3.554383 0.018634 2.039754e+04 4.193946e+03 2.956025 0.038580 9.647072e+03 2.307257e+03
312.0 1.472003e+09 1.472004e+09 3.326511 0.017004 2.601794e+04 6.664073e+03 2.827810 0.039674 8.047715e+03 1.716899e+03
324.0 1.472003e+09 1.472004e+09 3.450840 0.023239 2.623168e+04 8.930397e+03 2.972410 0.033245 8.847289e+03 1.659455e+03
336.0 1.472003e+09 1.472004e+09 3.520639 0.017930 2.375455e+04 5.530440e+03 3.129843 0.033302 1.110139e+04 2.496820e+03
550.0 1.472003e+09 1.472004e+09 3.725442 0.015662 3.822373e+04 1.217335e+04 3.246930 0.040297 7.073178e+03 1.200212e+03
562.0 1.472003e+09 1.472004e+09 3.362647 0.021711 2.268194e+04 6.553217e+03 3.038822 0.037994 6.409771e+03 9.893087e+02
574.0 1.472003e+09 1.472004e+09 3.433449 0.022893 2.494815e+04 8.187954e+03 3.139763 0.031778 6.584184e+03 8.451698e+02
586.0 1.472003e+09 1.472004e+09 3.387308 0.017594 2.947339e+04 8.924927e+03 3.148927 0.034682 5.405200e+03 6.161951e+02
800.0 1.472003e+09 1.472004e+09 3.295044 0.018147 2.380764e+04 6.157336e+03 2.933478 0.032773 5.141478e+03 5.638641e+02
812.0 1.472003e+09 1.472004e+09 3.349977 0.017933 1.424480e+04 2.131391e+03 3.112815 0.035364 5.171319e+03 5.807563e+02
824.0 1.472003e+09 1.472004e+09 3.380801 0.015665 1.865812e+04 3.174574e+03 3.053306 0.039257 4.567067e+03 5.095644e+02
836.0 1.472003e+09 1.472004e+09 3.399982 0.014041 -8.744571e+10 4.540639e+16 3.022022 0.037892 4.486479e+03 4.796314e+02
1050.0 1.472003e+09 1.472004e+09 3.475735 0.016054 2.799275e+04 7.152207e+03 3.028287 0.038504 4.293956e+03 4.442636e+02
1062.0 1.472003e+09 1.472004e+09 3.457277 0.021055 2.085617e+04 5.225401e+03 3.104601 0.040647 4.175971e+03 4.324621e+02
1074.0 1.472003e+09 1.472004e+09 3.323375 0.018940 2.442293e+04 6.710371e+03 3.066062 0.039847 4.440459e+03 4.864062e+02
1086.0 1.472003e+09 1.472004e+09 3.286255 0.019067 1.853434e+04 3.927811e+03 3.087283 0.047282 4.105192e+03 4.886258e+02
1300.0 1.472003e+09 1.472004e+09 3.576019 0.017566 5.559485e+04 3.013333e+04 3.170960 0.048480 4.005563e+03 4.634671e+02
1312.0 1.472003e+09 1.472004e+09 3.225916 0.019181 2.211467e+04 5.592142e+03 2.989050 0.042096 3.667257e+03 3.468330e+02
1324.0 1.472003e+09 1.472004e+09 3.393687 0.019479 2.679189e+04 7.931129e+03 3.104302 0.043922 3.817836e+03 3.781627e+02
1336.0 1.472003e+09 1.472004e+09 3.314602 0.012575 -1.241720e+11 8.661986e+16 3.126745 0.054374 4.123682e+03 5.441269e+02
1550.0 1.472003e+09 1.472004e+09 3.542046 0.016520 2.570762e+04 5.932958e+03 3.273096 0.041075 1.618393e+04 6.294225e+03
1562.0 1.472003e+09 1.472004e+09 3.166437 0.015021 3.985543e+04 1.453378e+04 3.222240 0.026741 2.038749e+04 6.618398e+03
1574.0 1.472003e+09 1.472004e+09 3.399230 0.019392 4.327992e+04 2.064224e+04 3.468519 0.042453 1.545083e+05 5.653345e+05
1586.0 1.472003e+09 1.472004e+09 3.236717 0.016530 2.041134e+04 4.083347e+03 3.569827 0.037587 2.372822e+04 1.139487e+04
1800.0 1.472003e+09 1.472004e+09 3.440406 0.017920 2.231168e+04 4.986305e+03 3.062221 0.035858 8.109158e+03 1.455138e+03
1812.0 1.472003e+09 1.472004e+09 3.258832 0.018824 2.422040e+04 6.513628e+03 3.022294 0.040012 7.140107e+03 1.269428e+03
1824.0 1.472003e+09 1.472004e+09 3.474497 0.020630 2.903627e+04 9.650267e+03 3.278032 0.036610 9.596555e+03 1.952239e+03
1836.0 1.472003e+09 1.472004e+09 3.449252 0.011053 -6.414594e+11 1.077116e+18 3.437785 0.038384 2.719821e+04 1.590077e+04
2050.0 1.472003e+09 1.472004e+09 3.471676 0.008412 -5.645425e+11 3.223694e+17 3.484110 0.035921 6.937565e+03 9.337698e+02
2062.0 1.472003e+09 1.472004e+09 3.432666 0.012834 -1.263121e+11 6.961080e+16 3.767890 0.042421 7.294509e+03 1.128077e+03
2074.0 1.472003e+09 1.472004e+09 3.312584 0.016006 -1.021529e+11 8.280148e+16 3.728678 0.044809 9.226918e+03 1.940581e+03
2086.0 1.472003e+09 1.472004e+09 3.401064 0.018488 3.487661e+04 1.275844e+04 4.074348 0.046046 8.311648e+03 1.476140e+03
2300.0 1.472003e+09 1.472004e+09 3.515127 0.016563 2.498150e+04 5.663840e+03 3.524304 0.039729 6.272904e+03 8.321839e+02
2312.0 1.472003e+09 1.472004e+09 3.302236 0.010983 -2.288095e+11 1.558654e+17 3.626174 0.047888 6.463159e+03 1.035429e+03
2324.0 1.472003e+09 1.472004e+09 3.262018 0.021305 3.530476e+04 1.572529e+04 3.580213 0.044536 5.363630e+03 6.676909e+02
2336.0 1.472003e+09 1.472004e+09 3.143038 0.020286 3.439193e+04 1.473076e+04 3.732126 0.043009 5.440062e+03 6.361210e+02
2550.0 1.472003e+09 1.472004e+09 3.304697 0.018752 2.285699e+04 5.709007e+03 3.076066 0.036334 4.587101e+03 4.608084e+02
2562.0 1.472003e+09 1.472004e+09 3.526196 0.018693 5.824060e+04 3.479954e+04 3.451140 0.049549 5.434837e+03 7.911319e+02
2574.0 1.472003e+09 1.472004e+09 3.461670 0.011458 -2.006431e+11 1.369992e+17 3.406538 0.049373 4.634212e+03 5.763962e+02
2586.0 1.472003e+09 1.472004e+09 3.426293 0.020737 1.884759e+04 4.128720e+03 3.617565 0.047060 5.521118e+03 7.404660e+02
3100.0 1.472003e+09 1.472004e+09 3.409925 0.020945 1.834381e+04 3.965346e+03 3.037804 0.033968 1.734748e+04 6.451273e+03
3112.0 1.472003e+09 1.472004e+09 3.478987 0.018635 2.707262e+04 7.554985e+03 3.272835 0.037545 1.942435e+04 8.298937e+03
3124.0 1.472003e+09 1.472004e+09 3.263333 0.019627 3.090669e+04 1.108251e+04 3.131942 0.034296 3.791194e+04 3.039378e+04
3136.0 1.472003e+09 1.472004e+09 3.264690 0.023235 3.630689e+04 1.810488e+04 3.375659 0.043900 -1.651556e+10 4.572386e+15

For each (tstart,tend) the fitting data is stored in this DataFrame. This means you can e.g. fit your data from [t0,t1], [t1,t2], etc., plot the complete data and then plot the individual fits on top.

In [17]:
t0fit=pytimber.parsedate("2016-08-24 03:34:00.000")
t1fit=pytimber.parsedate("2016-08-24 03:46:00.000")
t2fit=pytimber.parsedate("2016-08-24 03:50:00.000")
t3fit=pytimber.parsedate("2016-08-24 03:57:00.000")
t4fit=pytimber.parsedate("2016-08-24 04:08:00.000")

Here we perform the fit. The function bsrt.plot(..., fit=True) and bsrt.plot_fit() automatically generate this data, if no entry for the desired timestamp is found in bsrt.emit_fit. Just to show it, we use here the underlying function bsrt.fit.

In [18]:
for ts,te in [[t0fit,t1fit],[t1fit,t2fit],[t2fit,t3fit],[t3fit,t4fit]]:
    print(ts)
    print(te)
    bsrt.fit(ts,te,force=True)
1472002440.0
1472003160.0
1472003160.0
1472003400.0
/home/lcoyle/anaconda2/envs/python3/lib/python3.6/site-packages/scipy/optimize/minpack.py:787: OptimizeWarning: Covariance of the parameters could not be estimated
  category=OptimizeWarning)
1472003400.0
1472003820.0
1472003820.0
1472004480.0
In [19]:
bsrt.emit_fit
Out[19]:
ah sigah tauh sigtauh av sigav tauv sigtauv
slots t1 t2
50.0 1.472003e+09 1.472004e+09 3.592037 0.020030 3.963225e+04 1.691920e+04 3.009981 0.026124 -4.094221e+10 3.017460e+16
62.0 1.472003e+09 1.472004e+09 3.315585 0.021582 2.375362e+04 7.065574e+03 2.929291 0.046162 -1.795588e+09 6.247949e+13
74.0 1.472003e+09 1.472004e+09 3.748482 0.021306 2.523570e+04 6.972492e+03 3.257827 0.029117 -4.320898e+10 2.818150e+16
86.0 1.472003e+09 1.472004e+09 3.506898 0.020028 3.886294e+04 1.665643e+04 3.146739 0.031172 -1.767006e+10 3.514587e+15
300.0 1.472003e+09 1.472004e+09 3.554383 0.018634 2.039754e+04 4.193946e+03 2.956025 0.038580 9.647072e+03 2.307257e+03
312.0 1.472003e+09 1.472004e+09 3.326511 0.017004 2.601794e+04 6.664073e+03 2.827810 0.039674 8.047715e+03 1.716899e+03
324.0 1.472003e+09 1.472004e+09 3.450840 0.023239 2.623168e+04 8.930397e+03 2.972410 0.033245 8.847289e+03 1.659455e+03
336.0 1.472003e+09 1.472004e+09 3.520639 0.017930 2.375455e+04 5.530440e+03 3.129843 0.033302 1.110139e+04 2.496820e+03
550.0 1.472003e+09 1.472004e+09 3.725442 0.015662 3.822373e+04 1.217335e+04 3.246930 0.040297 7.073178e+03 1.200212e+03
562.0 1.472003e+09 1.472004e+09 3.362647 0.021711 2.268194e+04 6.553217e+03 3.038822 0.037994 6.409771e+03 9.893087e+02
574.0 1.472003e+09 1.472004e+09 3.433449 0.022893 2.494815e+04 8.187954e+03 3.139763 0.031778 6.584184e+03 8.451698e+02
586.0 1.472003e+09 1.472004e+09 3.387308 0.017594 2.947339e+04 8.924927e+03 3.148927 0.034682 5.405200e+03 6.161951e+02
800.0 1.472003e+09 1.472004e+09 3.295044 0.018147 2.380764e+04 6.157336e+03 2.933478 0.032773 5.141478e+03 5.638641e+02
812.0 1.472003e+09 1.472004e+09 3.349977 0.017933 1.424480e+04 2.131391e+03 3.112815 0.035364 5.171319e+03 5.807563e+02
824.0 1.472003e+09 1.472004e+09 3.380801 0.015665 1.865812e+04 3.174574e+03 3.053306 0.039257 4.567067e+03 5.095644e+02
836.0 1.472003e+09 1.472004e+09 3.399982 0.014041 -8.744571e+10 4.540639e+16 3.022022 0.037892 4.486479e+03 4.796314e+02
1050.0 1.472003e+09 1.472004e+09 3.475735 0.016054 2.799275e+04 7.152207e+03 3.028287 0.038504 4.293956e+03 4.442636e+02
1062.0 1.472003e+09 1.472004e+09 3.457277 0.021055 2.085617e+04 5.225401e+03 3.104601 0.040647 4.175971e+03 4.324621e+02
1074.0 1.472003e+09 1.472004e+09 3.323375 0.018940 2.442293e+04 6.710371e+03 3.066062 0.039847 4.440459e+03 4.864062e+02
1086.0 1.472003e+09 1.472004e+09 3.286255 0.019067 1.853434e+04 3.927811e+03 3.087283 0.047282 4.105192e+03 4.886258e+02
1300.0 1.472003e+09 1.472004e+09 3.576019 0.017566 5.559485e+04 3.013333e+04 3.170960 0.048480 4.005563e+03 4.634671e+02
1312.0 1.472003e+09 1.472004e+09 3.225916 0.019181 2.211467e+04 5.592142e+03 2.989050 0.042096 3.667257e+03 3.468330e+02
1324.0 1.472003e+09 1.472004e+09 3.393687 0.019479 2.679189e+04 7.931129e+03 3.104302 0.043922 3.817836e+03 3.781627e+02
1336.0 1.472003e+09 1.472004e+09 3.314602 0.012575 -1.241720e+11 8.661986e+16 3.126745 0.054374 4.123682e+03 5.441269e+02
1550.0 1.472003e+09 1.472004e+09 3.542046 0.016520 2.570762e+04 5.932958e+03 3.273096 0.041075 1.618393e+04 6.294225e+03
1562.0 1.472003e+09 1.472004e+09 3.166437 0.015021 3.985543e+04 1.453378e+04 3.222240 0.026741 2.038749e+04 6.618398e+03
1574.0 1.472003e+09 1.472004e+09 3.399230 0.019392 4.327992e+04 2.064224e+04 3.468519 0.042453 1.545083e+05 5.653345e+05
1586.0 1.472003e+09 1.472004e+09 3.236717 0.016530 2.041134e+04 4.083347e+03 3.569827 0.037587 2.372822e+04 1.139487e+04
1800.0 1.472003e+09 1.472004e+09 3.440406 0.017920 2.231168e+04 4.986305e+03 3.062221 0.035858 8.109158e+03 1.455138e+03
1812.0 1.472003e+09 1.472004e+09 3.258832 0.018824 2.422040e+04 6.513628e+03 3.022294 0.040012 7.140107e+03 1.269428e+03
... ... ... ... ... ... ... ... ... ... ...
1074.0 1.472004e+09 1.472004e+09 3.420344 0.017117 2.974364e+04 1.198162e+04 3.558246 0.037033 5.412579e+03 8.051697e+02
1086.0 1.472004e+09 1.472004e+09 3.390494 0.021149 2.025031e+04 6.896930e+03 3.645405 0.059139 6.382522e+03 1.751132e+03
1300.0 1.472004e+09 1.472004e+09 3.626127 0.019218 2.201197e+04 6.937550e+03 3.730487 0.041565 4.791891e+03 6.732609e+02
1312.0 1.472004e+09 1.472004e+09 3.386812 0.012842 -2.135274e+11 2.264662e+17 3.646126 0.043093 5.679179e+03 1.007178e+03
1324.0 1.472004e+09 1.472004e+09 3.504318 0.020878 1.368569e+09 3.007226e+13 3.664361 0.051156 4.330070e+03 6.850337e+02
1336.0 1.472004e+09 1.472004e+09 3.389947 0.018065 -2.127824e+11 1.383571e+17 3.641302 0.044751 4.455088e+03 6.400197e+02
1550.0 1.472004e+09 1.472004e+09 3.665396 0.022288 -3.536799e+05 2.067725e+06 3.424432 0.048211 -3.107387e+10 2.864413e+16
1562.0 1.472004e+09 1.472004e+09 3.225875 0.023096 1.458379e+04 4.096301e+03 3.354010 0.026281 -2.068578e+11 2.653656e+17
1574.0 1.472004e+09 1.472004e+09 3.489368 0.014387 -6.093536e+10 3.359575e+16 3.414735 0.043579 1.203523e+04 4.956604e+03
1586.0 1.472004e+09 1.472004e+09 3.327596 0.021249 1.781769e+04 5.465587e+03 3.702198 0.054917 -9.977291e+09 2.777665e+15
1800.0 1.472004e+09 1.472004e+09 3.556786 0.020619 2.265727e+04 8.034084e+03 3.371759 0.049534 2.198717e+04 1.916909e+04
1812.0 1.472004e+09 1.472004e+09 3.334979 0.021977 2.386815e+04 1.014707e+04 3.286208 0.049845 7.117039e+03 2.043674e+03
1824.0 1.472004e+09 1.472004e+09 3.537802 0.020742 2.520284e+04 1.006262e+04 3.618038 0.049159 -7.882468e+10 1.181892e+17
1836.0 1.472004e+09 1.472004e+09 3.478556 0.026758 1.662291e+04 5.719434e+03 3.500631 0.051955 7.012747e+03 1.937893e+03
2050.0 1.472004e+09 1.472004e+09 3.479603 0.021308 1.435084e+04 3.393553e+03 3.853730 0.054980 5.918231e+03 1.323194e+03
2062.0 1.472004e+09 1.472004e+09 3.488314 0.013213 -2.022046e+11 2.455209e+17 4.166452 0.049255 8.002509e+03 2.017156e+03
2074.0 1.472004e+09 1.472004e+09 3.381221 0.014730 -2.640035e+11 2.917723e+17 4.018704 0.051097 7.311124e+03 1.809737e+03
2086.0 1.472004e+09 1.472004e+09 3.492438 0.015899 -1.078620e+11 9.063731e+16 4.426833 0.063228 5.877670e+03 1.305717e+03
2300.0 1.472004e+09 1.472004e+09 3.638624 0.010092 -2.282959e+11 1.895392e+17 3.952473 0.046490 6.910064e+03 1.493980e+03
2312.0 1.472004e+09 1.472004e+09 3.330703 0.019980 3.231183e+04 1.695266e+04 3.961012 0.063584 5.010642e+03 1.061808e+03
2324.0 1.472004e+09 1.472004e+09 3.349868 0.011673 -3.691538e+11 2.500267e+17 4.064090 0.043528 6.681530e+03 1.271368e+03
2336.0 1.472004e+09 1.472004e+09 3.204183 0.020177 2.923251e+04 1.456405e+04 4.320540 0.055141 1.126148e+04 4.341766e+03
2550.0 1.472004e+09 1.472004e+09 3.431148 0.014369 -7.908823e+10 5.792492e+16 3.648448 0.042995 4.458153e+03 6.142235e+02
2562.0 1.472004e+09 1.472004e+09 3.574934 0.020864 2.497102e+04 9.851993e+03 3.917412 0.051539 4.158101e+03 5.963077e+02
2574.0 1.472004e+09 1.472004e+09 3.481116 0.020708 2.567351e+04 1.025160e+04 3.994812 0.051693 7.058304e+03 1.656687e+03
2586.0 1.472004e+09 1.472004e+09 3.540248 0.026259 3.556535e+04 2.455609e+04 4.079179 0.070285 5.027209e+03 1.107677e+03
3100.0 1.472004e+09 1.472004e+09 3.538361 0.023714 3.697937e+04 2.396807e+04 3.219504 0.036979 -3.149257e+10 2.678057e+16
3112.0 1.472004e+09 1.472004e+09 3.544462 0.021394 2.161230e+04 7.358372e+03 3.422144 0.050580 2.616876e+04 2.645074e+04
3124.0 1.472004e+09 1.472004e+09 3.371570 0.016557 -1.328505e+11 1.069159e+17 3.215790 0.040565 1.764822e+04 1.022700e+04
3136.0 1.472004e+09 1.472004e+09 3.384327 0.013298 -4.209796e+11 3.602695e+17 3.459232 0.033370 -8.664368e+10 1.498130e+17

240 rows × 8 columns

and now we can do the plot

In [20]:
plt.figure()
for slot,c in zip([1062,1074],['b','r']):
    # plot the averaged data
    bsrt.plot(plane='v',t1=t0fit,t2=t4fit,slots=slot,avg=None,fit=False,color=c)
    # now add the fit data with a black line
    for ts,te in [[t0fit,t1fit],[t1fit,t2fit],[t2fit,t3fit],[t3fit,t4fit]]:
        bsrt.plot_fit(plane='v',t1=ts,t2=te,slots = slot, color=c)