Experiments

Contains experiments and explorations of different features
#skew(cor2pgau)
#plt.plot(cor2pgau[:100])

Working on using a natural cubic spline interpolation

cortest = cor2pgau xvals = np.arange(0,len(cortest)) corspline = CubicSpline(xvals,cortest) plt.plot(xvals,cortest,‘o’) plt.plot(xvals,corspline(xvals)) plt.plot(np.arange(0,len(cortest),0.01),np.abs(corspline(np.arange(0,len(cortest),0.01))))

corvals = corspline(np.arange(0,len(cortest),0.1)) 100*(1 - ((np.amax(corvals) - np.amin(corvals))/2.3547816195993403)) #2.3547816195993403 Ref

np.amin(corspline(np.arange(0,100,0.01)))

np.arange(0, len(cor2pgau),1)

from scipy.integrate import quad

x = np.arange(0, len(cor2pgau)-500,1) y = cor2pgau[250:-250]

Fit a cubic spline

cs = CubicSpline(x, y) amhs = []

for i in range(0,4750,250): interval_start = i interval_end = interval_start + 250

# Define the function for integration (absolute value of the spline)
def function_to_integrate(x):
    return np.abs(cs(x))

# Calculate the arithmetic mean height using quad integration
amh, _ = quad(function_to_integrate, interval_start, interval_end,limit=100)

# Divide by the length of the interval
interval_length = interval_end - interval_start
amh /= interval_length
amhs.append(amh)

print(“Arithmetic Mean Height:”, np.mean(amhs)) print(“Reference Mean Height:”, 0.14539179526852036)

x = np.arange(0, len(cor2pgau)-500,1) y = cor2pgau[250:-250]

Fit a cubic spline

cs = CubicSpline(x, y) amhs = []

for i in range(0,4750,250): interval_start = i interval_end = interval_start + 250

# Define the function for integration (absolute value of the spline)
def function_to_integrate(x):
    return np.square(cs(x))

# Calculate the arithmetic mean height using quad integration
amh, _ = quad(function_to_integrate, interval_start, interval_end,limit=75)

# Divide by the length of the interval
interval_length = interval_end - interval_start
amh /= interval_length
amhs.append(np.sqrt(amh))

print(“Arithmetic Rms:”, np.mean(amhs)) print(“Reference Rms:”, 0.195597300779425) print(‘% Difference’, (1-(np.mean(amhs)/0.195597300779425))*100)

plt.plot(x,cs(x)) plt.plot(x,y)

cs(x).shape

x = np.arange(0, len(cor2pgau)-500,.01) skew(cs(x))