# -*- coding: utf-8 -*- """ Created on Mon Apr 20 15:48:08 2020 Bootstraps fits for Fig3 data (normalized w/ worm-like chain elasticity) by polymer Author: Ian L. Morgan email: ilmorgan@ucsb.edu """ import pandas as pd from datetime import date from functions.fitting import modelfunc,fit_bootstrap if __name__ == '__main__': results = pd.read_csv('../data/Fig3data_04-22-2020.csv') results = results.set_index(['polymer','relaxation']) # Choose indices as the polymers not points indices = results.index.unique(level='polymer').to_numpy() # Perform bootstrap popts,stderrs,chi2s = fit_bootstrap(results['fbar_mean'], results['bbar_mean'], results['bbar_std'], indices, modelfunc, reps = 10000) bootstrap_results = pd.DataFrame({'rho':popts, 'error':stderrs, 'chi2s':chi2s}) today = date.today() today = today.strftime("%m-%d-%Y") bootstrap_results.to_csv('../data/Fig3_bootstrap_results_%s.csv'%today,index=False)