-
Notifications
You must be signed in to change notification settings - Fork 47
Description
Describe the bug
As noted by @DrPaulSharp while reviewing PR #3833, when setting the first slider near the minimum value and running the calculation, warnings are thrown:
11:26:12 - WARNING: Low-q calculation failed: Rg expected positive value, but got -0.0
11:26:12 - WARNING: Calculation failed: Rg expected positive value, but got -0.0
The Guinier function:
Mathematically,
Lines 140-142 if invariant.py:
if slope > 0:
slope = 0.0
self.radius = math.sqrt(-3 * slope)So, the error message is misleading and prints the wrong value.
To Reproduce
Steps to reproduce the behavior:
- Load data onto Invariant perspective and input contrast value (here, used 10000A_sphere_dsm with
$contrast = 2e-6$ `) - Turn on low q extrapolation and set the low q end value close to data minimum (
$,4.2e-5$ ) - Run calculation
- See error
Expected behavior
- Run extrapolation for
$R_g = 0$ . - Show actual
$R_g$ value in error message
SasView version (please complete the following information):
- Version: 6.1.2 dev
Operating system (please complete the following information):
- OS: Windows 11
Installation method (please complete the following information):
- Installed: pip