The CMTZ library is centred around a data structure, defined in mtzdata.h Reading an MTZ file causes a data structure to be created and populated from the MTZ header. There are a variety of functions for manipulating the data structure, for example adding crystals, datasets or columns. The data structure can be dumped to an output MTZ data file.
The library operates in two modes with respect to the reflection data. If
mtz->refs_in_memory = 1 (as set e.g. by the argument to
MtzGet), then all reflection data is read into memory from the file, and can be manipulated in memory. Else if
mtz->refs_in_memory = 0 then explicit calls to
ccp4_lwrefl are required to read and write reflections from/to disk.
Information on the data structure is given in mtzdata.h
Reading MTZ files
Start by looking at
Writing MTZ files
If you have a structure in memory already, use
MtzPut followed by
MtzFree to release the memory.
If you need to create a structure from scratch (i.e. without reading from an input file) then use
All reflection data in an MTZ file is assumed to belong to the same spacegroup. The spacegroup is identified in the MTZ file by SYMINF and SYMM records in the file header. This information is copied into the in-memory data structure. The list of symmetry operators (copied from the SYMM header records) is taken to be the definitive indicator of the spacegroup.
ccp4_lwsymm read from and write to the symmetry sections of the data structure. No symmetry manipulations are done within the CMTZ library itself. Within CCP4, the CSYM library provides appropriate functions, but other symmetry libraries could be used.
See examples on ftp area