Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix small issues, mostly docs (fixes #434) #435

Merged
merged 3 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions deerlab/dd_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,20 @@ def _gauss3(r,mean1,std1,mean2,std2,mean3,std3):
<img src="../_images/model_scheme_dd_gengauss.png", style="width: 50%">
<br><br><br>

:math:`P(r) = \frac{\beta}{2\sigma\Gamma(1/\beta)}\exp\left(-\left(\frac{(r-\left<r\right>)}{\sigma}\right)^\beta \right)`
:math:`P(r) = \frac{\beta}{2\sigma\Gamma(1/\beta)}\exp\left(-\left(\frac{|r-\left<r\right>|}{\sigma}\right)^\beta \right)`

where `\left<r\right>` is the mean distance,`\sigma` is the standard deviation, and `\beta` is the kurtosis of the distribution.
"""
def _gengauss(r,mean,std,kurt):
P = kurt/(2*std*spc.gamma(1/kurt))*np.exp(-abs(r-mean)/std**kurt)
where `\left<r\right>` is the mean distance,`\sigma` is the standard deviation, and `\beta` determines the shape of the distribution.
"""
def _gengauss(r,mean,std,beta):
P = beta/(2*std*spc.gamma(1/beta))*np.exp(-(abs(r-mean)/std)**beta)
return _normalize(r,P)
# Create model
dd_gengauss = Model(_gengauss,constants='r')
dd_gengauss.description = 'Generalized Gaussian distribution model'
# Parameters
dd_gengauss.mean.set(description='Mean', lb=1.0, ub=20, par0=3.5, unit='nm')
dd_gengauss.std.set(description='Standard deviation', lb=0.05, ub=2.5, par0=0.2, unit='nm')
dd_gengauss.kurt.set(description='Kurtosis', lb=0.25, ub=15, par0=5.0, unit='')
dd_gengauss.beta.set(description='beta parameter', lb=0.25, ub=15, par0=5.0, unit='')
# Add documentation
dd_gengauss.__doc__ = _dd_docstring(dd_gengauss,notes) + docstr_example('dd_gengauss')

Expand Down
12 changes: 6 additions & 6 deletions deerlab/deerload.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ def deerload(fullbasename, plot=False, full_output=False, *args,**kwargs):

Returns
-------
t : ndarray
t : ndarray, or list of ndarray
Time axis in microseconds. Its structure depends on the dimensionality of the experimental datasets:

* 1D-datasets: the time axis of ``N`` points is returned as a one-dimensional ndarray of shape ``(N,)``
* 2D-datasets: the ``M`` time-axes of ``N`` points are returned as a two-dimensional ndarray of shape ``(N,M)``. The i-th axis can be accessed via ``t[:,i]``.
* 1D datasets: the time axis is returned as a one-dimensional ndarray of shape ``(N,)``
* 2D datasets: the axes are returned as elements of a list, with the first axis typically being the time axis of shape ``(N,)``

V : ndarray
Experimental signal(s). Its structure depends on the dimensionality of the experimental datasets:

* 1D-datasets: the signal of ``N`` points is returned as a one-dimensional ndarray of shape ``(N,)``
* 2D-datasets: the ``M`` signals of ``N`` points are returned as a two-dimensional ndarray of shape ``(N,M)``. The i-th signal can be accessed via ``V[:,i]``.
* 1D datasets: the signal of ``N`` points is returned as a one-dimensional ndarray of shape ``(N,)``
* 2D datasets: the ``M`` signals of ``N`` points are returned as a two-dimensional ndarray of shape ``(N,M)``. The i-th signal can be accessed via ``V[:,i]``.

pars : dict
Parameter file entries, returned if ``full_output`` is ``True``.
Expand Down Expand Up @@ -217,7 +217,7 @@ def deerload(fullbasename, plot=False, full_output=False, *args,**kwargs):
abscissa = np.squeeze(abscissa)
abscissas = []
# Convert to list of abscissas
for absc in abscissa.T:
for absc in abscissa.T:
# Do not include abcissas full of NaNs
if not all(np.isnan(absc)):
# ns -> µs converesion
Expand Down
20 changes: 10 additions & 10 deletions deerlab/dipolarmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ def ex_3pdeer(tau, pathways=[1,2], pulselength=0.016):

pulselength : float scalar, optional
Length of the longest microwave pulse in the sequence in microseconds. Used to determine the uncertainty in the
boundaries of the pathay refocusing times.
boundaries of the pathway refocusing times.

Returns
-------
Expand Down Expand Up @@ -792,7 +792,7 @@ def ex_4pdeer(tau1, tau2, pathways=[1,2,3,4], pulselength=0.016):

pulselength : float scalar, optional
Length of the longest microwave pulse in the sequence in microseconds. Used to determine the uncertainty in the
boundaries of the pathay refocusing times.
boundaries of the pathway refocusing times.

Returns
-------
Expand Down Expand Up @@ -860,7 +860,7 @@ def ex_rev5pdeer(tau1, tau2, tau3, pathways=[1,2,3,4,5], pulselength=0.016):

pulselength : float scalar, optional
Length of the longest microwave pulse in the sequence in microseconds. Used to determine the uncertainty in the
boundaries of the pathay refocusing times.
boundaries of the pathway refocusing times.

Returns
-------
Expand Down Expand Up @@ -935,7 +935,7 @@ def ex_fwd5pdeer(tau1, tau2, tau3, pathways=[1,2,3,4,5], pulselength=0.016):

pulselength : float scalar, optional
Length of the longest microwave pulse in the sequence in microseconds. Used to determine the uncertainty in the
boundaries of the pathay refocusing times.
boundaries of the pathway refocusing times.

Returns
-------
Expand Down Expand Up @@ -979,7 +979,7 @@ def ex_sifter(tau1, tau2, pathways=[1,2,3], pulselength=0.016):
r"""
Generate a 4-pulse SIFTER dipolar experiment model.

The figure below shows the dipolar pathways in 4-pulse SIFTER. The observer (black) and pump (grey) pulses and their interpulse delays are shown on the top.
The figure below shows the dipolar pathways in 4-pulse SIFTER. The pulses and the interpulse delays are shown on the top.
The middle table summarizes all detectable modulated dipolar pathways `p` along their dipolar phase accumulation factors `\mathbf{s}_p`,
harmonics `\delta_p` and refocusing times `t_{\mathrm{ref},p}`. The most commonly encountered pathways are highlighted in color.
The bottom panel shows a decomposition of the dipolar signal into the individual intramolecular contributions (shown as colored lines).
Expand All @@ -1005,7 +1005,7 @@ def ex_sifter(tau1, tau2, pathways=[1,2,3], pulselength=0.016):

pulselength : float scalar, optional
Length of the longest microwave pulse in the sequence in microseconds. Used to determine the uncertainty in the
boundaries of the pathay refocusing times.
boundaries of the pathway refocusing times.

Returns
-------
Expand Down Expand Up @@ -1044,7 +1044,7 @@ def ex_ridme(tau1, tau2, pathways=[1,2,3,4], pulselength=0.016):
r"""
Generate a 5-pulse RIDME dipolar experiment model.

The figure below shows the dipolar pathways in 5-pulse RIDME. The observer (black) and pump (grey) pulses and their interpulse delays are shown on the top.
The figure below shows the dipolar pathways in 5-pulse RIDME. The pulses and their interpulse delays are shown on the top.
The middle table summarizes all detectable modulated dipolar pathways `p` along their dipolar phase accumulation factors `\mathbf{s}_p`,
harmonics `\delta_p` and refocusing times `t_{\mathrm{ref},p}`. The most commonly encountered pathways are highlighted in color.
The bottom panel shows a decomposition of the dipolar signal into the individual intramolecular contributions (shown as colored lines).
Expand All @@ -1069,7 +1069,7 @@ def ex_ridme(tau1, tau2, pathways=[1,2,3,4], pulselength=0.016):

pulselength : float scalar, optional
Length of the longest microwave pulse in the sequence in microseconds. Used to determine the uncertainty in the
boundaries of the pathay refocusing times.
boundaries of the pathway refocusing times.

Returns
-------
Expand Down Expand Up @@ -1110,7 +1110,7 @@ def ex_dqc(tau1, tau2, tau3, pathways=[1,2,3], pulselength=0.016):
r"""
Generate a 6-pulse DQC dipolar experiment model.

The figure below shows the dipolar pathways in 6-pulse DQC. The observer (black) and pump (grey) pulses and their interpulse delays are shown on the top.
The figure below shows the dipolar pathways in 6-pulse DQC. The pulses and their interpulse delays are shown on the top.
The middle table summarizes all detectable modulated dipolar pathways `p` along their dipolar phase accumulation factors `\mathbf{s}_p`,
harmonics `\delta_p` and refocusing times `t_{\mathrm{ref},p}`. The most commonly encountered pathways are highlighted in color.
The bottom panel shows a decomposition of the dipolar signal into the individual intramolecular contributions (shown as colored lines).
Expand Down Expand Up @@ -1139,7 +1139,7 @@ def ex_dqc(tau1, tau2, tau3, pathways=[1,2,3], pulselength=0.016):

pulselength : float scalar, optional
Length of the longest microwave pulse in the sequence in microseconds. Used to determine the uncertainty in the
boundaries of the pathay refocusing times.
boundaries of the pathway refocusing times.

Returns
-------
Expand Down