aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2015-05-18 14:44:59 +0200
committerThomas White <taw@physics.org>2015-05-19 13:57:53 +0200
commit48daaeb56d995f2db90c056c403ca3d00a181184 (patch)
tree85d66d90e02be948a53a48b187bf7a2ea48660a6 /libcrystfel
parent585602b57f77e0e45c0489aee0f4a30b1a7a830f (diff)
Add {get,set}_flag()
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/reflist.c32
-rw-r--r--libcrystfel/src/reflist.h2
2 files changed, 34 insertions, 0 deletions
diff --git a/libcrystfel/src/reflist.c b/libcrystfel/src/reflist.c
index 795894a1..ccc421f3 100644
--- a/libcrystfel/src/reflist.c
+++ b/libcrystfel/src/reflist.c
@@ -102,6 +102,7 @@ struct _refldata {
/* User-specified temporary values */
double temp1;
double temp2;
+ int flag;
};
@@ -546,6 +547,22 @@ double get_temp2(const Reflection *refl)
}
+/**
+ * get_flag:
+ * @refl: A %Reflection
+ *
+ * The integer flag value can be used according to the needs of the calling
+ * program.
+ *
+ * Returns: the flag for this reflection.
+ *
+ **/
+int get_flag(const Reflection *refl)
+{
+ return refl->data.flag;
+}
+
+
/********************************** Setters ***********************************/
/**
@@ -772,6 +789,21 @@ void set_temp2(Reflection *refl, double temp)
}
+/**
+ * set_flag
+ * @refl: A %Reflection
+ * @flag: New flag value
+ *
+ * @flag is an integer value which can be used according to the needs of the
+ * calling program.
+ *
+ **/
+void set_flag(Reflection *refl, int flag)
+{
+ refl->data.flag = flag;
+}
+
+
/********************************* Insertion **********************************/
static Reflection *rotate_once(Reflection *refl, int dir)
diff --git a/libcrystfel/src/reflist.h b/libcrystfel/src/reflist.h
index 8b0d8e04..dac313a4 100644
--- a/libcrystfel/src/reflist.h
+++ b/libcrystfel/src/reflist.h
@@ -103,6 +103,7 @@ extern double get_esd_intensity(const Reflection *refl);
extern double get_phase(const Reflection *refl, int *have_phase);
extern double get_peak(const Reflection *refl);
extern double get_mean_bg(const Reflection *refl);
+extern int get_flag(const Reflection *refl);
/* Set */
extern void copy_data(Reflection *to, const Reflection *from);
@@ -121,6 +122,7 @@ extern void set_peak(Reflection *refl, double peak);
extern void set_mean_bg(Reflection *refl, double mean_bg);
extern void set_symmetric_indices(Reflection *refl,
signed int hs, signed int ks, signed int ls);
+extern void set_flag(Reflection *refl, int flag);
/* Insertion */
extern Reflection *add_refl(RefList *list,