diff options
Diffstat (limited to 'src/post-refinement.c')
-rw-r--r-- | src/post-refinement.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/src/post-refinement.c b/src/post-refinement.c index 16ab41ce..d4aeecef 100644 --- a/src/post-refinement.c +++ b/src/post-refinement.c @@ -3,11 +3,11 @@ * * Post refinement * - * Copyright © 2012-2020 Deutsches Elektronen-Synchrotron DESY, + * Copyright © 2012-2021 Deutsches Elektronen-Synchrotron DESY, * a research centre of the Helmholtz Association. * * Authors: - * 2010-2018 Thomas White <taw@physics.org> + * 2010-2020 Thomas White <taw@physics.org> * * This file is part of CrystFEL. * @@ -56,7 +56,7 @@ struct rf_alteration struct rf_priv { - const Crystal *cr; /**< Original crystal (before any refinement) */ + Crystal *cr; /**< Original crystal (before any refinement) */ const RefList *full; int serial; int scaleflags; @@ -98,7 +98,7 @@ const char *str_prflag(enum prflag flag) } -static void rotate_cell_xy(const UnitCell *source, UnitCell *tgt, +static void rotate_cell_xy(UnitCell *source, UnitCell *tgt, double ang1, double ang2) { double asx, asy, asz; @@ -150,7 +150,7 @@ static void rotate_cell_xy(const UnitCell *source, UnitCell *tgt, } -static void apply_parameters(const Crystal *cr_orig, Crystal *cr_tgt, +static void apply_parameters(Crystal *cr_orig, Crystal *cr_tgt, struct rf_alteration alter) { double R, lambda; @@ -161,7 +161,7 @@ static void apply_parameters(const Crystal *cr_orig, Crystal *cr_tgt, R = crystal_get_profile_radius(cr_orig); lambda = crystal_get_image_const(cr_orig)->lambda; - rotate_cell_xy(crystal_get_cell_const(cr_orig), crystal_get_cell(cr_tgt), + rotate_cell_xy(crystal_get_cell(cr_orig), crystal_get_cell(cr_tgt), alter.rot_x, alter.rot_y); crystal_set_profile_radius(cr_tgt, R+alter.delta_R); image->lambda = lambda+alter.delta_wave; @@ -336,9 +336,7 @@ void write_test_logs(Crystal *crystal, const RefList *full, } if ( cycle == 0 ) { - char *evstr = get_event_string(image->event); - fprintf(fh, "Image: %s %s\n", image->filename, evstr); - free(evstr); + fprintf(fh, "Image: %s %s\n", image->filename, image->ev); } if ( cycle >= 0 ) { @@ -393,10 +391,8 @@ void write_specgraph(Crystal *crystal, const RefList *full, } if ( cycle == 0 ) { - char *evstr = get_event_string(image->event); - fprintf(fh, "Image: %s %s\n", image->filename, evstr); + fprintf(fh, "Image: %s %s\n", image->filename, image->ev); fprintf(fh, "khalf/m 1/d(m) pcalc pobs iteration h k l\n"); - free(evstr); } cell = crystal_get_cell(crystal); @@ -757,7 +753,7 @@ struct refine_args }; -struct queue_args +struct pr_queue_args { int n_started; int n_done; @@ -784,7 +780,7 @@ static void refine_image(void *task, int id) static void *get_image(void *vqargs) { struct refine_args *task; - struct queue_args *qargs = vqargs; + struct pr_queue_args *qargs = vqargs; task = malloc(sizeof(struct refine_args)); memcpy(task, &qargs->task_defaults, sizeof(struct refine_args)); @@ -800,7 +796,7 @@ static void *get_image(void *vqargs) static void done_image(void *vqargs, void *task) { - struct queue_args *qa = vqargs; + struct pr_queue_args *qa = vqargs; qa->n_done++; @@ -815,7 +811,7 @@ void refine_all(Crystal **crystals, int n_crystals, SymOpList *sym, SymOpList *amb, int scaleflags) { struct refine_args task_defaults; - struct queue_args qargs; + struct pr_queue_args qargs; task_defaults.full = full; task_defaults.crystal = NULL; |