예제 #1
0
 def _Flip_X_Axis_fired(self):
     global files_selected
     for ifile in files_selected.file_list:
         this_plot = jpl.Plotting(plot_info={'save_file': ifile})
         if not os.path.isfile(this_plot.PickleFile):
             print('FNF:', this_plot.PickleFile)
             pass
         this_plot.LoadPickle(DefWipe=False)
         this_plot.Flip_X_Axis()
         this_plot.PlotAll()
         this_plot.close_fig()
예제 #2
0
def UpdateFileList(plot_info, rc_params, file_list, window_size=None):
    for ifile in file_list:
        this_plot = jpl.Plotting(plot_info={'save_file': ifile})
        if not os.path.isfile(this_plot.PickleFile):
            print('FNF:', this_plot.PickleFile)
            pass
        else:
            print('Updating:', this_plot.PickleFile)
        if window_size is not None:
            this_plot.LoadPickle(DefWipe=False, ForceWindowSize=window_size)
        else:
            this_plot.LoadPickle(DefWipe=False)

        this_plot.UpdateInfo(plot_info)
        pl.rcParams.update(rc_params)
        this_plot.PlotAll()
        this_plot.close_fig()
예제 #3
0
def TestAuto():
    '''
    testing function for standard autocorrelation analysis
    '''
    def thisFun(*x):
        return x[0]
    def thisDer(*x):
        return [1]

    const = 100
    this_size = 20000
    values = np.random.uniform(size=this_size)

    values2 = np.arange(this_size)/this_size

    values3 = np.random.normal(loc=0.5,scale=0.25,size=this_size)
    val_df = pa.DataFrame()

    # tuple_list = []
    # for ii in range(100):
    #     tuple_list.append(('-1-',ii))
    # for ii in range(400):
    #     tuple_list.append(('-2-',ii))
    # for ii in range(1000):
    #     tuple_list.append(('-3-',ii))
    # for ii in range(500):
    #     tuple_list.append(('-4-',ii))

    tuple_list = []
    for ii in range(this_size//2):
        tuple_list.append(('-1-',ii))
    for ii in range(this_size//2):
        tuple_list.append(('-2-',ii))
    #
    # tuple_list = []
    # for ii in range(this_size):
    #     tuple_list.append(('-1-',ii))

    indicies = pa.MultiIndex.from_tuples(tuple_list,names=['stream','configs'])
    # indicies = range(this_size)
    # val_df = pa.DataFrame()
    # val_df['one'] = pa.Series(values,index=indicies)
    # val_df['two'] = pa.Series(values2,index=indicies)
    # val_df['three'] = pa.Series(values3,index=indicies)
    # def RatFun(one,two,three):
    #     return const*one/(two*three)
    #
    # def RatFunDer(one,two,three):
    #     return [const/(two*three),-const*one/(three*two**2),-const*one/(two*three**2)]

    val_df = pa.DataFrame()
    val_df['one'] = pa.Series(values,index=indicies)
    val_df['two'] = pa.Series(values2,index=indicies)
    val_df['three'] = pa.Series(values3,index=indicies)
    def RatFun(one,two):
        return const*one*two

    def RatFunDer(one,two):
        return [const*two,const*one]

    testdata = AutoCorrelate(Fun=[thisFun,thisDer],name='test_bootstrap_uniform',data=val_df[['one']])
    testdata2 = AutoCorrelate(Fun=[thisFun,thisDer],name='test_bootstrap_arange',data=val_df[['two']])
    testdata3 = AutoCorrelate(Fun=[thisFun,thisDer],name='test_bootstrap_normal',data=val_df[['three']])
    testdatarat = AutoCorrelate(Fun=[RatFun,RatFunDer],name='test_auto_ratio',data=val_df[['one','two']])

    this_info = pa.Series()
    this_info['save_file'] = this_dir+'/TestGraphs/test_Wopt.pdf'
    this_info['title'] = 'Test Auto Graph'
    # this_info['xlims'] = [0,10]
    # this_info['ylims'] = [0,15]
    import PlotData as jpl
    data_plot = jpl.Plotting(plot_info=this_info)
    data_plot = testdata.PlotWopt(data_plot)
    data_plot = testdata2.PlotWopt(data_plot)
    data_plot = testdata3.PlotWopt(data_plot)
    data_plot = testdatarat.PlotWopt(data_plot)
    # data_plot.LoadPickle(DefWipe=False)
    data_plot.PrintData()
    data_plot.PlotAll()

    this_info = pa.Series()
    this_info['save_file'] = this_dir+'/TestGraphs/test_Auto.pdf'
    this_info['title'] = 'Test Auto Graph'
    # this_info['xlims'] = [0,10]
    # this_info['ylims'] = [0,15]
    import PlotData as jpl
    data_plot = jpl.Plotting(plot_info=this_info)
    data_plot = testdata.PlotTauInt(data_plot)
    data_plot = testdata2.PlotTauInt(data_plot)
    data_plot = testdata3.PlotTauInt(data_plot)
    data_plot = testdatarat.PlotTauInt(data_plot)
    # data_plot.LoadPickle(DefWipe=False)
    data_plot.PrintData()
    data_plot.PlotAll()

    return testdata,testdata2,testdata3,testdatarat
예제 #4
0
\hoffset -1.5cm
\headsep 1.5cm
\parindent 1.2em
\baselineskip 16pt plus 2pt minus 2pt
\begin{document}
\tiny
'''

this_info = pa.Series()
mat_graph_folder = data_dir + 'MatHack/'
mkdir_p(mat_graph_folder)
this_info['save_file'] = mat_graph_folder + 'FitrComp.pdf'
this_info['title'] = r'fitr comp'
this_info['xlabel'] = r'$\sqrt{8t}/\sqrt{8t_{0}}$'
this_info['ylabel'] = r'ratio'
data_plot = jpl.Plotting(plot_info=this_info)
table_out = {}
for iens, ifile in zip(master_ens_list, this_filelist):
    for iblock in block_flags:
        this_file = ifile.replace('.py3p', iblock + '.py3p')
        if os.path.isfile(this_file):
            print('Reading: ', this_file)
            with open(this_file, 'rb') as f:
                fit_data, dump = pik.load(f)
            data_plot = fit_data.PlotVaryFitr(data_plot)
            fit_data.SortChi()
            table_out[fit_data.name] = fit_data.Get_Formatted_Table(
                fmt_latex=True).to_latex(escape=False).replace(
                    '{}', fit_data.name.replace('_', r'\_'))
        else:
            print('FNF: ', this_file)