From 928bb3071bb73650404161481d450d09ed25ae9a Mon Sep 17 00:00:00 2001 From: Thomas White Date: Wed, 2 May 2018 11:59:48 +0200 Subject: Remove scale_all_to_reference --- src/partialator.c | 17 ++++++----------- src/scaling.c | 39 --------------------------------------- src/scaling.h | 3 --- 3 files changed, 6 insertions(+), 53 deletions(-) (limited to 'src') diff --git a/src/partialator.c b/src/partialator.c index a17e1b24..fc3f86c2 100644 --- a/src/partialator.c +++ b/src/partialator.c @@ -1334,12 +1334,6 @@ int main(int argc, char *argv[]) full = reference; } - /* Scale everything to the reference */ - STATUS("Initial scaling to reference...\n"); - if ( !no_scale ) { - scale_all_to_reference(crystals, n_crystals, full, nthreads); - } - /* Check rejection and write figures of merit */ check_rejection(crystals, n_crystals, full, max_B); show_all_residuals(crystals, n_crystals, full); @@ -1356,14 +1350,14 @@ int main(int argc, char *argv[]) if ( !no_pr ) { refine_all(crystals, n_crystals, full, nthreads, pmodel, 0, i+1, no_logs, sym, amb); - } else if ( !no_scale ) { - scale_all_to_reference(crystals, n_crystals, full, nthreads); } /* Create new reference if needed */ if ( reference == NULL ) { reflist_free(full); - scale_all(crystals, n_crystals, nthreads); + if ( !no_scale ) { + scale_all(crystals, n_crystals, nthreads); + } full = merge_intensities(crystals, n_crystals, nthreads, min_measurements, push_res, 1); @@ -1408,12 +1402,13 @@ int main(int argc, char *argv[]) STATUS("Final merge...\n"); if ( reference == NULL ) { reflist_free(full); - scale_all(crystals, n_crystals, nthreads); + if ( !no_scale ) { + scale_all(crystals, n_crystals, nthreads); + } full = merge_intensities(crystals, n_crystals, nthreads, min_measurements, push_res, 1); } else { - scale_all_to_reference(crystals, n_crystals, reference, nthreads); full = merge_intensities(crystals, n_crystals, nthreads, min_measurements, push_res, 1); } diff --git a/src/scaling.c b/src/scaling.c index f4c93c66..39541926 100644 --- a/src/scaling.c +++ b/src/scaling.c @@ -448,22 +448,6 @@ void scale_all(Crystal **crystals, int n_crystals, int nthreads) } -static void scale_crystal_linear(void *task, int id) -{ - struct scale_args *pargs = task; - int r; - double G; - - /* Simple iterative algorithm */ - r = linear_scale(pargs->full, crystal_get_reflections(pargs->crystal), &G, 0); - if ( r == 0 ) { - crystal_set_osf(pargs->crystal, G); - } else { - crystal_set_user_flag(pargs->crystal, PRFLAG_SCALEBAD); - } -} - - /* Calculates G, by which list2 should be multiplied to fit list1 */ int linear_scale(const RefList *list1, const RefList *list2, double *G, int complain_loudly) @@ -598,26 +582,3 @@ int linear_scale(const RefList *list1, const RefList *list2, double *G, return 0; } - -void scale_all_to_reference(Crystal **crystals, int n_crystals, - RefList *reference, int nthreads) -{ - struct scale_args task_defaults; - struct queue_args qargs; - - task_defaults.crystal = NULL; - - qargs.task_defaults = task_defaults; - qargs.n_crystals = n_crystals; - qargs.crystals = crystals; - - /* Don't have threads which are doing nothing */ - if ( n_crystals < nthreads ) nthreads = n_crystals; - - qargs.task_defaults.full = reference; - qargs.n_started = 0; - qargs.n_done = 0; - qargs.n_reflections = 0; - run_threads(nthreads, scale_crystal_linear, get_crystal, done_crystal, - &qargs, n_crystals, 0, 0, 0); -} diff --git a/src/scaling.h b/src/scaling.h index 514bee03..2161f69c 100644 --- a/src/scaling.h +++ b/src/scaling.h @@ -46,7 +46,4 @@ extern int linear_scale(const RefList *list1, const RefList *list2, double *G, extern void scale_all(Crystal **crystals, int n_crystals, int nthreads); -extern void scale_all_to_reference(Crystal **crystals, int n_crystals, - RefList *reference, int nthreads); - #endif /* SCALING_H */ -- cgit v1.2.3