Clipper
|
NXmap<T>: actual non-crystallographic map class. More...
#include <nxmap.h>
Public Member Functions | |
NXmap () | |
Null constructor, for later initialisation. | |
NXmap (const Grid &grid, const RTop<> &rt) | |
Constructor: takes grid and orthogonal->grid coordinate operator. | |
NXmap (const Cell &cell, const Grid_sampling &grid, const Grid_range &grid_extent) | |
Constructor: takes grid, cell, and extent. | |
void | init (const Grid &grid, const RTop<> &rt) |
initialiser: takes grid and orthogonal->grid coordinate operator | |
void | init (const Cell &cell, const Grid_sampling &grid, const Grid_range &grid_extent) |
initialiser: takes grid, cell, and fraction limits | |
const T & | operator[] (const NXmap_base::Map_reference_index i) const |
get data by Map_reference_index | |
T & | operator[] (const NXmap_base::Map_reference_index i) |
set data by Map_reference_index | |
const T & | operator[] (const NXmap_base::Map_reference_coord i) const |
get data by Map_reference_coord | |
T & | operator[] (const NXmap_base::Map_reference_coord i) |
set data by Map_reference_coord | |
const T & | get_data (const Coord_grid &pos) const |
get a density value for an arbitrary position | |
void | set_data (const Coord_grid &pos, const T &val) |
set a density value for an arbitrary position | |
template<class I > | |
T | interp (const Coord_map &pos) const |
get map value for map coord using supplied interpolator | |
template<class I > | |
void | interp_grad (const Coord_map &pos, T &val, Grad_map< T > &grad) const |
get map value and grad for map coord using supplied interpolator | |
template<class I > | |
void | interp_curv (const Coord_map &pos, T &val, Grad_map< T > &grad, Curv_map< T > &curv) const |
get map value and curv for map coord using supplied interpolator | |
const Grid & | grid () const |
return the grid dimensions for this map | |
const RTop | operator_orth_grid () const |
return the orthogonal-to-grid coordinate operator | |
const RTop | operator_grid_orth () const |
return the grid-to-orthogonal coordinate operator | |
const Coord_orth | coord_orth (const Coord_map &cg) const |
convert map coordinate to orthogonal | |
const Coord_map | coord_map (const Coord_orth &co) const |
convert orthogonal coordinate to map | |
const Map_reference_index | first () |
const Map_reference_coord | first_coord () |
const T & | operator= (const T &value) |
assignment operator: assigns a single value to the whole map | |
const NXmap< T > & | operator+= (const NXmap< T > &other) |
add another map to this one | |
const NXmap< T > & | operator-= (const NXmap< T > &other) |
subtract another map from this one |
NXmap<T>: actual non-crystallographic map class.
The non-crystallographic map class stores a map of arbitrary data type. Unlike an Xmap it is finite in extent and has no symmetry. An RT operator provides mapping onto an arbitrary orthogonal coordinate frame. Iterators provide efficient access to data.
This is derived from NXmap_base, and adds the templatised data itself and the methods which deal with it.
clipper::NXmap< T >::NXmap | ( | const Grid & | grid, |
const RTop<> & | rt | ||
) |
Constructor: takes grid and orthogonal->grid coordinate operator.
Initialise an NXmap to some rhomboid chosen from within a crystal coordinate space, specified by the grid and a transformation from orthogonal to grid coordinates.
grid | The grid dimensions of the desired map. |
rt | The rotation/transln op from orthogonal to grid coordinates. |
clipper::NXmap< T >::NXmap | ( | const Cell & | cell, |
const Grid_sampling & | grid, | ||
const Grid_range & | grid_extent | ||
) |
Constructor: takes grid, cell, and extent.
Initialise an NXmap to some rhomboid chosen from within a crystal grid coordinate space, specified by a cell, sampling and box within that grid. This is useful for creating an NXmap which exactly matches some subregion of a crystallographic map.
cell | Unit cell defining the crystal space. |
grid | The grid sampling of the given unit cell. |
grid_extent | The map extent within that cell. |
void clipper::NXmap< T >::init | ( | const Grid & | grid, |
const RTop<> & | rt | ||
) |
initialiser: takes grid and orthogonal->grid coordinate operator
Initialise an NXmap to some rhomboid chosen from within a crystal coordinate space, specified by the grid and a transformation from orthogonal to grid coordinates.
grid | The grid dimensions of the desired map. |
rt | The rotation/transln op from orthogonal to grid coordinates. |
Reimplemented from clipper::NXmap_base.
References clipper::NXmap_base::init(), and clipper::Grid::size().
void clipper::NXmap< T >::init | ( | const Cell & | cell, |
const Grid_sampling & | grid, | ||
const Grid_range & | grid_extent | ||
) |
initialiser: takes grid, cell, and fraction limits
Initialise an NXmap to some rhomboid chosen from within a crystal grid coordinate space, specified by a cell, sampling and box within that grid. This is useful for creating an NXmap which exactly matches some subregion of a crystallographic map.
cell | Unit cell defining the crystal space. |
grid | The grid sampling of the given unit cell. |
grid_extent | The map extent within that cell. |
Reimplemented from clipper::NXmap_base.
References clipper::NXmap_base::init(), and clipper::Grid::size().
get map value for map coord using supplied interpolator
The value of the map at the desired non-grid map coordinate are calculated using the supplied interpolator template.
pos | The map coord at which the density is to be calcuated. |
void clipper::NXmap< T >::interp_grad | ( | const Coord_map & | pos, |
T & | val, | ||
Grad_map< T > & | grad | ||
) | const |
get map value and grad for map coord using supplied interpolator
The value of the map at the desired non-grid map coordinate and its gradient are calculated using the supplied interpolator template.
pos | The map coord at which the density is to be calcuated. |
val | The value of the density at that point. |
grad | The interpolated gradient vector with respect to the map coordinates (see Cell::coord_orth). |
curv | The interpolated curvature matrix with respect to the map coordinates (see Cell::coord_orth). |
void clipper::NXmap< T >::interp_curv | ( | const Coord_map & | pos, |
T & | val, | ||
Grad_map< T > & | grad, | ||
Curv_map< T > & | curv | ||
) | const |
get map value and curv for map coord using supplied interpolator
The value of the map at the desired non-grid map coordinate and its gradient and curvature are calculated using the supplied interpolator template.
pos | The map coord at which the density is to be calcuated. |
val | The value of the density at that point. |
grad | The interpolated gradient vector with respect to the map coordinates (see Cell::coord_orth). |
curv | The interpolated curvature matrix with respect to the map coordinates (see Cell::coord_orth). |
const Coord_orth clipper::NXmap< T >::coord_orth | ( | const Coord_map & | cm | ) | const |
convert map coordinate to orthogonal
cm | The grid coordinate to be converted. |
Reimplemented from clipper::NXmap_base.
const Coord_map clipper::NXmap< T >::coord_map | ( | const Coord_orth & | co | ) | const |
convert orthogonal coordinate to map
co | The orthogonal coordinate to be converted. |
Reimplemented from clipper::NXmap_base.
const T & clipper::NXmap< T >::operator= | ( | const T & | value | ) |
assignment operator: assigns a single value to the whole map
All values, including missing values, are overwritten by the value.
value | The value to which the map is to be set. |
References clipper::NXmap_base::Map_reference_index::index(), clipper::NXmap_base::Map_reference_index::last(), and clipper::NXmap_base::Map_reference_index::next().
const NXmap< T > & clipper::NXmap< T >::operator+= | ( | const NXmap< T > & | other | ) |
add another map to this one
The map grids must match.
References clipper::NXmap< T >::grid(), clipper::NXmap_base::Map_reference_index::index(), clipper::NXmap_base::Map_reference_index::last(), clipper::Message::message(), and clipper::NXmap_base::Map_reference_index::next().
const NXmap< T > & clipper::NXmap< T >::operator-= | ( | const NXmap< T > & | other | ) |
subtract another map from this one
The map grids must match.
References clipper::NXmap< T >::grid(), clipper::NXmap_base::Map_reference_index::index(), clipper::NXmap_base::Map_reference_index::last(), clipper::Message::message(), and clipper::NXmap_base::Map_reference_index::next().