aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel/src
diff options
context:
space:
mode:
Diffstat (limited to 'libcrystfel/src')
-rw-r--r--libcrystfel/src/crystal.c18
-rw-r--r--libcrystfel/src/crystal.h2
-rw-r--r--libcrystfel/src/dirax.c2
3 files changed, 15 insertions, 7 deletions
diff --git a/libcrystfel/src/crystal.c b/libcrystfel/src/crystal.c
index 6ff251e0..664d933e 100644
--- a/libcrystfel/src/crystal.c
+++ b/libcrystfel/src/crystal.c
@@ -106,8 +106,6 @@ Crystal *crystal_new()
void crystal_free(Crystal *cryst)
{
if ( cryst == NULL ) return;
- if ( cryst->cell != NULL ) cell_free(cryst->cell);
- if ( cryst->reflections != NULL ) reflist_free(cryst->reflections);
free(cryst);
}
@@ -163,13 +161,18 @@ int crystal_get_user_flag(Crystal *cryst)
}
+double crystal_get_mosaicity(Crystal *cryst)
+{
+ return cryst->m;
+}
+
+
/********************************** Setters ***********************************/
void crystal_set_cell(Crystal *cryst, UnitCell *cell)
{
- if ( cryst->cell != NULL ) cell_free(cryst->cell);
- cryst->cell = cell_new_from_cell(cell);
+ cryst->cell = cell;
}
@@ -181,7 +184,6 @@ void crystal_set_profile_radius(Crystal *cryst, double r)
void crystal_set_reflections(Crystal *cryst, RefList *reflist)
{
- if ( cryst->reflections != NULL ) reflist_free(reflist);
cryst->reflections = reflist;
}
@@ -214,3 +216,9 @@ void crystal_set_user_flag(Crystal *cryst, int user_flag)
{
cryst->user_flag = user_flag;
}
+
+
+void crystal_set_mosaicity(Crystal *cryst, double m)
+{
+ cryst->m = m;
+}
diff --git a/libcrystfel/src/crystal.h b/libcrystfel/src/crystal.h
index f7c49a81..3d0ad9d1 100644
--- a/libcrystfel/src/crystal.h
+++ b/libcrystfel/src/crystal.h
@@ -58,6 +58,7 @@ extern long long int crystal_get_num_saturated_reflections(Crystal *cryst);
extern int crystal_get_user_flag(Crystal *cryst);
extern double crystal_get_osf(Crystal *cryst);
extern struct image *crystal_get_image(Crystal *cryst);
+extern double crystal_get_mosaicity(Crystal *cryst);
extern void crystal_set_cell(Crystal *cryst, UnitCell *cell);
extern void crystal_set_profile_radius(Crystal *cryst, double r);
@@ -68,5 +69,6 @@ extern void crystal_set_num_saturated_reflections(Crystal *cryst,
extern void crystal_set_user_flag(Crystal *cryst, int flag);
extern void crystal_set_osf(Crystal *cryst, double osf);
extern void crystal_set_image(Crystal *cryst, struct image *image);
+extern void crystal_set_mosaicity(Crystal *cryst, double m);
#endif /* CRYSTAL_H */
diff --git a/libcrystfel/src/dirax.c b/libcrystfel/src/dirax.c
index 6fbb9663..2cbb0ec1 100644
--- a/libcrystfel/src/dirax.c
+++ b/libcrystfel/src/dirax.c
@@ -140,8 +140,6 @@ static int check_cell(struct dirax_private *dp, struct image *image,
image_add_crystal(image, cr);
- cell_free(out); /* Crystal makes its own copy */
-
return 1;
}