aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-05-13 15:44:27 +0200
committerThomas White <taw@physics.org>2015-05-19 13:57:51 +0200
commitfeaae5a2c165218fedf41cbed27c0a3ff7ef8685 (patch)
tree25a934b34c9dccbb12fabc24fe21b30d83c695e9 /src
parentcda81d20360931fd036a242d1626e5636fd7b4cf (diff)
Don't choke on negative scaling factors
Diffstat (limited to 'src')
-rw-r--r--src/hrs-scaling.c2
-rw-r--r--src/post-refinement.c15
2 files changed, 4 insertions, 13 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index 1e51fd4c..2a50d06a 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -331,7 +331,7 @@ static void run_merge_job(void *vwargs, int cookie)
corr = exp(2.0*B*res*res) * get_lorentz(refl)
/ (G * get_partiality(refl));
- esd = get_esd_intensity(refl) * corr;
+ esd = fabs(get_esd_intensity(refl) * corr);
w = 1.0 / pow(esd, 0.5);
/* Running mean and variance calculation */
diff --git a/src/post-refinement.c b/src/post-refinement.c
index 3ab1950b..09a8b77a 100644
--- a/src/post-refinement.c
+++ b/src/post-refinement.c
@@ -299,18 +299,9 @@ static void apply_shift(Crystal *cr, int k, double shift)
break;
case GPARAM_OSF :
- if ( isnan(shift) ) {
- ERROR("Refusing nan shift of OSF\n");
- } else {
- t = crystal_get_osf(cr);
- t += shift;
- if ( t < 0.0 ) {
- ERROR("Refusing to make OSF negative.\n");
- exit(0);
- } else {
- crystal_set_osf(cr, t);
- }
- }
+ t = crystal_get_osf(cr);
+ t += shift;
+ crystal_set_osf(cr, t);
break;
case GPARAM_ASX :