aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2018-05-02 11:59:48 +0200
committerThomas White <taw@physics.org>2018-05-02 14:39:59 +0200
commit928bb3071bb73650404161481d450d09ed25ae9a (patch)
treefeddf6a04998d87d48028b89f90dd0f75c8e7a65 /src
parent5996d68002f2f82393d7253b03eb283dd14746b1 (diff)
Remove scale_all_to_reference
Diffstat (limited to 'src')
-rw-r--r--src/partialator.c17
-rw-r--r--src/scaling.c39
-rw-r--r--src/scaling.h3
3 files changed, 6 insertions, 53 deletions
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 */