aboutsummaryrefslogtreecommitdiff
path: root/src/reflist.h
blob: c7b2ad42c21c9f5b1cf2b272a92e489c5c2d3687 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * reflist.h
 *
 * Fast reflection/peak list
 *
 * (c) 2011 Thomas White <taw@physics.org>
 *
 * Part of CrystFEL - crystallography with a FEL
 *
 */

#ifndef REFLIST_H
#define REFLIST_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif


typedef struct _reflist RefList;
typedef struct _reflection Reflection;

#define INDICES signed int h, signed int k, signed int l

/* Creation/deletion */
extern RefList *reflist_new(void);
extern void reflist_free(RefList *list);

/* Search */
extern Reflection *find_refl(RefList *list, INDICES);
extern Reflection *next_found_refl(Reflection *refl);

/* Get */
extern double get_excitation_error(Reflection *refl);
extern void get_detector_pos(Reflection *refl, double *x, double *y);
extern void get_indices(Reflection *refl,
                        signed int *h, signed int *k, signed int *l);
extern double get_partiality(Reflection *refl);
extern double get_intensity(Reflection *refl);
extern void get_partial(Reflection *refl, double *r1, double *r2, double *p,
                        int *clamp_low, int *clamp_high);
extern int get_scalable(Reflection *refl);

/* Set */
extern void set_detector_pos(Reflection *refl, double exerr,
                             double x, double y);
extern void set_partial(Reflection *refl, double r1, double r2, double p,
                        double clamp_low, double clamp_high);
extern void set_indices(Reflection *refl,
                        signed int h, signed int k, signed int l);
extern void set_int(Reflection *refl, double intensity);
extern void set_scalable(Reflection *refl, int scalable);

/* Insertion */
extern Reflection *add_refl(RefList *list, INDICES);

/* Deletion */
extern void delete_refl(Reflection *refl);

/* Iteration */
extern Reflection *first_refl(RefList *list);
extern Reflection *next_refl(Reflection *refl);

/* Voodoo */
extern void optimise_reflist(RefList *list);

#endif	/* REFLIST_H */