![]() |
![]() |
![]() |
CrystFEL Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include "reflist.h" typedef RefList; typedef Reflection; typedef RefListIterator; RefList * reflist_new (void
); void reflist_free (RefList *list
); Reflection * reflection_new (signed int h
,signed int k
,signed int l
); void reflection_free (Reflection *refl
); Reflection * add_refl (RefList *list
,signed int h
,signed int k
,signed int l
); void add_refl_to_list (Reflection *refl
,RefList *list
); Reflection * first_refl (RefList *list
,RefListIterator **piter
); Reflection * next_refl (Reflection *refl
,RefListIterator *iter
); Reflection * find_refl (const RefList *list
,signed int h
,signed int k
,signed int l
); Reflection * next_found_refl (Reflection *refl
); double get_excitation_error (const Reflection *refl
); void get_detector_pos (const Reflection *refl
,double *fs
,double *ss
); double get_partiality (const Reflection *refl
); double get_lorentz (const Reflection *refl
); void get_partial (const Reflection *refl
,double *r1
,double *r2
,double *p
,int *clamp_low
,int *clamp_high
); 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
); double get_intensity (const Reflection *refl
); int get_redundancy (const Reflection *refl
); double get_esd_intensity (const Reflection *refl
); double get_phase (const Reflection *refl
,int *have_phase
); double get_mean_bg (const Reflection *refl
); double get_peak (const Reflection *refl
); double get_temp1 (const Reflection *refl
); double get_temp2 (const Reflection *refl
); void set_detector_pos (Reflection *refl
,double exerr
,double fs
,double ss
); void set_partiality (Reflection *refl
,double p
); void set_lorentz (Reflection *refl
,double L
); void set_partial (Reflection *refl
,double r1
,double r2
,double p
,double clamp_low
,double clamp_high
); void set_intensity (Reflection *refl
,double intensity
); void set_redundancy (Reflection *refl
,int red
); void set_esd_intensity (Reflection *refl
,double esd
); void set_phase (Reflection *refl
,double phase
); void set_mean_bg (Reflection *refl
,double mean_bg
); void set_peak (Reflection *refl
,double peak
); void set_symmetric_indices (Reflection *refl
,signed int hs
,signed int ks
,signed int ls
); void set_temp1 (Reflection *refl
,double temp
); void set_temp2 (Reflection *refl
,double temp
); void copy_data (Reflection *to
,const Reflection *from
); int num_reflections (RefList *list
); int tree_depth (RefList *list
); void lock_reflection (Reflection *refl
); void unlock_reflection (Reflection *refl
); #define GET_H (serial) #define GET_K (serial) #define GET_L (serial) #define SERIAL (h, k, l)
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.
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
.
RefList * reflist_new (void
);
Creates a new reflection list.
Returns : |
the new reflection list, or NULL on error. |
void reflist_free (RefList *list
);
Destroys a reflection list.
|
The reflection list to free. |
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.
|
The h index of the new reflection |
|
The k index of the new reflection |
|
The l index of the new reflection |
void reflection_free (Reflection *refl
);
Destroys an individual reflection.
|
The reflection to free. |
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.
|
A RefList
|
|
The 'h' index of the reflection |
|
The 'k' index of the reflection |
|
The 'l' index of the reflection |
Returns : |
The newly created reflection, or NULL on failure. |
void add_refl_to_list (Reflection *refl
,RefList *list
);
Adds a refl
to list
.
|
A Reflection
|
|
A RefList
|
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.
|
A RefList to iterate over |
|
Address at which to store a RefListIterator
|
Returns : |
the first reflection in the list. |
Reflection * next_refl (Reflection *refl
,RefListIterator *iter
);
This function looks up the next reflection in the list that was given earlier
to first_refl()
.
|
A reflection |
|
A RefListIterator
|
Returns : |
the next reflection in the list, or NULL if no more. |
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.
|
The reflection list to search in |
|
The 'h' index to search for |
|
The 'k' index to search for |
|
The 'l' index to search for |
Returns : |
The found reflection, or NULL if no reflection with the given indices could be found. |
Reflection * next_found_refl (Reflection *refl
);
This function returns the next reflection in refl
's list with the same
indices.
|
A reflection returned by find_refl() or next_found_refl()
|
Returns : |
The found reflection, or NULL if there are no more reflections with the same indices. |
double get_excitation_error (const Reflection *refl
);
|
A Reflection
|
Returns : |
The excitation error for the reflection. |
void get_detector_pos (const Reflection *refl
,double *fs
,double *ss
);
|
A Reflection
|
|
Location at which to store the fast scan offset of the reflection |
|
Location at which to store the slow scan offset of the reflection |
double get_partiality (const Reflection *refl
);
|
A Reflection
|
Returns : |
The partiality of the reflection. See get_lorentz() . |
double get_lorentz (const Reflection *refl
);
|
A Reflection
|
Returns : |
The Lorentz factor for the reflection. To "scale up" a partial reflection, divide by this multiplied by the partiality. |
void get_partial (const Reflection *refl
,double *r1
,double *r2
,double *p
,int *clamp_low
,int *clamp_high
);
This function is used during post refinement (in conjunction with
set_partial()
) to get access to the details of the partiality calculation.
|
A Reflection
|
|
Location at which to store the first excitation error |
|
Location at which to store the second excitation error |
|
Location at which to store the partiality |
|
Location at which to store the first clamp status |
|
Location at which to store the second clamp status |
void get_indices (const Reflection *refl
,signed int *h
,signed int *k
,signed int *l
);
|
A Reflection
|
|
Location at which to store the 'h' index of the reflection |
|
Location at which to store the 'k' index of the reflection |
|
Location at which to store the 'l' index of the reflection |
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.
|
A Reflection
|
|
Location at which to store the 'h' index of the reflection |
|
Location at which to store the 'k' index of the reflection |
|
Location at which to store the 'l' index of the reflection |
double get_intensity (const Reflection *refl
);
|
A Reflection
|
Returns : |
The intensity of the reflection. |
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.
|
A Reflection
|
Returns : |
the number of measurements of this reflection. |
double get_esd_intensity (const Reflection *refl
);
|
A Reflection
|
Returns : |
the standard error in the intensity measurement (as returned by
get_intensity() ) for this reflection. |
double get_phase (const Reflection *refl
,int *have_phase
);
|
A Reflection
|
|
Place to store a non-zero value if the phase is set, or NULL. |
Returns : |
the phase for this reflection. |
double get_mean_bg (const Reflection *refl
);
|
A Reflection
|
Returns : |
the mean background level for this reflection. |
double get_peak (const Reflection *refl
);
|
A Reflection
|
Returns : |
the peak height (value of the highest pixel, before background subtraction) for this reflection. |
double get_temp1 (const Reflection *refl
);
The temporary values can be used according to the needs of the calling program.
|
A Reflection
|
Returns : |
the first temporary value for this reflection. |
double get_temp2 (const Reflection *refl
);
The temporary values can be used according to the needs of the calling program.
|
A Reflection
|
Returns : |
the second temporary value for this reflection. |
void set_detector_pos (Reflection *refl
,double exerr
,double fs
,double ss
);
|
A Reflection
|
|
The excitation error for this reflection |
|
The fast scan offset of the reflection |
|
The slow scan offset of the reflection |
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.
|
A Reflection
|
|
The Lorentz factor for the reflection. |
void set_partial (Reflection *refl
,double r1
,double r2
,double p
,double clamp_low
,double clamp_high
);
This function is used during post refinement (in conjunction with
get_partial()
) to get access to the details of the partiality calculation.
|
A Reflection
|
|
The first excitation error |
|
The second excitation error |
|
The partiality |
|
The first clamp status |
|
The second clamp status |
void set_intensity (Reflection *refl
,double intensity
);
Set the intensity for the reflection.
|
A Reflection
|
|
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.
|
A Reflection
|
|
New redundancy for the reflection |
void set_esd_intensity (Reflection *refl
,double esd
);
|
A Reflection
|
|
New standard error for this reflection's intensity measurement |
void set_phase (Reflection *refl
,double phase
);
|
A Reflection
|
|
New phase for the reflection |
void set_mean_bg (Reflection *refl
,double mean_bg
);
|
A Reflection
|
|
New peak height for the reflection |
void set_peak (Reflection *refl
,double peak
);
|
A Reflection
|
|
New peak height for the reflection |
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.
|
A Reflection
|
|
The 'h' index of the reflection |
|
The 'k' index of the reflection |
|
The 'l' index of the reflection |
void set_temp1 (Reflection *refl
,double temp
);
The temporary values can be used according to the needs of the calling program.
|
A Reflection
|
|
New temporary value for the reflection |
void set_temp2 (Reflection *refl
,double temp
);
The temporary values can be used according to the needs of the calling program.
|
A Reflection
|
|
New temporary value for the reflection |
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.
|
Reflection to copy data into |
|
Reflection to copy data from |
int num_reflections (RefList *list
);
|
A RefList
|
Returns : |
the number of reflections in 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.
|
A RefList
|
Returns : |
the depth of the RB-tree used internally to represent list . |
void lock_reflection (Reflection *refl
);
Acquires a lock on the reflection.
|
A Reflection
|
void unlock_reflection (Reflection *refl
);
Releases a lock on the reflection.
|
A Reflection
|