Top | ![]() |
![]() |
![]() |
![]() |
The fast reflection list stores reflections in an RB-tree indexed by the Miller indices h, k and l. Any reflection can be found in a length of time which scales logarithmically with the number of reflections in the list.
A RefList can contain any number of reflections, and can store more than one reflection with a given set of indices, for example when two distinct reflections are to be stored according to their asymmetric indices.
There are getters and setters which can be used to get and set values for an individual reflection. The reflection list does not calculate any values, only stores what it was given earlier. As such, you will need to carefully examine which fields your prior processing steps have filled in.
Reflection * reflection_new (signed int h
,signed int k
,signed int l
);
Creates a new individual reflection. You'll probably want to use
add_refl_to_list()
at some later point.
Reflection * add_refl (RefList *list
,signed int h
,signed int k
,signed int l
);
Adds a new reflection to list
. Note that the implementation allows there to
be multiple reflections with the same indices in the list, so this function
should succeed even if the given indices already feature in the list.
list |
A |
|
h |
The 'h' index of the reflection |
|
k |
The 'k' index of the reflection |
|
l |
The 'l' index of the reflection |
Reflection * first_refl (RefList *list
,RefListIterator **piter
);
This function sets up the state required for iteration over the entire list, and then returns the first reflection in the list. An iterator object will be created and its address stored at the location given in piter.
Reflection * next_refl (Reflection *refl
,RefListIterator *iter
);
This function looks up the next reflection in the list that was given earlier
to first_refl()
.
Reflection * find_refl (const RefList *list
,signed int h
,signed int k
,signed int l
);
This function finds the first reflection in 'list' with the given indices.
Since a RefList
can contain multiple reflections with the same indices, you
may need to use next_found_refl()
to get the other reflections.
Reflection *
next_found_refl (Reflection *refl
);
This function returns the next reflection in refl
's list with the same
indices.
void get_detector_pos (const Reflection *refl
,double *fs
,double *ss
);
void get_partial (const Reflection *refl
,double *rlow
,double *rhigh
,double *p
);
This function is used during post refinement (in conjunction with
set_partial()
) to get access to the details of the partiality calculation.
void get_indices (const Reflection *refl
,signed int *h
,signed int *k
,signed int *l
);
void get_symmetric_indices (const Reflection *refl
,signed int *hs
,signed int *ks
,signed int *ls
);
This function gives the symmetric indices, that is, the "real" indices before squashing down to the asymmetric reciprocal unit. This may be useful if the list is indexed according to the asymmetric indices, but you still need access to the symmetric version. This happens during post-refinement.
int
get_redundancy (const Reflection *refl
);
The redundancy of the reflection is the number of measurements that have been made of it. Note that a redundancy of zero may have a special meaning, such as that the reflection was impossible to integrate. Note further that each reflection in the list has its own redundancy, even if there are multiple copies of the reflection in the list. The total number of reflection measurements should always be the sum of the redundancies in the entire list.
double
get_esd_intensity (const Reflection *refl
);
the standard error in the intensity measurement (as returned by
get_intensity()
) for this reflection.
double get_phase (const Reflection *refl
,int *have_phase
);
double
get_temp1 (const Reflection *refl
);
The temporary values can be used according to the needs of the calling program.
double
get_temp2 (const Reflection *refl
);
The temporary values can be used according to the needs of the calling program.
int
get_flag (const Reflection *refl
);
The integer flag value can be used according to the needs of the calling program.
void set_detector_pos (Reflection *refl
,double fs
,double ss
);
void set_panel (Reflection *refl
,struct panel *p
);
Note that the pointer will be stored, not the contents of the structure.
void set_lorentz (Reflection *refl
,double L
);
Set the Lorentz factor for the reflection. To "scale up" a partial reflection, divide by this multiplied by the partiality.
void set_partial (Reflection *refl
,double rlow
,double rhigh
,double p
);
This function is used during post refinement (in conjunction with
get_partial()
) to get access to the details of the partiality calculation.
void set_intensity (Reflection *refl
,double intensity
);
Set the intensity for the reflection.
void set_redundancy (Reflection *refl
,int red
);
The redundancy of the reflection is the number of measurements that have been made of it. Note that a redundancy of zero may have a special meaning, such as that the reflection was impossible to integrate. Note further that each reflection in the list has its own redundancy, even if there are multiple copies of the reflection in the list. The total number of reflection measurements should always be the sum of the redundancies in the entire list.
void set_symmetric_indices (Reflection *refl
,signed int hs
,signed int ks
,signed int ls
);
This function gives the symmetric indices, that is, the "real" indices before squashing down to the asymmetric reciprocal unit. This may be useful if the list is indexed according to the asymmetric indices, but you still need access to the symmetric version. This happens during post-refinement.
void set_temp1 (Reflection *refl
,double temp
);
The temporary values can be used according to the needs of the calling program.
void set_temp2 (Reflection *refl
,double temp
);
The temporary values can be used according to the needs of the calling program.
void set_flag (Reflection *refl
,int flag
);
flag
is an integer value which can be used according to the needs of the
calling program.
void copy_data (Reflection *to
,const Reflection *from
);
This function is used to copy the data (which is everything listed above in the list of getters and setters, apart from the indices themselves) from one reflection to another. This might be used when creating a new list from an old one, perhaps using the asymmetric indices instead of the raw indices for the new list.
int
tree_depth (RefList *list
);
If the depth of the tree is more than about 20, access to the list will be slow. This should never happen.
typedef struct _reflist RefList;
A RefList
represents a list of Bragg reflections.
This data structure is opaque. You must use the available accessor functions to read and write its contents.
typedef struct _reflection Reflection;
A Reflection
represents a single Bragg reflection.
This data structure is opaque. You must use the available accessor functions to read and write its contents.
typedef struct _reflistiterator RefListIterator;
A RefListIterator
is an opaque data type used when iterating over a
RefList
.