Main Page   Data Structures   File List   Data Fields   Globals  

mmtzlib.h

Go to the documentation of this file.
00001 
00058 #ifndef CCP4_MMTZLIB_INC
00059 #define CCP4_MMTZLIB_INC
00060 
00061 #include "umtzlib.h"
00062 
00063 /* define types for mtz records */
00064 
00065 typedef umtzfile* mmtzfile;
00066 
00067 /* info about mtz column */
00068 typedef struct mmtz_column_ {
00069   char label[31];
00070   char type[2];
00071 } mmtz_column;
00072 
00073 /* info about mtz dataset */
00074 typedef struct mmtz_dataset_ {
00075   char dname[65];
00076   float wavel;
00077 } mmtz_dataset;
00078 
00079 /* info about mtz crystal */
00080 typedef struct mmtz_crystal_ {
00081   char xname[65];
00082   float cell[6];
00083   char pname[65];
00084 } mmtz_crystal;
00085 
00086 /* open a file for read/write (and read headers if necessary) */
00087 mmtzfile mmtz_open( const char* filename, const char* mode );
00088 
00089 /* close a file for read/write (and write header if necessary) */
00090 void mmtz_close( mmtzfile file );
00091 
00092 /* copy headers from one file to another (for append) */
00093 void mmtz_copy_headers( mmtzfile dest, const mmtzfile src );
00094 
00095 /* get number of reflections */
00096 int mmtz_num_rows( const mmtzfile file );
00097 
00098 /* get number of columns */
00099 int mmtz_num_cols( const mmtzfile file );
00100 
00101 /* get number of columns */
00102 int mmtz_num_datasets( const mmtzfile file );
00103 
00104 /* get number of symops */
00105 int mmtz_get_num_symops( const mmtzfile file );
00106 
00107 /* get n'th symops */
00108 char* mmtz_get_symop( const mmtzfile file, const int isym, char* symop );
00109 
00110 /* get base cell */
00111 float* mmtz_get_cell( const mmtzfile file, float* cell );
00112 
00113 /* get dataset and crystal info */
00114 void mmtz_get_setxtl( const mmtzfile file, const int icol, mmtz_dataset* set, mmtz_crystal* xtl );
00115 
00116 /* get column: Get the n'th column from the file, along with dataset
00117    and crystal. */
00118 int mmtz_get_column( const mmtzfile file, const int icol, mmtz_column* col, mmtz_dataset* set, mmtz_crystal* xtl );
00119 
00120 /* add column: supply column, dataset, crystal. dataset and crystal
00121    have their names checked in turn, and if they already exist the
00122    existing copies are used.  */
00123 int mmtz_add_column( mmtzfile file, const mmtz_column* col, const mmtz_dataset* set, const mmtz_crystal* xtl );
00124 
00125 /* write the initial headers to a new mtz */
00126 void mmtz_init_headers( mmtzfile file, const char* title, const float cell[6] );
00127 
00128 /* write sort order header to a new mtz: Writing the sort order header
00129    is an assertion that reflections will be supplied in the given
00130    order. This is not checked. Failure will lead to an invalid
00131    mtz. sortorder contains 3 chars, H, K and L, giving the names of
00132    the slow, medium and fast columns in order. (usually "HKL") */
00133 void mmtz_add_sort_header( mmtzfile file, const char* sortorder );
00134 
00135 /* write spacegroup header to a new mtz file: Writing the syminf
00136    header is an assertion that you will later supply (nsym) symmetry
00137    operators to go with it. This is not checked. Failure will lead to
00138    an invalid mtz. */
00139 void mmtz_add_syminf_header( mmtzfile file, const int nsym, const int nsymp, const char cellcode, const int ccp4_symbol, const char* hm_symbol, const char* pg_symbol );
00140 
00141 /* write a symop header to a new mtz file: Note you must supply the
00142    same number of symops as were specified in the syminf header */
00143 void mmtz_add_symop_header( mmtzfile file, const char* symop );
00144 
00145 /* get the next row of data from the file. If data is present, it is
00146    marked with flags[col]=TRUE, if it is missing flags[col]=FALSE */
00147 void mmtz_get_row( const mmtzfile file, float* fdata, int* flags );
00148 
00149 /* write a new row of data to the file. Data will be marked as missing
00150    in the file if it has flags[col]=FALSE */
00151 void mmtz_add_row( mmtzfile file, float* fdata, const int* flags );
00152 
00153 /* get the next row of data from the file. If data is present, it is
00154    marked with flags[col]=TRUE, if it is missing flags[col]=FALSE */
00155 void mmtz_seek_row( const mmtzfile file, const int n );
00156 
00157 #endif

Generated at Fri Dec 14 11:37:56 2001 by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001