RefList utilities

RefList utilities — Reflection list utilities

Synopsis

#include "reflist-utils.h"


int                 write_reflist                       (const char *filename,
                                                         RefList *list);
int                 write_reflist_2                     (const char *filename,
                                                         RefList *list,
                                                         SymOpList *sym);
void                write_reflections_to_file           (FILE *fh,
                                                         RefList *list);
RefList *           read_reflections                    (const char *filename);
RefList *           read_reflections_from_file          (FILE *fh);
RefList *           asymmetric_indices                  (RefList *in,
                                                         const SymOpList *sym);
RefList *           res_cutoff                          (RefList *list,
                                                         UnitCell *cell,
                                                         double min,
                                                         double max);
int                 check_list_symmetry                 (RefList *list,
                                                         const SymOpList *sym);
RefList *           copy_reflist                        (RefList *list);
int                 find_equiv_in_list                  (RefList *list,
                                                         signed int h,
                                                         signed int k,
                                                         signed int l,
                                                         const SymOpList *sym,
                                                         signed int *hu,
                                                         signed int *ku,
                                                         signed int *lu);
void                resolution_limits                   (RefList *list,
                                                         UnitCell *cell,
                                                         double *rmin,
                                                         double *rmax);
double              max_intensity                       (RefList *list);

Description

There are some utility functions associated with the core RefList.

Details

write_reflist ()

int                 write_reflist                       (const char *filename,
                                                         RefList *list);

Warning

write_reflist is deprecated and should not be used in newly-written code. use write_reflist_2() instead.

This function writes the contents of list to file,

Reflections which have a redundancy of zero will not be written.

The resulting list can be read back with read_reflections_from_file() or read_reflections().

This is a convenience function which simply opens filename and then calls write_reflections_to_file.

filename :

Filename

list :

The reflection list to write

Returns :

zero on success, non-zero on failure.

write_reflist_2 ()

int                 write_reflist_2                     (const char *filename,
                                                         RefList *list,
                                                         SymOpList *sym);

This function writes the contents of list to file,

Reflections which have a redundancy of zero will not be written.

The resulting list can be read back with read_reflections_from_file() or read_reflections().

filename :

Filename

list :

The reflection list to write

sym :

A SymOpList describing the symmetry of the list

Returns :

zero on success, non-zero on failure.

write_reflections_to_file ()

void                write_reflections_to_file           (FILE *fh,
                                                         RefList *list);

This function writes the contents of list to fh,

Reflections which have a redundancy of zero will not be written.

The resulting list can be read back with read_reflections_from_file().

fh :

File handle to write to

list :

The reflection list to write

read_reflections ()

RefList *           read_reflections                    (const char *filename);

read_reflections_from_file ()

RefList *           read_reflections_from_file          (FILE *fh);

asymmetric_indices ()

RefList *           asymmetric_indices                  (RefList *in,
                                                         const SymOpList *sym);

This function creates a newly allocated copy of in, but indexed using the asymmetric indices according to sym instead of the original indices. The original indices are stored and can be retrieved using get_symmetric_indices() if required.

in :

A RefList

sym :

A SymOpList

Returns :

the new RefList, or NULL on failure.

res_cutoff ()

RefList *           res_cutoff                          (RefList *list,
                                                         UnitCell *cell,
                                                         double min,
                                                         double max);

Applies a resolution cutoff to list, returning the new version and freeing the old version.

list :

A RefList

cell :

A UnitCell with which to calculate 1/d values for list

min :

Minimum acceptable value of 1/d

max :

Maximum acceptable value of 1/d

Returns :

A new RefList with resolution cutoff applied

check_list_symmetry ()

int                 check_list_symmetry                 (RefList *list,
                                                         const SymOpList *sym);

copy_reflist ()

RefList *           copy_reflist                        (RefList *list);

list :

A RefList

Returns :

A copy of RefList.

find_equiv_in_list ()

int                 find_equiv_in_list                  (RefList *list,
                                                         signed int h,
                                                         signed int k,
                                                         signed int l,
                                                         const SymOpList *sym,
                                                         signed int *hu,
                                                         signed int *ku,
                                                         signed int *lu);

resolution_limits ()

void                resolution_limits                   (RefList *list,
                                                         UnitCell *cell,
                                                         double *rmin,
                                                         double *rmax);

This function calculates the minimum and maximum values of 1/d, where 2dsin(theta) = wavelength. The answers are in m^-1.

list :

A RefList

cell :

A UnitCell

rmin :

Place to store the minimum 1/d value

rmax :

Place to store the maximum 1/d value

max_intensity ()

double              max_intensity                       (RefList *list);

list :

A RefList

Returns :

The maximum intensity in list.