Unit cell utilities

Unit cell utilities — Unit cell utilities

Functions

Includes

#include "cell-utils.h"

Description

There are some utility functions associated with the core UnitCell.

Functions

cell_rotate ()

UnitCell *
cell_rotate (UnitCell *in,
             struct quaternion quat);

Rotate a UnitCell using a quaternion.

Parameters

in

A UnitCell to rotate

 

quat

A quaternion

 

Returns

a newly allocated rotated copy of in .


rotate_cell ()

UnitCell *
rotate_cell (UnitCell *in,
             double omega,
             double phi,
             double rot);

Rotate a UnitCell using Euler angles

Parameters

in

A UnitCell to rotate

 

omega

Euler angle about +z

 

phi

Euler angle about +x

 

rot

Euler angle about new +z

 

Returns

a newly allocated rotated copy of in .


cell_print ()

void
cell_print (UnitCell *cell);

resolution ()

double
resolution (UnitCell *cell,
            signed int h,
            signed int k,
            signed int l);

match_cell ()

UnitCell *
match_cell (UnitCell *cell,
            UnitCell *tempcell,
            int verbose,
            const float *ltl,
            int reduce);

match_cell_ab ()

UnitCell *
match_cell_ab (UnitCell *cell,
               UnitCell *tempcell);

cell_is_sensible ()

int
cell_is_sensible (UnitCell *cell);

validate_cell ()

int
validate_cell (UnitCell *cell);

Perform some checks for crystallographic validity cell , such as that the lattice is a conventional Bravais lattice. Warnings are printied if any of the checks are failed.

Parameters

cell

A UnitCell to validate

 

Returns

true if cell is invalid.


uncenter_cell ()

UnitCell *
uncenter_cell (UnitCell *in,
               UnitCellTransformation **t);

Turns any cell into a primitive one, e.g. for comparison purposes. The transformation which was used is stored at t , which can be NULL if the transformation is not required.

Parameters

in

A UnitCell

 

t

Location at which to store the transformation which was used.

 

Returns

a primitive version of in in a conventional (unique axis c) setting.


bravais_lattice ()

int
bravais_lattice (UnitCell *cell);

right_handed ()

int
right_handed (UnitCell *cell);

str_lattice ()

const char *
str_lattice (LatticeType l);

forbidden_reflection ()

int
forbidden_reflection (UnitCell *cell,
                      signed int h,
                      signed int k,
                      signed int l);

Parameters

cell

A UnitCell

 

h

h index to check

 

k

k index to check

 

l

l index to check

 

Returns

true if this reflection is forbidden.


load_cell_from_pdb ()

UnitCell *
load_cell_from_pdb (const char *filename);

Loads a unit cell from the CRYST1 line of a PDB file.

Parameters

filename

The filename from which to load the cell

 

Returns

a newly allocated UnitCell.


load_cell_from_file ()

UnitCell *
load_cell_from_file (const char *filename);

Loads a unit cell from a file of any type (PDB or CrystFEL format)

Parameters

filename

The filename from which to load the cell

 

Returns

a newly allocated UnitCell.


write_cell ()

void
write_cell (UnitCell *cell,
            FILE *fh);

Writes cell to fh , in CrystFEL unit cell file format

Parameters

cell

a UnitCell

 

fh

a file handle

 

lattice_from_str ()

LatticeType
lattice_from_str (const char *s);

cell_get_volume ()

double
cell_get_volume (UnitCell *cell);

Types and Values