libcrystfel 0.11.1
Loading...
Searching...
No Matches
Functions
reflist-utils.h File Reference

Functions

int write_reflist (const char *filename, RefList *list)
 
int write_reflist_2 (const char *filename, RefList *list, SymOpList *sym)
 
RefListread_reflections (const char *filename)
 
RefListread_reflections_2 (const char *filename, char **sym)
 
RefListread_reflections_3 (const char *filename, char **sym, UnitCell **cell)
 
int check_list_symmetry (RefList *list, const SymOpList *sym)
 
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)
 
RefListasymmetric_indices (RefList *in, const SymOpList *sym)
 
void resolution_limits (RefList *list, UnitCell *cell, double *rmin, double *rmax)
 
double max_intensity (RefList *list)
 
RefListres_cutoff (RefList *list, UnitCell *cell, double min, double max)
 
RefListcopy_reflist (RefList *list)
 
void free_contribs (RefList *list)
 
void reflist_add_command_and_version (RefList *list, int argcv, char *argv[])
 
int write_to_mtz (RefList *reflist, SymOpList *sym, UnitCell *cell, double min_res, double max_res, const char *filename, const char *dataset_name, const char *crystal_name, const char *project_name, int bij)
 
int write_to_xds (RefList *reflist, SymOpList *sym, UnitCell *cell, double min_res, double max_res, const char *filename)
 
int libcrystfel_can_write_mtz (void)
 

Detailed Description

Reflection list utility functions.

Function Documentation

◆ asymmetric_indices()

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

asymmetric_indices:

Parameters
inA RefList
symA SymOpList

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.

Returns: the new RefList, or NULL on failure.

◆ check_list_symmetry()

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

Checks that the symmetry of list is indeed sym.

Parameters
listA list of reflections
symSymmetry of the reflection list
Returns
0 if the symmetry is correct, otherwise 1

◆ copy_reflist()

RefList * copy_reflist ( RefList * list)
extern

copy_reflist:

Parameters
listA RefList

Returns: A copy of RefList.

◆ free_contribs()

void free_contribs ( RefList * list)
extern

free_contribs:

Parameters
listA RefList

Goes through list and frees all the reflection contribution structures.

◆ max_intensity()

double max_intensity ( RefList * list)
extern

max_intensity:

Parameters
listA RefList

Returns: The maximum intensity in list.

◆ read_reflections()

RefList * read_reflections ( const char * filename)
extern

read_reflections:

Parameters
filenameFilename to read from

This function reads a reflection list from a file.

Returns: A RefList read from the file, or NULL on error

◆ read_reflections_2()

RefList * read_reflections_2 ( const char * filename,
char ** sym )
extern

read_reflections_2:

Parameters
filenameFilename to read from
symPointer to a "char *" at which to store the symmetry

This function reads a reflection list from a file, including the point group name from the header (e.g. "4/mmm").

The file can be a CrystFEL reflection data file, or an MTZ file provided that CrystFEL has been compiled with libCCP4 available. MTZ files contain the unit cell parameters - if you want this information, use read_reflections_2 instead.

Returns: A RefList read from the file, or NULL on error

◆ read_reflections_3()

RefList * read_reflections_3 ( const char * filename,
char ** sym,
UnitCell ** cell )
extern

read_reflections_3:

Parameters
filenameFilename to read from
symPointer to a "char *" at which to store the symmetry
cellPointer to a "UnitCell *" at which to store the unit cell

This function reads a reflection list from a file, including the point group name from the header (e.g. "4/mmm").

The file can be a CrystFEL reflection data file, or an MTZ file provided that CrystFEL has been compiled with libCCP4 available. The unit cell will only be returned when reading from an MTZ file - CrystFEL reflection data files don't contain this information.

Returns: A RefList read from the file, or NULL on error

◆ res_cutoff()

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

res_cutoff:

Parameters
listA RefList
cellA UnitCell with which to calculate 1/d values for list
minMinimum acceptable value of 1/d
maxMaximum acceptable value of 1/d

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

Returns: A new RefList with resolution cutoff applied

◆ resolution_limits()

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

resolution_limits:

Parameters
listA RefList
cellA UnitCell
rminPlace to store the minimum 1/d value
rmaxPlace to store the maximum 1/d value

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

◆ write_reflist()

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

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.

Deprecated
Use write_reflist_2() instead.
Parameters
filenameFilename
listThe 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 )
extern

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().

Parameters
filenameFilename
listThe reflection list to write
symA SymOpList describing the symmetry of the list
Returns
zero on success, non-zero on failure.