Skip to content

Commit

Permalink
Merge branch 'release_6.0.0' into 2908-links-in-tutorialrst-dont-resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-wilkins authored Jul 2, 2024
2 parents 3811500 + c703ae4 commit 9464834
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/sas/qtgui/Perspectives/Corfunc/media/corfunc-technical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,14 @@ The structural parameters extracted are:
* Long Period :math:`= L_p`
* Average Hard Block Thickness :math:`= L_c`
* Average Core Thickness :math:`= D_0`
* Average Interface Thickness :math:`\text{} = D_{tr}`
* Average Interface Thickness :math:`= D_{tr}`
* Eekhaut Polydispersity :math:`= \Gamma_{\text{min}}/\Gamma_{\text{max}}`
* Stribeck Polydispersity
* Stribeck Polydispersity :math:`= \frac{L_c}{(L_c - L_p)\Gamma_{\text{max}}}`
* Local Crystallinity :math:`= L_c/L_p`

which lead to:

* Average Soft Block Thickness :math:`= L_p - L_c = L_a`
* Average Chord Length :math:`= ((1/L_c) + (1/L_a)) :sup:`-1``
* Average Crystalline Chord Length :math:`= ((1/L_c) + (1/L_a)) :sup:`-1` / \Phi_{\text{c}}`
* Non-Ideality :math:`= (L_p – L_p*) :sup:`2` / L_p :sup:`2``
* Average Chord Length :math:`= ((1/L_c) + (1/L_a))^{-1}`
* Average Crystalline Chord Length :math:`= \frac{L_a L_c}{\Phi_{\text{c}} (L_c + L_a)}`
* Non-Ideality :math:`= \left(\frac{L_p – L_p*}{L_p}\right)^2`
6 changes: 3 additions & 3 deletions src/sas/sascalc/corfunc/corfunc_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from scipy.interpolate import interp1d
from scipy.signal import argrelextrema
from scipy.fftpack import dct
from scipy.integrate import trapz, cumtrapz
from scipy.integrate import trapezoid, cumulative_trapezoid

from sas.sascalc.corfunc.calculation_data import (TransformedData,
LamellarParameters,
Expand Down Expand Up @@ -416,7 +416,7 @@ def _calculate_transforms(self):
# numerical approximation for increasing R using the trapezium rule
# Note: SasView 4.x series limited the range to xs <= 1000.0

gamma3 = cumtrapz(gamma1, xs) / xs[1:]
gamma3 = cumulative_trapezoid(gamma1, xs) / xs[1:]
gamma3 = np.hstack((1.0, gamma3)) # gamma3(0) is defined as 1

# Interface Distribution function
Expand All @@ -428,7 +428,7 @@ def _calculate_transforms(self):
# IDF(x) = int_0^inf q^4 * I(q) * cos(q*x) * dq
# => IDF(0) = int_0^inf q^4 * I(q) * dq

idf[0] = trapz(-qs ** 4 * (iqs - background), qs)
idf[0] = trapezoid(-qs ** 4 * (iqs - background), qs)
idf /= Q # Normalise using scattering invariant

transform1d = Data1D(xs, gamma1)
Expand Down
6 changes: 3 additions & 3 deletions src/sas/sascalc/corfunc/transform_thread.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from sas.sascalc.data_util.calcthread import CalcThread
from sasdata.dataloader.data_info import Data1D
from scipy.fftpack import dct
from scipy.integrate import trapz, cumtrapz
from scipy.integrate import trapezoid, cumulative_trapezoid
import numpy as np

class FourierThread(CalcThread):
Expand Down Expand Up @@ -44,7 +44,7 @@ def compute(self):
# gamma3(R) = 1/R int_{0}^{R} gamma1(x) dx
# numerical approximation for increasing R using the trapezium rule
# Note: SasView 4.x series limited the range to xs <= 1000.0
gamma3 = cumtrapz(gamma1, xs)/xs[1:]
gamma3 = cumulative_trapezoid(gamma1, xs)/xs[1:]
gamma3 = np.hstack((1.0, gamma3)) # gamma3(0) is defined as 1

if self.check_if_cancelled(): return
Expand All @@ -58,7 +58,7 @@ def compute(self):
# very large negative value.
# IDF(x) = int_0^inf q^4 * I(q) * cos(q*x) * dq
# => IDF(0) = int_0^inf q^4 * I(q) * dq
idf[0] = trapz(-qs**4 * (iqs-background), qs)
idf[0] = trapezoid(-qs**4 * (iqs-background), qs)
idf /= Q # Normalise using scattering invariant

except Exception as e:
Expand Down

0 comments on commit 9464834

Please sign in to comment.