Commit 771a57a0 authored by Michael Rudolf's avatar Michael Rudolf
Browse files

Small updates and fixes:

 - Statistical calculations now use distribution fitting.
 - Error propagation with the `uncertainties` package.
 - Downsampling is now obeying the options.
 - No downsampling for VST tests
 - Added a batch script for multiple folders and some other tests.
 - Updated Setup instructions.
parent 13288ae3
...@@ -13,13 +13,13 @@ __DATE__: 20-Feb-2019 ...@@ -13,13 +13,13 @@ __DATE__: 20-Feb-2019
''' '''
import os
import time
import h5py import h5py
import matplotlib as mpl import matplotlib as mpl
import nptdms import nptdms
import numpy as np import numpy as np
import os
import time
from matplotlib import pyplot as plt from matplotlib import pyplot as plt
from scipy import optimize from scipy import optimize
...@@ -99,7 +99,7 @@ def picker_plot(exp): ...@@ -99,7 +99,7 @@ def picker_plot(exp):
def fit_bootstrap(p0, datax, datay, function, yerr_systematic=0.0): def fit_bootstrap(p0, datax, datay, function, yerr_systematic=0.0):
errfunc = lambda p, x, y: function(x, *p) - y def errfunc(p, x, y): return function(x, *p) - y
# Fit first time # Fit first time
pfit, perr = optimize.leastsq(errfunc, pfit, perr = optimize.leastsq(errfunc,
...@@ -115,7 +115,7 @@ def fit_bootstrap(p0, datax, datay, function, yerr_systematic=0.0): ...@@ -115,7 +115,7 @@ def fit_bootstrap(p0, datax, datay, function, yerr_systematic=0.0):
# 100 random data sets are generated and fitted # 100 random data sets are generated and fitted
ps = [] ps = []
for i in range(100): for i in range(200):
randomDelta = np.random.normal(0., sigma_err_total, len(datay)) randomDelta = np.random.normal(0., sigma_err_total, len(datay))
randomdataY = datay + randomDelta randomdataY = datay + randomDelta
......
...@@ -9,11 +9,13 @@ data of this data publication. ...@@ -9,11 +9,13 @@ data of this data publication.
# %%=============IMPORT===================================================== # %%=============IMPORT=====================================================
import os import os
from os.path import splitext
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np import numpy as np
from scipy import stats from scipy import stats
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from os.path import splitext
# %%==============PARAMETERS================================================= # %%==============PARAMETERS=================================================
A = 0.022619 # area of shear zone (= surface area of lid) (m^2) A = 0.022619 # area of shear zone (= surface area of lid) (m^2)
li = 0.0776 # inner lever (center cell to center of shear zone) li = 0.0776 # inner lever (center cell to center of shear zone)
......
...@@ -21,11 +21,11 @@ AppUpdatesURL={#MyAppURL} ...@@ -21,11 +21,11 @@ AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName} DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName} DefaultGroupName={#MyAppName}
AllowNoIcons=yes AllowNoIcons=yes
LicenseFile=D:\nextcloud\GitRepos\rst-evaluation\LICENSE.txt LicenseFile=C:\Users\mrudolf\Nextcloud\GitRepos\rst-evaluation\LICENSE
; Uncomment the following line to run in non administrative install mode (install for current user only.) ; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest ;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog PrivilegesRequiredOverridesAllowed=dialog
OutputDir=D:\nextcloud\GitRepos\rst-evaluation\installer OutputDir=C:\Users\mrudolf\Nextcloud\GitRepos\rst-evaluation\installer
OutputBaseFilename=setup_RST_pick_GUI OutputBaseFilename=setup_RST_pick_GUI
Compression=lzma Compression=lzma
SolidCompression=yes SolidCompression=yes
...@@ -61,8 +61,8 @@ Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl" ...@@ -61,8 +61,8 @@ Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files] [Files]
Source: "D:\nextcloud\GitRepos\rst-evaluation\dist\RST_pick_GUI\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion Source: "C:\Users\mrudolf\Nextcloud\GitRepos\rst-evaluation\dist\RST_pick_GUI\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\nextcloud\GitRepos\rst-evaluation\dist\RST_pick_GUI\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "C:\Users\mrudolf\Nextcloud\GitRepos\rst-evaluation\dist\RST_pick_GUI\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons] [Icons]
...@@ -72,4 +72,3 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de ...@@ -72,4 +72,3 @@ Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: de
[Run] [Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
:: for windows. :: for windows.
@ECHO OFF @ECHO OFF
:: Compute requirements.txt :: Compute requirements.txt
pipreqs --no-pin --force --print RSTpicking >> requirements.txt pipreqs --no-pin --force --print rstevaluation >> requirements.txt
pipreqs --no-pin --print FileConversion >> requirements.txt @REM pipreqs --no-pin --print FileConversion >> requirements.txt
pipreqs --no-pin --print ManualPicking >> requirements.txt @REM pipreqs --no-pin --print ManualPicking >> requirements.txt
pipreqs --no-pin --print RSTAnalysis >> requirements.txt @REM pipreqs --no-pin --print RSTAnalysis >> requirements.txt
:: Removes duplicates in requirements.txt :: Removes duplicates in requirements.txt
setlocal disableDelayedExpansion setlocal disableDelayedExpansion
...@@ -35,6 +35,6 @@ del "%sorted%" ...@@ -35,6 +35,6 @@ del "%sorted%"
:: Create executable :: Create executable
python -m pip install pyinstaller python -m pip install pyinstaller
pyinstaller --clean -y --icon "D:\nextcloud\GitRepos\rst-evaluation\RSTpicking\images\rst-evaluation_x256.ico" --add-data "D:\nextcloud\GitRepos\rst-evaluation\RSTpicking\images\rst-evaluation_x256.ico;images" "RSTpicking\RST_pick_GUI.py" pyinstaller --clean -y --icon "rstevaluation\images\rst-evaluation_x256.ico" --add-data "rstevaluation\images\rst-evaluation_x256.ico;images" "rstevaluation\rstevaluation\RST_pick_GUI.py"
:: Create installer (requires InnoSetup on $PATH) :: Create installer (requires InnoSetup on $PATH)
iscc "RST_pick_GUI.iss" iscc "RST_pick_GUI.iss"
""" Advanced data analysis functions for ringshear tester data """ """ Advanced data analysis functions for ringshear tester data """
import numpy as np import numpy as np
import scipy.optimize as spopt import scipy.optimize as spopt
import scipy.stats as stats
from uncertainties.core import ufloat
# =======================MUTUAL LINEAR REGRESSION============================== # =======================MUTUAL LINEAR REGRESSION==============================
...@@ -16,17 +18,18 @@ def rst_analmut(x, y): ...@@ -16,17 +18,18 @@ def rst_analmut(x, y):
[ [
(y[k+j]-y[k])/(x[k+j]-x[k]) (y[k+j]-y[k])/(x[k+j]-x[k])
for k in range(len(x)) for j in range(len(x)-k) for k in range(len(x)) for j in range(len(x)-k)
if not (x[k+j]-x[k]) == 0
] ]
) )
C = np.array([(y-m*x) for y, m, x in zip(ys, M, xs)]) C = np.array([(y-m*x) for y, m, x in zip(ys, M, xs)])
M = M[np.nonzero(np.isfinite(M))] # M = M[np.nonzero(np.isfinite(M))]
C = C[np.nonzero(np.isfinite(C))] # C = C[np.nonzero(np.isfinite(C))]
M_avg = np.mean(M) statsM = stats.norm.fit([d.n for d in M])
M_std = np.std(M) statsC = stats.norm.fit([d.n for d in C])
C_avg = np.mean(C) uncM = ufloat(statsM[0], 2*statsM[1])
C_std = np.std(C) uncC = ufloat(statsC[0], 2*statsC[1])
fric_mut = (M_avg, M_std, C_avg, C_std) fric_mut = (uncM, uncC)
data_mut = (M, C) data_mut = (M, C)
return fric_mut, data_mut return fric_mut, data_mut
...@@ -57,8 +60,17 @@ def rst_analstd(x, y): ...@@ -57,8 +60,17 @@ def rst_analstd(x, y):
using 100 randomized sets of data. using 100 randomized sets of data.
""" """
x = np.array(x) x = np.array(x)
y = np.array(y) ynv = np.array([d.nominal_value for d in y])
pfit, perr = fit_bootstrap(x, y, fitfric) yerr = np.array([d.std_dev for d in y])
# pfit, perr = fit_bootstrap(x, ynv, fitfric, yerr_systematic=10,
# yerr=yerr)
pfit, pcov = spopt.curve_fit(
fitfric,
x, ynv,
sigma=yerr
)
perr = np.sqrt(np.diag(pcov))
y_fit = fitfric(x, *pfit) y_fit = fitfric(x, *pfit)
return (pfit[0], perr[0], pfit[1], perr[1], y_fit) return (pfit[0], perr[0], pfit[1], perr[1], y_fit)
...@@ -98,7 +110,8 @@ def vst_analysis(data): ...@@ -98,7 +110,8 @@ def vst_analysis(data):
# %%======================BOOTSTRAP LINEAR REGRESSION========================== # %%======================BOOTSTRAP LINEAR REGRESSION==========================
def fit_bootstrap(datax, datay, function=None, def fit_bootstrap(datax, datay, function=None,
yerr_systematic=0.0, nsigma=2, nsets=100): yerr_systematic=0.0, nsigma=2, nsets=100,
yerr=None):
""" """
Does a bootstrap fit of datax and datay by fitting a number of nsets. Each Does a bootstrap fit of datax and datay by fitting a number of nsets. Each
set contains normal distributed noise derived from the standard deviation set contains normal distributed noise derived from the standard deviation
...@@ -115,7 +128,7 @@ def fit_bootstrap(datax, datay, function=None, ...@@ -115,7 +128,7 @@ def fit_bootstrap(datax, datay, function=None,
return function(x, *p) - y return function(x, *p) - y
# Fit first time # Fit first time
pfit, _ = spopt.curve_fit(function, datax, datay) pfit, _ = spopt.curve_fit(function, datax, datay, sigma=yerr)
# Get the stdev of the residuals # Get the stdev of the residuals
residuals = errfunc(pfit, datax, datay) residuals = errfunc(pfit, datax, datay)
...@@ -128,7 +141,8 @@ def fit_bootstrap(datax, datay, function=None, ...@@ -128,7 +141,8 @@ def fit_bootstrap(datax, datay, function=None,
for _ in range(nsets): for _ in range(nsets):
randomDelta = np.random.normal(0., sigma_err_total, len(datay)) randomDelta = np.random.normal(0., sigma_err_total, len(datay))
randomdataY = datay + randomDelta randomdataY = datay + randomDelta
randomfit, _ = spopt.curve_fit(function, datax, randomdataY) randomfit, _ = spopt.curve_fit(
function, datax, randomdataY, sigma=yerr)
ps.append(randomfit) ps.append(randomfit)
ps = np.array(ps) ps = np.array(ps)
mean_pfit = np.mean(ps, axis=0) mean_pfit = np.mean(ps, axis=0)
......
...@@ -11,6 +11,7 @@ import shutil ...@@ -11,6 +11,7 @@ import shutil
import nptdms import nptdms
import numpy as np import numpy as np
import uncertainties as unc
from tqdm import tqdm from tqdm import tqdm
from . import data as rstdat from . import data as rstdat
...@@ -41,14 +42,18 @@ def convert(path, file_in, config): ...@@ -41,14 +42,18 @@ def convert(path, file_in, config):
(data['shearstress'] * (var['li']*var['A'])) / var['lo'] (data['shearstress'] * (var['li']*var['A'])) / var['lo']
) )
nsamples = var['nsamples'] nsamples = var['nsamples']
if len(data['time']) > nsamples: if (
len(data['time']) > nsamples and
config.getboolean('parameters', 'downsample_filter') and
not config.getboolean('options', 'is_VST')
):
freq = 1/data['time'][1] freq = 1/data['time'][1]
R = int(freq / 5) R = int(freq / 5)
data['velocity'] = rstdat.downsample_data(data['velocity'], R) data['velocity'] = rstdat.downsample_data(data['velocity'], R)
data['shearforce'] = rstdat.downsample_data(data['shearforce'], R) data['shearforce'] = rstdat.downsample_data(data['shearforce'], R)
data['normalforce'] = rstdat.downsample_data(data['normalforce'], R) data['normalforce'] = rstdat.downsample_data(data['normalforce'], R)
data['time'] = np.linspace(0, data['time'][-1], len(data['velocity'])) data['time'] = np.linspace(0, data['time'][-1], len(data['velocity']))
print('Data to large... Downsampled to 5 Hz.') print('Data too large... Downsampled to 5 Hz.')
# Corrections # Corrections
data['time'] = data['time']-data['time'][0] data['time'] = data['time']-data['time'][0]
...@@ -278,15 +283,12 @@ def saveStrength(path, name, strength): ...@@ -278,15 +283,12 @@ def saveStrength(path, name, strength):
""" Saves the picked datapoints. """ """ Saves the picked datapoints. """
label = ['_peak', '_dynamic', '_reactivation'] label = ['_peak', '_dynamic', '_reactivation']
for i in range(0, 3): for i in range(0, 3):
Stren = np.vstack((np.round(strength[0], 2), Stren = np.vstack((strength[0], strength[i+1]))
np.round(strength[i+1], 2)))
header_stress = 'Normal stress [Pa]'+'\t'+'Shear strength [Pa]' header_stress = 'Normal stress [Pa]'+'\t'+'Shear strength [Pa]'
with open(path+name+label[i]+'.txt', "w") as f: with open(os.path.join(path, name+label[i]+'.txt'), "w") as f:
f.write(header_stress+'\n') f.write(header_stress+'\n')
for row in Stren.T: for strdat in Stren.T:
csv.writer(f, f.write('{:}\t{:fP}'.format(strdat[0], strdat[1]))
delimiter='\t',
lineterminator='\n').writerow(row)
f.closed f.closed
...@@ -301,70 +303,56 @@ def saveFric(path, name, fricmut, fricstd): ...@@ -301,70 +303,56 @@ def saveFric(path, name, fricmut, fricstd):
'Cohesion [Pa]' + \ 'Cohesion [Pa]' + \
'\t' + \ '\t' + \
'Std deviation (Coh.) [Pa]' 'Std deviation (Coh.) [Pa]'
with open(path+name+'_fricstd.txt', 'w') as f: with open(os.path.join(path, name+'_fricstd.txt'), 'w') as f:
f.write(header+'\n') f.write(header+'\n')
f_string = '' f_string = ''
f_string += 'Peak friction:' + \ mferr = unc.ufloat(fricstd[0][0], fricstd[0][1])
'\t' + \ cferr = unc.ufloat(fricstd[0][2], fricstd[0][3])
str(np.around(fricstd[0][0], 4)) + \ f_string += (
'\t'+str(np.around(fricstd[0][1], 4)) + \ 'Peak friction:' +
'\t'+str(np.around(fricstd[0][2], 4)) + \ '\t{:fP}'.format(mferr) +
'\t'+str(np.around(fricstd[0][3], 4)) + \ '\t{:fP}'.format(cferr) +
'\n' '\n'
f_string += 'Dynamic friction:' + \ )
'\t' + \ mferr = unc.ufloat(fricstd[1][0], fricstd[1][1])
str(np.around(fricstd[1][0], 4)) + \ cferr = unc.ufloat(fricstd[1][2], fricstd[1][3])
'\t' + \ f_string += (
str(np.around(fricstd[1][1], 4)) + \ 'Dynamic friction:' +
'\t' + \ '\t{:fP}'.format(mferr) +
str(np.around(fricstd[1][2], 4)) + \ '\t{:fP}'.format(cferr) +
'\t' + \ '\n'
str(np.around(fricstd[1][3], 4)) + \ )
'\n' mferr = unc.ufloat(fricstd[2][0], fricstd[2][1])
f_string += 'Reactivation friction:' + \ cferr = unc.ufloat(fricstd[2][2], fricstd[2][3])
'\t' + \ f_string += (
str(np.around(fricstd[2][0], 4)) + \ 'Reactivation friction:' +
'\t' + \ '\t{:fP}'.format(mferr) +
str(np.around(fricstd[2][1], 4)) + \ '\t{:fP}'.format(cferr) +
'\t' + \ '\n'
str(np.around(fricstd[2][2], 4)) + \ )
'\t' + \
str(np.around(fricstd[2][3], 4)) + \
'\n'
f.write(f_string) f.write(f_string)
f.closed f.closed
with open(path+name+'_fricmut.txt', 'w') as f: with open(os.path.join(path, name+'_fricmut.txt'), 'w') as f:
f.write(header+'\n') f.write(header+'\n')
f_string = '' f_string = ''
f_string += 'Peak friction:' + \ f_string += (
'\t' + \ 'Peak friction:' +
str(np.around(fricmut[0][0], 4)) + \ '\t{:fP}'.format(fricmut[0][0]) +
'\t' + \ '\t{:fP}'.format(fricmut[0][1]) +
str(np.around(fricmut[0][1], 4)) + \ '\n'
'\t' + \ )
str(np.around(fricmut[0][2], 4)) + \ f_string += (
'\t' + \ 'Dynamic friction:' +
str(np.around(fricmut[0][3], 4)) + \ '\t{:fP}'.format(fricmut[1][0]) +
'\n' '\t{:fP}'.format(fricmut[1][1]) +
f_string += 'Dynamic friction:' + \ '\n'
'\t' + \ )
str(np.around(fricmut[1][0], 4)) + \ f_string += (
'\t' + \ 'Reactivation friction:' +
str(np.around(fricmut[1][1], 4)) + \ '\t{:fP}'.format(fricmut[2][0]) +
'\t' + \ '\t{:fP}'.format(fricmut[2][1]) +
str(np.around(fricmut[1][2], 4)) + \ '\n'
'\t' + \ )
str(np.around(fricmut[1][3], 4)) + \
'\n'
f_string += 'Reactivation friction:' + \
'\t' + \
str(np.around(fricmut[2][0], 4)) + \
'\t' + \
str(np.around(fricmut[2][1], 4)) + \
'\t' + \
str(np.around(fricmut[2][2], 4)) + \
'\t' + \
str(np.around(fricmut[2][3], 4))+'\n'
f.write(f_string) f.write(f_string)
f.closed f.closed
...@@ -387,7 +375,7 @@ def savelidpos(path, name, p_ind, exp_data): ...@@ -387,7 +375,7 @@ def savelidpos(path, name, p_ind, exp_data):
rows.sort(key=operator.itemgetter(0)) rows.sort(key=operator.itemgetter(0))
with open(path+name+'_lidpos.txt', 'w+') as f: with open(os.path.join(path, name+'_lidpos.txt'), 'w+') as f:
w = csv.writer( w = csv.writer(
f, f,
delimiter=',') delimiter=',')
...@@ -416,7 +404,11 @@ def check_tdms(file_list, config): ...@@ -416,7 +404,11 @@ def check_tdms(file_list, config):
if cur_len > max_len: if cur_len > max_len:
max_len = cur_len max_len = cur_len
if max_len > config.getint('parameters', 'nsamples'): if (
max_len > config.getint('parameters', 'nsamples') and
config.getboolean('parameters', 'downsample_filter') and
not config.getboolean('options', 'is_VST')
):
print( print(
'Converting folder. Raw data files will be moved to raw_data.' 'Converting folder. Raw data files will be moved to raw_data.'
) )
...@@ -431,3 +423,7 @@ def check_tdms(file_list, config): ...@@ -431,3 +423,7 @@ def check_tdms(file_list, config):
shutil.move(file_path, new_path) shutil.move(file_path, new_path)
new_file_path = rstdat.downsample_file(new_path) new_file_path = rstdat.downsample_file(new_path)
shutil.move(new_file_path, file_path) shutil.move(new_file_path, file_path)
def main():
join
...@@ -405,12 +405,12 @@ class RST_pick_GUI(tk.Tk): ...@@ -405,12 +405,12 @@ class RST_pick_GUI(tk.Tk):
'li': 0.0776, # inner lever (center cell-center shear zone) 'li': 0.0776, # inner lever (center cell-center shear zone)
'lo': 0.1250, # outer lever (center cell-hinge point) 'lo': 0.1250, # outer lever (center cell-hinge point)
'vel': 30, # shear velocity (mm/min) 'vel': 30, # shear velocity (mm/min)
'prec': 500, # precision for normal stress in filenames 'prec': 10, # precision for normal stress in filenames
'velnoise': 1e-2, 'velnoise': 1e-2,
'stressnoise': 0.025, 'stressnoise': 0.025,
'cellweight': 2185.3, # weight of shear cell 'cellweight': 2185.3, # weight of shear cell
'smoothwindow': 5, # Smoothing Factor for plots 'smoothwindow': 5, # Smoothing Factor for plots
'pred_norms': [500, 1000, 2000, 4000, 8000, 16000, 20000], 'pred_norms': [500, 1000, 2000, 4000, 8000, 16000],
'nsamples': 10000, # Maximum number of samples to use 'nsamples': 10000, # Maximum number of samples to use
'downsample_filter': 0, # Use downsampling filter or not. 'downsample_filter': 0, # Use downsampling filter or not.
} }
......
...@@ -9,7 +9,9 @@ import sys ...@@ -9,7 +9,9 @@ import sys
import matplotlib as mpl import matplotlib as mpl
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import numpy as np import numpy as np
import uncertainties as unc
from scipy.signal import medfilt from scipy.signal import medfilt
from uncertainties import unumpy as unp
# %%==================EVALUATION SHEAR CURVE DATA============================== # %%==================EVALUATION SHEAR CURVE DATA==============================
...@@ -28,7 +30,6 @@ def eval_shearstress(cur_dat, config, review=None): ...@@ -28,7 +30,6 @@ def eval_shearstress(cur_dat, config, review=None):
'manual': 'manual':
skips automatic picking and opens a manual picking dialog skips automatic picking and opens a manual picking dialog
""" """
global picks
print('Picking %s' % cur_dat['name']) print('Picking %s' % cur_dat['name'])
if not review: if not review:
...@@ -67,7 +68,6 @@ def eval_shearstress(cur_dat, config, review=None): ...@@ -67,7 +68,6 @@ def eval_shearstress(cur_dat, config, review=None):
# Calculate relative weakening (after Ritter et al., 2016) # Calculate relative weakening (after Ritter et al., 2016)
weak = 1-(dyn[1]/peak[1]) weak = 1-(dyn[1]/peak[1])
weak_p = (peak[1]/dyn[1])-1 weak_p = (peak[1]/dyn[1])-1
return (normal, peak, dyn, stat, deltad, weak, weak_p, p_ind) return (normal, peak, dyn, stat, deltad, weak, weak_p, p_ind)
...@@ -78,6 +78,15 @@ def _auto_pick(cur_dat, config): ...@@ -78,6 +78,15 @@ def _auto_pick(cur_dat, config):
cur_dat['shearstress'], cur_dat['shearstress'],
config.getint('parameters', 'smoothwindow') config.getint('parameters', 'smoothwindow')
) )
shear_smth = unp.uarray(
shear_smth,
np.full_like(
shear_smth,
# estimated accuracy of machine (+-10 Pa)
# and error of sensor (0.5%)
np.sqrt(10**2 + (shear_smth*0.005)**2)
)
)
# Searching for velocity changes to define data range # Searching for velocity changes to define data range
vel_above = np.nonzero( vel_above = np.nonzero(
...@@ -145,22 +154,30 @@ def _manual_pick(cur_dat, config, ...@@ -145,22 +154,30 @@ def _manual_pick(cur_dat, config,
try: