<jupyter_start><jupyter_text>ImportsRheology package must be installed on local computer.<jupyter_code>import pandas as pd
import rheology as rh
import math<jupyter_output><empty_output><jupyter_text>Load Data Load raw data into a pandas dataframe for each sample (n). Make sure all columns in the csv has cell **type "Number" with no , separating 1000.** Also ensure to **delete the notes at the top of the csv with the parameters being the first row** (Meas. Pts., Time, Storage Modulus, etc.).<jupyter_code># PXP 37C data
p1 = pd.read_csv('exampledata/PXP_N1.csv', encoding="ISO-8859-1")
p2 = pd.read_csv('exampledata/PXP_N2.csv', encoding="ISO-8859-1")
p3 = pd.read_csv('exampledata/PXP_N3.csv', encoding="ISO-8859-1")
p4 = pd.read_csv('exampledata/PXP_N4.csv', encoding="ISO-8859-1")

# TXT 37C data
t1 = pd.read_csv('exampledata/TXT_N1.csv', encoding="ISO-8859-1")
t2 = pd.read_csv('exampledata/TXT_N2.csv', encoding="ISO-8859-1")
t3 = pd.read_csv('exampledata/TXT_N3.csv', encoding="ISO-8859-1")
t4 = pd.read_csv('exampledata/TXT_N4.csv', encoding="ISO-8859-1")<jupyter_output><empty_output><jupyter_text>Parse the data into each test using `rh.all_tests_n(df)`. This will return a dictionary where each entry corresponds to a separate test in the rheology protocol. See below for the dictionary keys.0 : time sweep \1 : frequency sweep \2 : time sweep \3 : strain sweep \4 : time sweep \5 : cyclic strain sweep \6 : shear thinning test<jupyter_code>pxp = rh.all_tests(p1, p2, p3, p4)
txt = rh.all_tests(t1, t2, t3, t4)<jupyter_output><empty_output><jupyter_text>Average Storage Modulus<jupyter_code>sm_pxp = rh.storage_modulus(pxp)
sm_txt = rh.storage_modulus(txt)

name = ["n1 G' [Pa]", "n2 G' [Pa]", "n3 G' [Pa]", "n4 G' [Pa]"]

sm = pd.DataFrame([sm_pxp, sm_txt], columns=name, index=['RGD.PXP.RGD', 'T40A'])
sm['Mean'] = sm.mean(axis=1)
sm<jupyter_output><empty_output><jupyter_text>Angular Frequency Crossover<jupyter_code>name = ['n1 [rad/s]', 'n2 [rad/s]', 'n3 [rad/s]', 'n4 [rad/s]']

aco_pxp = rh.crossover(pxp, name, cotype=2)
aco_pxp = aco_pxp.rename(index={'Frequency Sweep 1': 'RGD.PXP.RGD'})
aco_txt = rh.crossover(txt, name, cotype=2)
aco_txt = aco_txt.rename(index={'Frequency Sweep 1': 'T40A'})
frames = [aco_pxp, aco_txt]
aco = pd.concat(frames)
aco<jupyter_output><empty_output><jupyter_text>Strain Crossover<jupyter_code>name = ['n1 %Strain', 'n2 %Strain', 'n3 %Strain', 'n4 %Strain']

sco_pxp = rh.crossover(pxp, name, cotype=1)
sco_pxp = sco_pxp.rename(index={'Strain Sweep 3': 'RGD.PXP.RGD'})
sco_txt = rh.crossover(txt, name, cotype=1)
sco_txt = sco_txt.rename(index={'Strain Sweep 3': 'T40A'})
frames = [sco_pxp, sco_txt]
sco = pd.concat(frames, sort=False)
sco<jupyter_output><empty_output><jupyter_text>Recovery Time $t_{1/2}$<jupyter_code>start = [1081, 1727, 2373, 3019]
name = ['n1 t1/2 [s]', 'n2 t1/2 [s]', 'n3 t1/2 [s]', 'n4 t1/2 [s]']

rth_pxp = rh.recovery(start, pxp, name, rtype=1)
rth_pxp = rth_pxp.rename(index={'Cyclic Strain Sweep 5': 'RGD.PXP.RGD'})
rth_txt = rh.recovery(start, txt, name, rtype=1)
rth_txt = rth_txt.rename(index={'Cyclic Strain Sweep 5': 'T40A'})
frames = [rth_pxp, rth_txt]
rth = pd.concat(frames, sort=False)
rth<jupyter_output><empty_output><jupyter_text>Recovery Time Crossover $t$<jupyter_code>name = ['n1 t [s]', 'n2 t [s]', 'n3 t [s]', 'n4 t [s]']

rco_pxp = rh.recovery(start, pxp, name, rtype=2)
rco_pxp = rco_pxp.rename(index={'Cyclic Strain Sweep 5': 'RGD.PXP.RGD'})
rco_txt = rh.recovery(start, txt, name, rtype=2)
rco_txt = rco_txt.rename(index={'Cyclic Strain Sweep 5': 'T40A'})
frames = [rco_pxp, rco_txt]
rco = pd.concat(frames, sort=False)
rco<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16680339075745146, 'fraction_numerical': 0.04156412359857807, 'mean_word_length': 6.18664047151277, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '538749', 'license': 'MIT', 'n_tokens_mistral': 1681, 'n_tokens_neox': 1586, 'n_words': 347, 'path': 'Calculations_Example.ipynb', 'repo_name': 'jennybennett/rheology', 'size': '3657'}