aboutsummaryrefslogtreecommitdiff
path: root/src/hrs-scaling.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-06-02 16:56:50 +0200
committerThomas White <taw@physics.org>2014-06-02 16:56:50 +0200
commitd33093b793df13b9fc6bcf4b9569caaeb0431fff (patch)
treee9c7a5549e4303494ecfcd400cf4eaabe1a3260e /src/hrs-scaling.c
parent108ef182aae36252a8d37ddf443d05156b6161e5 (diff)
partialator: Remove --reference
It's not a good idea, and PR works well enough now that we no longer need this for testing
Diffstat (limited to 'src/hrs-scaling.c')
-rw-r--r--src/hrs-scaling.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/src/hrs-scaling.c b/src/hrs-scaling.c
index 9602836b..cba21b74 100644
--- a/src/hrs-scaling.c
+++ b/src/hrs-scaling.c
@@ -480,7 +480,7 @@ static int test_convergence(double *old_osfs, int n, Crystal **crystals)
/* Scale the stack of images */
-RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
+RefList *scale_intensities(Crystal **crystals, int n,
int n_threads, int noscale, PartialityModel pmodel,
int min_redundancy)
{
@@ -501,10 +501,8 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
return full;
}
- /* No reference -> create an initial list to refine against */
- if ( gref == NULL ) {
- full = lsq_intensities(crystals, n, n_threads, pmodel);
- }
+ /* Create an initial list to refine against */
+ full = lsq_intensities(crystals, n, n_threads, pmodel);
old_osfs = malloc(n*sizeof(double));
if ( old_osfs == NULL ) return NULL;
@@ -513,7 +511,6 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
i = 0;
do {
- RefList *reference;
double total_sf = 0.0;
int n_sf = 0;
double norm_sf;
@@ -524,14 +521,7 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
crystal_set_user_flag(crystals[j], 0);
}
- /* Refine against reference or current "full" estimates */
- if ( gref != NULL ) {
- reference = gref;
- } else {
- reference = full;
- }
-
- iterate_scale(crystals, n, reference, n_threads, pmodel);
+ iterate_scale(crystals, n, full, n_threads, pmodel);
/* Normalise the scale factors */
for ( j=0; j<n; j++ ) {
@@ -550,11 +540,9 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
reject_outliers(old_osfs, n, crystals);
done = test_convergence(old_osfs, n, crystals);
- /* No reference -> generate list for next iteration */
- if ( gref == NULL ) {
- reflist_free(full);
- full = lsq_intensities(crystals, n, n_threads, pmodel);
- }
+ /* Generate list for next iteration */
+ reflist_free(full);
+ full = lsq_intensities(crystals, n, n_threads, pmodel);
i++;
@@ -564,10 +552,6 @@ RefList *scale_intensities(Crystal **crystals, int n, RefList *gref,
ERROR("Warning: Scaling did not converge.\n");
}
- if ( gref != NULL ) {
- full = lsq_intensities(crystals, n, n_threads, pmodel);
- } /* else we already did it */
-
calculate_esds(crystals, n, full, n_threads, min_redundancy, pmodel);
free(old_osfs);