aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-10-02 17:37:16 +0200
committerThomas White <taw@physics.org>2012-10-02 17:37:16 +0200
commitf4cb5910fe6981e2ae5a85ac22fd3d64eecf1117 (patch)
tree07f37077f6ea7c19afbc8a66a64cdfe14493f6b0 /libcrystfel/src
parent5554266d7138e3af55d383e78a0184707c880d37 (diff)
parentc99176cca2d92dd0a2afa20de1a0a4b1feea6f7c (diff)
Merge branch 'master' of ssh://git.bitwiz.org.uk/crystfel
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/cell-utils.c21
-rw-r--r--libcrystfel/src/peaks.c2
2 files changed, 16 insertions, 7 deletions
diff --git a/libcrystfel/src/cell-utils.c b/libcrystfel/src/cell-utils.c
index 3aaae90e..74f33bb2 100644
--- a/libcrystfel/src/cell-utils.c
+++ b/libcrystfel/src/cell-utils.c
@@ -683,13 +683,22 @@ UnitCell *match_cell(UnitCell *cell_in, UnitCell *template_in, int verbose,
free(cand[2]);
/* Reverse the de-centering transformation */
- new_cell_trans = cell_transform_inverse(new_cell, uncentering);
- cell_free(new_cell);
- cell_set_lattice_type(new_cell, cell_get_lattice_type(template_in));
- cell_set_centering(new_cell, cell_get_centering(template_in));
- cell_set_unique_axis(new_cell, cell_get_unique_axis(template_in));
+ if ( new_cell != NULL ) {
- return new_cell_trans;
+ new_cell_trans = cell_transform_inverse(new_cell, uncentering);
+ cell_free(new_cell);
+ cell_set_lattice_type(new_cell_trans,
+ cell_get_lattice_type(template_in));
+ cell_set_centering(new_cell_trans,
+ cell_get_centering(template_in));
+ cell_set_unique_axis(new_cell_trans,
+ cell_get_unique_axis(template_in));
+
+ return new_cell_trans;
+
+ } else {
+ return NULL;
+ }
}
diff --git a/libcrystfel/src/peaks.c b/libcrystfel/src/peaks.c
index f7f6c650..b0b48c2e 100644
--- a/libcrystfel/src/peaks.c
+++ b/libcrystfel/src/peaks.c
@@ -771,7 +771,7 @@ void integrate_reflections(struct image *image, int use_closer, int bgsub,
r = integrate_peak(image, pfs, pss, &fs, &ss,
&intensity, &sigma, ir_inn, ir_mid, ir_out,
- 1, bgMasks[j]);
+ 1, bgMasks[pnum]);
/* I/sigma(I) cutoff */
if ( intensity/sigma < min_snr ) r = 1;