Skip to content

Commit 05cf57a

Browse files
author
dpscience
committed
bug: weighted residuals (1/yi) fixed
bug: weighted residuals (1/yi) fixed
1 parent 3056576 commit 05cf57a

4 files changed

Lines changed: 11 additions & 6 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.pro.user
2+
*.user

Fit/lifetimedecayfit.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,16 @@ double weightedResidual(double y, double yi, double erryi, int weightingCode)
4444
break;
4545

4646
case 1: //y-variance weighting:
47-
weight = 1.0/yi;
47+
if (qFuzzyCompare(yi, 0.0) || yi < 0 || (int)yi <= 0)
48+
weight = 1;
49+
else
50+
weight = 1.0/yi;
4851

4952
residual = weight*(yi - y);
5053
break;
5154

5255
case 2: //y-error weighting:
53-
if (qFuzzyCompare(yi, 0.0) || yi < 0)
56+
if (qFuzzyCompare(yi, 0.0) || yi < 0 || (int)yi <= 0)
5457
weight = 1;
5558
else
5659
weight = 1.0/sqrt(yi);

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# DQuickLTFit <img src="https://github.com/dpscience/DQuickLTFit/blob/master/Images/IconPNGRounded.png" width="25" height="25">
1+
# DQuickLTFit <img src="https://github.com/dpscience/DQuickLTFit/blob/master/Images/IconPNGRounded.png" width="25" height="25">
22

3-
Copyright (c) 2016-2018 Danny Petschke (danny.petschke@uni-wuerzburg.de)<br><br>
3+
Copyright (c) 2016-2018 Danny Petschke (danny.petschke@uni-wuerzburg.de) All rights reserved.<br><br>
44
<b>DQuickLTFit</b> - A Least-Square Fitting Tool for the Analysis of Positron-Lifetime Spectra consisting of discrete specific Lifetimes using the Levenberg-Marquardt Algorithm<br>
55

66
![DQuickLTFit](/TestData/Software.png)

ltdefines.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
#define LTDEFINES
3131

3232
#define PROJECT_EXTENSION QString(".dquicklt")
33-
#define VERSION_STRING_AND_PROGRAM_NAME QString("DQuickLTFit v3.01")
34-
#define VERSION_RELEASE_DATE QString("27.03.2018")
33+
#define VERSION_STRING_AND_PROGRAM_NAME QString("DQuickLTFit v3.02")
34+
#define VERSION_RELEASE_DATE QString("17.04.2018")
3535

3636
#endif // LTDEFINES
3737

0 commit comments

Comments
 (0)