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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
/*
* reflist.c
*
* Fast reflection/peak list
*
* (c) 2011 Thomas White <taw@physics.org>
*
* Part of CrystFEL - crystallography with a FEL
*
*/
#include <stdlib.h>
#include "reflist.h"
struct _reflection {
/* Listy stuff */
unsigned int serial; /* Unique serial number, key */
struct _reflection *child[2]; /* Child nodes */
struct _reflection *parent; /* Parent node */
signed int h;
signed int k;
signed int l;
/* Partiality and related geometrical stuff */
double r1; /* First excitation error */
double r2; /* Second excitation error */
double p; /* Partiality */
int clamp1; /* Clamp status for r1 */
int clamp2; /* Clamp status for r2 */
/* Location in image */
double x;
double y;
/* The distance from the exact Bragg position to the coordinates
* given above. */
double excitation_error;
/* Non-zero if this reflection can be used for scaling */
int scalable;
/* Intensity */
double intensity;
};
struct _reflist {
struct _reflection *head;
};
/**************************** Creation / deletion *****************************/
/* Create a reflection list */
RefList *reflist_new()
{
RefList *new;
new = malloc(sizeof(struct _reflist));
new->head = NULL;
return new;
}
static void recursive_free(Reflection *refl)
{
if ( refl->child[0] != NULL ) recursive_free(refl->child[0]);
if ( refl->child[1] != NULL ) recursive_free(refl->child[1]);
free(refl);
}
void reflist_free(RefList *list)
{
recursive_free(list->head);
free(list);
}
/********************************** Search ************************************/
Reflection *find_refl(RefList *list, INDICES)
{
}
Reflection *next_found_refl(Reflection *refl)
{
}
/********************************** Getters ***********************************/
double get_excitation_error(Reflection *refl)
{
return refl->excitation_error;
}
void get_detector_pos(Reflection *refl, double *x, double *y)
{
*x = refl->x;
*y = refl->y;
}
void get_indices(Reflection *refl, signed int *h, signed int *k, signed int *l)
{
*h = refl->h;
*k = refl->k;
*l = refl->l;
}
double get_partiality(Reflection *refl)
{
return refl->p;
}
double get_intensity(Reflection *refl)
{
return refl->intensity;
}
void get_partial(Reflection *refl, double *r1, double *r2, double *p,
int *clamp_low, int *clamp_high)
{
*r1 = refl->r1;
*r2 = refl->r2;
*p = get_partiality(refl);
*clamp_low = refl->clamp1;
*clamp_high = refl->clamp2;
}
int get_scalable(Reflection *refl)
{
return refl->scalable;
}
/********************************** Setters ***********************************/
void set_detector_pos(Reflection *refl, double exerr, double x, double y)
{
}
void set_partial(Reflection *refl, double r1, double r2, double p,
double clamp_low, double clamp_high)
{
}
void set_indices(Reflection *refl,
signed int h, signed int k, signed int l)
{
}
void set_int(Reflection *refl, double intensity)
{
}
void set_scalable(Reflection *refl, int scalable)
{
}
/********************************* Insertion **********************************/
Reflection *add_refl(RefList *list, INDICES)
{
}
Reflection *add_refl_with_det_pos(RefList *refl, INDICES, double exerr,
double x, double y)
{
}
/********************************** Deletion **********************************/
void delete_refl(Reflection *refl)
{
}
/********************************* Iteration **********************************/
Reflection *first_refl(RefList *list)
{
}
Reflection *next_refl(Reflection *refl)
{
}
/*********************************** Voodoo ***********************************/
void optimise_reflist(RefList *list)
{
}
|