You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would expect generating a kernel with dl.dipolarkernel(t, r, B=B) would produce a kernel that incorporates the background signal however it does not:
You are not providing a modulation depth to dipolarkernel, so the function assumes it to be 100% (equivalent to calling the function one of the following ways:
K = dl.dipolarkernel(t, r, 1, B=B)
K = dl.dipolarkernel(t, r, pathways=1, B=B)
Consequently, you won't get an unmodulated component in the DEER trace. The modulated component, however, is attenuated. You can see this with a sufficiently steep background by comparing signal generated with the two following kernels:
Kb = dl.dipolarkernel(t, r, B=B)
K = dl.dipolarkernel(t, r)
So the behavior of dipolarkernel is as intended.
Maybe we can add a keyword argument lambda that is equivalent to pathways if only a single scalar is given. However, since the modulation is also a positional argument, I am not sure this is needed,
Here's a proposal, based in part on discussion with @luisfabib :
Make all dipolarkernel arguments except t and r keyword-only. (def dipolarkernel(t, r, *, ...). This makes sense, since there is no reason for any particular positional order of any arguments except t and r. For these two, positional arguments make sense, since V(t) = K(t,r)P(r).
Restrict pathways to accept only pathway lists, with default None.
Provide a new keyword argument that only accepts a single number and provides the modulation depth/amplitude for the standard single-pathway model.
Name for the new keyword argument:
lam as an abbreviation for lambda, which is the conventional symbol used for this quantity. lambda itself cannot be use, since it is a Python keyword.
mod is brief and accurate.
modamp is more explicit, although reminiscent of CW EPR modulation amplitude - which is probably not an issue.
moddepth is closest to the conventional name of this quantity, but the longest (contrast: background keyword is only one letter.)
Default value for the new keyword argument:
0.5 or so. Then both unmodulated and modulate contribution are visible. This solves the OP use case. If the user wants modulated only, they need to specify modamp=1 .
1. But then we still have the OP use case.
Make the default depend on whether a background is given in B or not: 1 if not given, 0.5 when given. This also solves the OP use case.
Here are the simplest calls to dipolarkernel:
dipolarkernel(t,r) # Default modulation depth (1 or 0.5), default background (None)dipolarkernel(t,r,modamp=0.2) # Mod.depth given, default background (None)dipolarkernel(t,r,B=bg_hom3d) # Default modulation depth (1 or 0.5), background givendipolarkernel(t,r,modamp=0.2,B=bg_hom3d) # Both mod.depth and background are given
I would expect generating a kernel with dl.dipolarkernel(t, r, B=B) would produce a kernel that incorporates the background signal however it does not:
The text was updated successfully, but these errors were encountered: