Unit cell utilities

Unit cell utilities — Unit cell utilities

Synopsis

#include "cell-utils.h"


UnitCell *          cell_rotate                         (UnitCell *in,
                                                         struct quaternion quat);
UnitCell *          rotate_cell                         (UnitCell *in,
                                                         double omega,
                                                         double phi,
                                                         double rot);
void                cell_print                          (UnitCell *cell);
double              resolution                          (UnitCell *cell,
                                                         signed int h,
                                                         signed int k,
                                                         signed int l);
UnitCell *          match_cell                          (UnitCell *cell,
                                                         UnitCell *tempcell,
                                                         int verbose,
                                                         const float *ltl,
                                                         int reduce);
UnitCell *          match_cell_ab                       (UnitCell *cell,
                                                         UnitCell *tempcell);
int                 cell_is_sensible                    (UnitCell *cell);
int                 validate_cell                       (UnitCell *cell);
UnitCell *          uncenter_cell                       (UnitCell *in,
                                                         UnitCellTransformation **t);
int                 bravais_lattice                     (UnitCell *cell);
int                 right_handed                        (UnitCell *cell);
const char *        str_lattice                         (LatticeType l);
int                 forbidden_reflection                (UnitCell *cell,
                                                         signed int h,
                                                         signed int k,
                                                         signed int l);
UnitCell *          load_cell_from_pdb                  (const char *filename);
LatticeType         lattice_from_str                    (const char *s);

Description

There are some utility functions associated with the core UnitCell.

Details

cell_rotate ()

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

Rotate a UnitCell using a quaternion.

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

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.

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.

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);

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);

lattice_from_str ()

LatticeType         lattice_from_str                    (const char *s);