TLDR
For polydispersity calculations, if only pd_type and pdi are set, the curve is calculated as monodisperse
Expected behaviour
Testing in our group did not show any significant improvement in increasing the number of points or the number of sigmas used in the calculation of polydispersity compared to the defaults provided by the SASView GUI.
I would expect, from the general behaviour of sasview/sasmodels, that there is a default setting for "pd_n" and "pd_nsigma" while "_pd" and "_pd_type" should be mandatory.
bug
if the number of points is not set for the calculation of the $I_{poly}(q)$ it defaults to 1; see mwe below
Suggested fixes
# MWE
import numpy as np
from sasmodels.core import load_model
from sasmodels.direct_model import call_kernel
import matplotlib.pyplot as plt
q = np.logspace(-3, -0, 200)
# model = load_model("sphere")
model = load_model("sphere")
calculator = model.make_kernel([q])
pars = {
"radius_pd": 0.1,
"radius_pd_type": "lognormal",
# "radius_pd_n": 40,
"radius_pd_nsigma": 4,
}
Iq = call_kernel(calculator, pars)
plt.loglog(q, Iq, label="2 pd params")
pars = {
"radius_pd": 0.1,
"radius_pd_type": "lognormal",
"radius_pd_n": 40,
"radius_pd_nsigma": 4,
}
Iq = call_kernel(calculator, pars)
plt.loglog(q, Iq, label="3 pd params")
plt.tight_layout()
plt.legend()
plt.show()
TLDR
For polydispersity calculations, if only pd_type and pdi are set, the curve is calculated as monodisperse
Expected behaviour
Testing in our group did not show any significant improvement in increasing the number of points or the number of sigmas used in the calculation of polydispersity compared to the defaults provided by the SASView GUI.
I would expect, from the general behaviour of sasview/sasmodels, that there is a default setting for "pd_n" and "pd_nsigma" while "_pd" and "_pd_type" should be mandatory.
bug
if the number of points is not set for the calculation of the$I_{poly}(q)$ it defaults to 1; see mwe below
Suggested fixes