Skip to content

Commit 0074e3a

Browse files
committed
dl.dipolarmodel now exports with the Bmodel, Pmodel, r and t
1 parent 6bd18d3 commit 0074e3a

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

deerlab/dipolarmodel.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numpy as np
77
from deerlab.dipolarkernel import dipolarkernel
8-
from deerlab.dipolarbackground import dipolarbackground
8+
from deerlab.dipolarbackground import dipolarbackground, dipolarbackgroundmodel
99
from deerlab.regoperator import regoperator
1010
from deerlab.dd_models import freedist
1111
from deerlab.model import Model,Penalty, link
@@ -212,7 +212,13 @@ def dipolarmodel(t, r=None, Pmodel=None, Bmodel=bg_hom3d, experiment=None, param
212212
Returns
213213
-------
214214
Vmodel : :ref:`Model`
215-
Dipolar signal model object.
215+
Dipolar signal model object. With these additional attributes:
216+
* ``t`` - The time axis of the model.
217+
* ``r`` - The distance axis of the model, only for two-spin systems.
218+
* ``Bmodel`` - The multi-pathway background model object used in the construction of the dipolar signal model.
219+
* ``Pmodel`` - The distance distribution model object used in the construction of the dipolar signal model.
220+
221+
216222
"""
217223

218224
# If distance axis not specified default to a long range one
@@ -629,6 +635,16 @@ def Vmultispin_nonlinear_fcn(*nonlin):
629635
max(t)+max(reftimes) + 3*experiment.pulselength + dt,
630636
dt)
631637

638+
#
639+
if Bmodel is not None:
640+
DipolarSignal.Bmodel = dipolarbackgroundmodel(experiment=experiment, basis=Bmodel, parametrization=parametrization, spins=spins, samespins=samespins)
641+
642+
if Pmodel is not None:
643+
DipolarSignal.Pmodel = Pmodel
644+
DipolarSignal.t = t
645+
if spins==2:
646+
DipolarSignal.r = r
647+
632648
return DipolarSignal
633649
#===============================================================================
634650

0 commit comments

Comments
 (0)