##// END OF EJS Templates
Few fixes....
Few fixes. Whole LFR simulation WIP.

File last commit:

r676:0a7aa144c9d5 default
r682:c53e1b6b3045 default
Show More
PlotResults.ipynb
85 lines | 2.4 KiB | text/plain | TextLexer
In [ ]:
#%matplotlib qt
%matplotlib notebook
import matplotlib.pyplot as plt
#plt.rcParams["figure.figsize"] = [12,12]
import numpy as np
import pandas as pds
In [ ]:
def try_plot(df,ax,left,right):
    try:
        df[(df.index >= left) & (df.index <= right)].plot(ax=ax,subplots=True,legend=False)
    except:
        pass
    
def make_plots(path="./",left=50e-3,right=100e-3):
    inputSig = pds.read_csv(path+"/input.txt",delim_whitespace=True,header=None,names=["BIAS1","BIAS2","BIAS3","BIAS4","BIAS5","B1","B2","B3"])
    inputSig.index.name="TSTAMP"
    inputSig.index*=1./98304.
    fXSig=[]
    G=[0.89,0.87,0.89]
    [fXSig.append(pds.read_csv(
                path+"./output_f{0}.txt".format(F),index_col=0,delim_whitespace=True,header=None,
                names=["TSTAMP","BIAS1","BIAS4","BIAS5","B1","B2","B3"])) for F in range(3) ]
    for F in range(3):
        if len(fXSig[F].index):
            fXSig[F].index*=1e-9
            fXSig[F]/=G[F]
    axes=inputSig[(inputSig.index >= left) & (inputSig.index <= right)].filter(["BIAS1","BIAS4","BIAS5","B1","B2","B3"]).plot(subplots=True,layout=(3,2)) 
    [ try_plot(df,axes,left,right) for df in fXSig ]
    return inputSig,fXSig
    
In [ ]:
inputSig,fXSig=make_plots(left=0)