aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2024-01-18 15:24:09 +0100
committerThomas White <taw@physics.org>2024-02-06 16:59:34 +0100
commitec990bb275f55c2b5228c6995cf9ffc19074b6f9 (patch)
tree853d89e169ca47fdce294d36ec22edba01ae229c /src
parent335067449b3858a55442ffb355af56f55410d154 (diff)
Crystals shouldn't own RefLists (part 6)
This fixes the remaining programs.
Diffstat (limited to 'src')
-rw-r--r--src/ambigator.c4
-rw-r--r--src/cell_explorer.c4
-rw-r--r--src/crystfelimageview.c3
-rw-r--r--src/gui_index.c10
-rw-r--r--src/process_image.c14
-rw-r--r--src/whirligig.c11
6 files changed, 21 insertions, 25 deletions
diff --git a/src/ambigator.c b/src/ambigator.c
index 3777cf0a..91e621ac 100644
--- a/src/ambigator.c
+++ b/src/ambigator.c
@@ -1287,7 +1287,8 @@ int main(int argc, char *argv[])
RefList *list;
UnitCell *cell;
- cr = image->crystals[i];
+ cr = image->crystals[i].cr;
+ list = image->crystals[i].refls;
cell = crystal_get_cell(cr);
if ( n_crystals == max_crystals ) {
@@ -1308,7 +1309,6 @@ int main(int argc, char *argv[])
}
- list = crystal_get_reflections(cr);
crystals[n_crystals] = asymm_and_merge(list, s_sym,
cell,
rmin, rmax,
diff --git a/src/cell_explorer.c b/src/cell_explorer.c
index 99cb284f..a92de347 100644
--- a/src/cell_explorer.c
+++ b/src/cell_explorer.c
@@ -2002,9 +2002,7 @@ static int add_stream(CellWindow *w, const char *stream_filename,
for ( i=0; i<image->n_crystals; i++ ) {
- Crystal *cr;
-
- cr = image->crystals[i];
+ Crystal *cr = image->crystals[i].cr;
if ( w->n_cells == max_cells ) {
diff --git a/src/crystfelimageview.c b/src/crystfelimageview.c
index 03350204..1659ae4f 100644
--- a/src/crystfelimageview.c
+++ b/src/crystfelimageview.c
@@ -707,9 +707,8 @@ static gint draw_sig(GtkWidget *window, cairo_t *cr, CrystFELImageView *iv)
if ( iv->show_refls ) {
int i;
for ( i=0; i<iv->image->n_crystals; i++ ) {
- Crystal *cry = iv->image->crystals[i];
draw_refls(cr, iv,
- crystal_get_reflections(cry),
+ iv->image->crystals[i].refls,
iv->label_refls,
crystal_cols[i % n_crystal_cols]);
}
diff --git a/src/gui_index.c b/src/gui_index.c
index 2cc8e8db..218331eb 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -636,19 +636,19 @@ static void run_indexing_once(struct crystfelproject *proj)
index_pattern(proj->cur_image, ipriv);
for ( i=0; i<proj->cur_image->n_crystals; i++ ) {
- crystal_set_mosaicity(proj->cur_image->crystals[i], 0.0);
+ crystal_set_mosaicity(proj->cur_image->crystals[i].cr, 0.0);
if ( proj->indexing_params.use_fix_profile_radius ) {
/* Manual radius */
- crystal_set_profile_radius(proj->cur_image->crystals[i],
+ crystal_set_profile_radius(proj->cur_image->crystals[i].cr,
proj->indexing_params.fix_profile_radius);
} else {
/* Auto radius determination */
- crystal_set_profile_radius(proj->cur_image->crystals[i],
+ crystal_set_profile_radius(proj->cur_image->crystals[i].cr,
0.02e9);
- if ( refine_radius(proj->cur_image->crystals[i],
+ if ( refine_radius(proj->cur_image->crystals[i].cr,
proj->cur_image) )
{
ERROR("WARNING: Radius determination failed\n");
@@ -682,7 +682,7 @@ static void run_indexing_once(struct crystfelproject *proj)
STATUS("Number of crystals: %i\n",
proj->cur_image->n_crystals);
for ( i=0; i<proj->cur_image->n_crystals; i++ ) {
- cell_print(crystal_get_cell(proj->cur_image->crystals[i]));
+ cell_print(crystal_get_cell(proj->cur_image->crystals[i].cr));
}
}
diff --git a/src/process_image.c b/src/process_image.c
index 2f856594..782c97b9 100644
--- a/src/process_image.c
+++ b/src/process_image.c
@@ -434,20 +434,20 @@ void process_image(const struct index_args *iargs, struct pattern_args *pargs,
set_last_task(last_task, "prediction params");
if ( iargs->fix_profile_r >= 0.0 ) {
for ( i=0; i<image->n_crystals; i++ ) {
- crystal_set_profile_radius(image->crystals[i],
+ crystal_set_profile_radius(image->crystals[i].cr,
iargs->fix_profile_r);
- crystal_set_mosaicity(image->crystals[i], 0.0);
+ crystal_set_mosaicity(image->crystals[i].cr, 0.0);
}
} else {
for ( i=0; i<image->n_crystals; i++ ) {
- crystal_set_profile_radius(image->crystals[i], 0.02e9);
- crystal_set_mosaicity(image->crystals[i], 0.0);
+ crystal_set_profile_radius(image->crystals[i].cr, 0.02e9);
+ crystal_set_mosaicity(image->crystals[i].cr, 0.0);
}
}
if ( iargs->fix_profile_r < 0.0 ) {
for ( i=0; i<image->n_crystals; i++ ) {
- if ( refine_radius(image->crystals[i], image) ) {
+ if ( refine_radius(image->crystals[i].cr, image) ) {
ERROR("WARNING: Radius determination failed\n");
}
}
@@ -479,7 +479,7 @@ streamwrite:
int n = 0;
for ( i=0; i<image->n_crystals; i++ ) {
- n += crystal_get_num_implausible_reflections(image->crystals[i]);
+ n += crystal_get_num_implausible_reflections(image->crystals[i].cr);
}
if ( n > 0 ) {
STATUS("WARNING: %i implausibly negative reflection%s in %s "
@@ -495,7 +495,7 @@ out:
pthread_mutex_lock(&sb_shared->totals_lock);
any_crystals = 0;
for ( i=0; i<image->n_crystals; i++ ) {
- if ( crystal_get_user_flag(image->crystals[i]) == 0 ) {
+ if ( crystal_get_user_flag(image->crystals[i].cr) == 0 ) {
sb_shared->n_crystals++;
any_crystals = 1;
}
diff --git a/src/whirligig.c b/src/whirligig.c
index 20fcfa40..aa2cf090 100644
--- a/src/whirligig.c
+++ b/src/whirligig.c
@@ -175,12 +175,11 @@ static void process_series(struct image *images, signed int *ser,
fprintf(fh, "%i frames in series\n\n", len);
fprintf(fh, " # Serial Filename EventID Crystal\n");
for ( i=0; i<len; i++ ) {
- Crystal *cr = images[i].crystals[ser[i]];
fprintf(fh, "%4i %5i %s %s %i\n", i, images[i].serial,
images[i].filename,
images[i].ev,
ser[i]);
- p[i] = transform_reflections(crystal_get_reflections(cr),
+ p[i] = transform_reflections(images[i].crystals[ser[i]].refls,
mat[i]);
}
@@ -316,8 +315,8 @@ static IntegerMatrix *try_all(struct window *win, int n1, int n2,
for ( i=0; i<i1->n_crystals; i++ ) {
for ( j=0; j<i2->n_crystals; j++ ) {
- if ( compare_permuted_cell_parameters_and_orientation(crystal_get_cell(i1->crystals[i]),
- crystal_get_cell(i2->crystals[j]),
+ if ( compare_permuted_cell_parameters_and_orientation(crystal_get_cell(i1->crystals[i].cr),
+ crystal_get_cell(i2->crystals[j].cr),
tols, &m) )
{
if ( !crystal_used(win, n1, i)
@@ -377,12 +376,12 @@ static int try_join(struct window *win, int sn)
/* Get the appropriately transformed cell from the last crystal in this
* series */
- cr = win->img[sp].crystals[win->ser[sn][sp]];
+ cr = win->img[sp].crystals[win->ser[sn][sp]].cr;
ref = cell_transform_intmat(crystal_get_cell(cr), win->mat[sn][sp]);
for ( j=0; j<win->img[win->join_ptr].n_crystals; j++ ) {
Crystal *cr2;
- cr2 = win->img[win->join_ptr].crystals[j];
+ cr2 = win->img[win->join_ptr].crystals[j].cr;
if ( compare_permuted_cell_parameters_and_orientation(ref, crystal_get_cell(cr2),
tols,
&win->mat[sn][win->join_ptr]) )