gpp4  1.3.1
cmtzlib.h
Go to the documentation of this file.
1 /*
2  cmtzlib.h: header file for cmtzlib.c
3  Copyright (C) 2001 CCLRC, Martyn Winn
4 
5  This library is free software: you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation, either
8  version 3 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with This library. If not, see
17  <http://www.gnu.org/licenses/>.
18 
19 */
20 
101 #ifndef __CMTZLib__
102 #define __CMTZLib__
103 
104 
105 /* defines CCP4::CCP4File */
106 #include "ccp4_utils.h"
107 
108 #ifdef __cplusplus
109 namespace CMtz {
110 extern "C" {
111 typedef CCP4::CCP4File CCP4File;
112 #endif
113 
114 /* needs to be here for C++ to use CCP4File typedef */
115 #include "mtzdata.h"
116 
117 /**** MTZ i/o ****/
118 
125 MTZ *MtzGet(const char *logname, int read_refs);
126 
138 MTZ *MtzGetUserCellTolerance(const char *logname, int read_refs, const double cell_tolerance);
139 
146 int MtzRrefl(CCP4File *filein, int ncol, float *refldata);
147 
154 int MtzPut(MTZ *mtz, const char *logname);
155 
163 CCP4File *MtzOpenForWrite(const char *logname);
164 
172 int MtzWhdrLine(CCP4File *fileout, int nitems, char buffer[]);
173 
181 int MtzWrefl(CCP4File *fileout, int ncol, float *refldata);
182 
189 int MtzDeleteRefl(MTZ *mtz, int iref);
190 
195 void MtzRewdInput(MTZ *mtz);
196 
197 /**** Memory allocation ****/
198 
210 MTZ *MtzMalloc(int nxtal, int nset[]);
211 
216 int MtzFree(MTZ *mtz);
217 
224 MTZCOL *MtzMallocCol(MTZ *mtz, int nref);
225 
230 int MtzFreeCol(MTZCOL *col);
231 
235 MTZBAT *MtzMallocBatch(void);
236 
241 int MtzFreeBatch(MTZBAT *batch);
242 
247 char *MtzCallocHist(int nhist);
248 
253 int MtzFreeHist(char *hist);
254 
260 void MtzMemTidy(void);
261 
262 /**** Header operations ****/
263 
268 int MtzNbat(const MTZ *mtz);
269 
274 int MtzNref(const MTZ *mtz);
275 
280 int MtzSpacegroupNumber(const MTZ *mtz);
281 
289 int MtzResLimits(const MTZ *mtz, float *minres, float *maxres);
290 
291 /**** Crystal operations ****/
292 
297 int MtzNxtal(const MTZ *mtz);
298 
303 int MtzNumActiveXtal(const MTZ *mtz);
304 
309 MTZXTAL **MtzXtals(MTZ *mtz);
310 
316 MTZXTAL *MtzIxtal(const MTZ *mtz, const int ixtal);
317 
324 char *MtzXtalPath(const MTZXTAL *xtal);
325 
331 MTZXTAL *MtzXtalLookup(const MTZ *mtz, const char *label);
332 
340 MTZXTAL *MtzAddXtal(MTZ *mtz, const char *xname, const char *pname,
341  const float cell[6]);
342 
347 int MtzNsetsInXtal(const MTZXTAL *xtal);
348 
353 int MtzNumActiveSetsInXtal(const MTZ *mtz, const MTZXTAL *xtal);
354 
360 MTZSET **MtzSetsInXtal(MTZXTAL *xtal);
361 
368 MTZSET *MtzIsetInXtal(const MTZXTAL *xtal, const int iset);
369 
370 /**** Dataset operations ****/
371 
376 int MtzNset(const MTZ *mtz);
377 
382 int MtzNumActiveSet(const MTZ *mtz);
383 
391 MTZXTAL *MtzSetXtal(const MTZ *mtz, const MTZSET *set);
392 
401 char *MtzSetPath(const MTZ *mtz, const MTZSET *set);
402 
409 MTZSET *MtzSetLookup(const MTZ *mtz, const char *label);
410 
418 MTZSET *MtzAddDataset(MTZ *mtz, MTZXTAL *xtl, const char *dname,
419  const float wavelength);
420 
427 int MtzNcolsInSet(const MTZSET *set);
428 
433 int MtzNumActiveColsInSet(const MTZSET *set);
434 
440 int MtzNumSourceColsInSet(const MTZSET *set);
441 
447 int MtzNbatchesInSet(const MTZ *mtz, const MTZSET *set);
448 
454 MTZCOL **MtzColsInSet(MTZSET *set);
455 
463 MTZCOL *MtzIcolInSet(const MTZSET *set, const int icol);
464 
465 /**** Column operations ****/
466 
474 MTZCOL *MtzAddColumn(MTZ *mtz, MTZSET *set, const char *label,
475  const char *type);
476 
481 int MtzAssignHKLtoBase(MTZ *mtz);
482 
495 int MtzAssignColumn(MTZ *mtz, MTZCOL *col, const char crystal_name[],
496  const char dataset_name[]);
497 
504 int MtzToggleColumn(MTZCOL *col);
505 
512 MTZSET *MtzColSet(const MTZ *mtz, const MTZCOL *col);
513 
518 int MtzNcol(const MTZ *mtz);
519 
524 int MtzNumActiveCol(const MTZ *mtz);
525 
531 int MtzNumSourceCol(const MTZ *mtz);
532 
540 char *MtzColPath(const MTZ *mtz, const MTZCOL *col);
541 
548 int MtzRJustPath(char *path, const char *partial, const int njust);
549 
555 int MtzPathMatch(const char *path1, const char *path2);
556 
562 MTZCOL *MtzColLookup(const MTZ *mtz, const char *label);
563 
568 char *MtzColType(MTZCOL *col);
569 
575 void MtzDebugHierarchy(const MTZ *mtz);
576 
584 int MtzListColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
585 
593 int MtzListInputColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
594 
595 /**** helper functions ****/
596 
605 int MtzFindInd(const MTZ *mtz, int *ind_xtal, int *ind_set, int ind_col[3]);
606 
613 float MtzInd2reso(const int in[3], const double coefhkl[6]);
614 
620 int MtzHklcoeffs(const float cell[6], double coefhkl[6]);
621 
628 int MtzArrayToBatch(const int *intbuf, const float *fltbuf, MTZBAT *batch);
629 
636 int MtzBatchToArray(MTZBAT *batch, int *intbuf, float *fltbuf);
637 
646 MTZBAT *sort_batches(MTZBAT *batch, int numbat);
647 
648 /**** pseudo-mtzlib routines ****/
649 
656 int ccp4_lrtitl(const MTZ *mtz, char *title);
657 
664 int ccp4_lrhist(const MTZ *mtz, char history[][MTZRECORDLENGTH], int nlines);
665 
671 int ccp4_lrsort(const MTZ *mtz, int isort[5]);
672 
679 int ccp4_lrbats(const MTZ *mtz, int *nbatx, int batchx[]);
680 
686 int ccp4_lrcell(const MTZXTAL *xtl, float cell[]);
687 
697 int ccp4_lrsymi(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx,
698  char *spgrnx, char *pgnamx);
699 
711 int ccp4_lrsymi_c(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx,
712  char *spgrnx, char *pgnamx, char *spgconf);
713 
723 int ccp4_lrsymm(const MTZ *mtz, int *nsymx, float rsymx[192][4][4]);
724 
734 int MtzParseLabin(char *labin_line, const char prog_labels[][31],
735  const int nlprgi, char user_labels[][2][31]);
736 
750 MTZCOL **ccp4_lrassn(const MTZ *mtz, const char labels[][31], const int nlabels,
751  char types[][3]);
752 
766 int ccp4_lridx(const MTZ *mtz, const MTZSET *set, char crystal_name[64],
767  char dataset_name[64], char project_name[64], int *isets,
768  float datcell[6], float *datwave);
769 
785 int ccp4_lrrefl(const MTZ *mtz, float *resol, float adata[], int logmss[], int iref);
786 
803 int ccp4_lrreff(const MTZ *mtz, float *resol, float adata[], int logmss[],
804  const MTZCOL *lookup[], const int ncols, const int iref);
805 
813 int ccp4_ismnf(const MTZ *mtz, const float datum);
814 
820 int ccp4_lhprt(const MTZ *mtz, int iprint);
821 
828 int ccp4_lhprt_adv(const MTZ *mtz, int iprint);
829 
837 int ccp4_lrbat(MTZBAT *batch, float *buf, char *charbuf, int iprint);
838 
843 int MtzPrintBatchHeader(const MTZBAT *batch);
844 
852 int ccp4_lwtitl(MTZ *mtz, const char *ftitle, int flag);
853 
863 int MtzSetSortOrder(MTZ *mtz, MTZCOL *colsort[5]);
864 
871 int MtzAddHistory(MTZ *mtz, const char history[][MTZRECORDLENGTH], const int nlines);
872 
888 int ccp4_lwsymm(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4],
889  char ltypex[], int nspgrx, char spgrnx[], char pgnamx[]);
890 
908 int ccp4_lwsymm_c(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4],
909  char ltypex[], int nspgrx, char spgrnx[], char pgnamx[],
910  char spgconf[]);
911 
917 int ccp4_lwsymconf(MTZ *mtz, char spgconf[]);
918 
919 /* Assign columns for writing. Check to see if columns already exist,
920  * else create them. New columns are assigned to the base dataset if it
921  * exists, else the first dataset.
922  * @param mtz pointer to MTZ struct
923  * @param labels Input array of column labels to be assigned.
924  * @param nlabels Number of columns.
925  * @param types Input array of column types of columns.
926  * @param iappnd If iappnd = 0, then deactivate columns which are
927  * not selected (allows one to write out a subset of columns). Else
928  * if iappnd = 1, append these columns to existing ones.
929  * @return Array of pointers to columns in MTZ struct.
930  */
931 MTZCOL **ccp4_lwassn(MTZ *mtz, const char labels[][31], const int nlabels,
932  const char types[][3], const int iappnd);
933 
934 /* Add or update a dataset in the MTZ structure. If the crystal name is
935  * not recognised, then a new crystal is created containing a single
936  * dataset. If the crystal name is recognised, then the parameters of
937  * the crystal are updated. The child dataset is then created if necessary
938  * or an existing dataset updated.
939  * Note that this function is used to update crystal parameters, as well
940  * as add crystals. If a duplicate crystal name is used by mistake, then
941  * the old crystal parameters are lost.
942  * @param mtz pointer to MTZ struct
943  * @param crystal_name Crystal name
944  * @param dataset_name Dataset name
945  * @param project_name Project name
946  * @param datcell Cell dimensions of crystal that dataset belongs to.
947  * @param datwave X-ray wavelength associated with dataset.
948  * @return 1 on success, 0 on failure
949  */
950 int ccp4_lwidx(MTZ *mtz, const char crystal_name[], const char dataset_name[],
951  const char project_name[], const float datcell[6], const float *datwave);
952 
953 
971 int ccp4_lwrefl(MTZ *mtz, const float adata[], MTZCOL *lookup[],
972  const int ncol, const int iref);
973 
987 int ccp4_lwbat(MTZ *mtz, MTZBAT *batch, const int batno, const float *buf, const char *charbuf);
988 
989 int ccp4_lwbsetid(MTZ *mtz, MTZBAT *batch, const char xname[], const char dname[]);
990 
991 /* -- Below here there are no implementations -- */
992 
993 /* COMPLEX HLToSF(float hla, float hlb, float hlc, float hld, BOOLEAN centric); */
994 /* Returns the mean structure factor as a complex number from a structure
995  factor probability distribution described by Hendrickson/Lattman
996  coefficients. If `centric == TRUE`, the coefficients describe a centric
997  distribution. */
998 
999 /* MTZ *MtzSort(MTZ *mtz, char *ident); */
1000 /* Sorts `mtz` using the identifiers (separated by spaces) in `ident` as
1001  keys. Sorting can be done on up to 200 columns. A pointer to `*mtz` is
1002  returned. */
1003 
1004 /* MTZ *HLCombine (MTZ *to, float toscale, MTZ *frm, float frmscale); */
1005 /* Combines extra phase information for common reflections between 'frm'
1006  and 'to' into the phase information of 'to'. The phase probabilities
1007  are described by Hendrickson Lattman coefficients, with the identifiers
1008  "HLA", "HLB", HLC", and "HLD", the indices are identified by "H", "K"
1009  and "L". HL-coeffs from 'to' are scaled by 'toscale', the coeffs from
1010  'frm' are scaled by 'frmscale'. A pointer to `to` is returned. */
1011 
1012 /* void MtzPhiFom(MTZ *mtz); */
1013 /* Calculates the best phase and the figure of from Hendrickson Lattman
1014  coefficients. The following columns should be present in `mtz`:
1015  "H", "K" & "L" (indices); "PHIB" & "FOM" (best phase (degrees) and figure of
1016  merit); "HLA", "HLB", "HLC" & "HLD" (Hendrickson Lattman coefficients). */
1017 
1018 /* MTZ *MtzCopy(MTZ *frm); */
1019 /* Produces an exact copy of `frm` and returns a pointer to it. */
1020 
1021 /* MTZ *MtzColAppend(MTZ *mtz, char *ident, char type); */
1022 /* Appends a column to `*mtz` with identity `ident` and type `type`, provided
1023  no column with identity `ident` exists. */
1024 
1025 /* MTZ *MtzColRemove(MTZ *mtz, char *ident); */
1026 /* Removes a column from `*mtz` with identity `ident`. */
1027 
1028 /* MTZ *MtzUpdateRanges(MTZ *mtz); */
1029 /* Updates ranges of all columns in `mtz` and returns `mtz`. */
1030 
1031 /* MTZCOL *MtzColNewRange(MTZCOL *col, int nref); */
1032 /* Updates the minimum & maximum values in `col` and returns `col`. */
1033 
1034 /* int *MtzUnique(MTZ *mtz, char *ident); */
1035 /* Returns an array (k) of indices: k[j] returns the first occurrence of a set
1036  of idents, eg. MtzUnique(mtz, "H K L") returns an array from which all the
1037  unique reflections can be determined by indexing with k: k[i] is the index
1038  of the last relection of a set which all have the same hkl indices. It is
1039  assumed that `mtz` is sorted, using `ident` as keys. */
1040 
1041 /* float PhaseProb(float phase, float hla, float hlb, float hlc, float hld,
1042  BOOLEAN centric); */
1043 /* Returns the probability of `phase` (expressed in radians) as determined by
1044  the Hendrickson-Lattman coefficients `hla`, `hlb`, `hlc` and `hld`. If
1045  `centric == TRUE`, the coefficients describe a centric distribution. */
1046 
1047 #ifdef __cplusplus
1048 } }
1049 #endif
1050 #endif
ccp4_signal
void ccp4_signal(const int, const char *const, void(*)())
Definition: library_err.c:278
bathead::bbfac
float bbfac
Definition: mtzdata.h:123
bathead::e3
float e3[3]
Definition: mtzdata.h:131
MtzListInputColumn
int MtzListInputColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[])
Definition: cmtzlib.c:1224
MtzNumActiveXtal
int MtzNumActiveXtal(const MTZ *mtz)
Definition: cmtzlib.c:3625
bathead::dx
float dx[2]
Definition: mtzdata.h:140
bathead::phirange
float phirange
Definition: mtzdata.h:126
MtzColPath
char * MtzColPath(const MTZ *mtz, const MTZCOL *col)
Definition: cmtzlib.c:3820
MtzGetUserCellTolerance
MTZ * MtzGetUserCellTolerance(const char *logname, int read_refs, const double cell_tolerance)
Definition: cmtzlib.c:74
MTZ::nref_filein
int nref_filein
Definition: mtzdata.h:176
MTZXTAL::pname
char pname[65]
Definition: mtzdata.h:77
ccp4_utils.h
Utility functions.
_CFileStruct
Definition: library_file.h:40
MTZSET::dname
char dname[65]
Definition: mtzdata.h:68
MtzRewdInput
void MtzRewdInput(MTZ *mtz)
Definition: cmtzlib.c:1643
ccp4_parser
int ccp4_parser(char *line, const int nchars, CCP4PARSERARRAY *parser, const int print)
Definition: ccp4_parser.c:742
MTZ::xml
char * xml
Definition: mtzdata.h:186
MTZ_MINOR_VERSN
#define MTZ_MINOR_VERSN
Definition: mtzdata.h:35
ccp4_lwsymm
int ccp4_lwsymm(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4], char ltypex[], int nspgrx, char spgrnx[], char pgnamx[])
Definition: cmtzlib.c:2280
MTZ::hist
char * hist
Definition: mtzdata.h:171
CCP4PARSERARRAY::token
CCP4PARSERTOKEN * token
Definition: ccp4_parser.h:153
MTZ::xtal
MTZXTAL ** xtal
Definition: mtzdata.h:183
MtzNset
int MtzNset(const MTZ *mtz)
Definition: cmtzlib.c:3727
ccp4_keymatch
int ccp4_keymatch(const char *keyin1, const char *keyin2)
Definition: ccp4_parser.c:1012
bathead::time1
float time1
Definition: mtzdata.h:120
MTZSET
Definition: mtzdata.h:67
MtzColSet
MTZSET * MtzColSet(const MTZ *mtz, const MTZCOL *col)
Definition: cmtzlib.c:3597
bathead::delamb
float delamb
Definition: mtzdata.h:136
ccp4array_size
#define ccp4array_size(v)
Definition: ccp4_array.h:188
ccp4_lwtitl
int ccp4_lwtitl(MTZ *mtz, const char *ftitle, int flag)
Definition: cmtzlib.c:2087
ccp4_file_open
CCP4File * ccp4_file_open(const char *filename, const int flag)
Definition: library_file.c:889
ccp4_unitcell.h
C library for manipulations based on cell parameters.
ccp4_lwsymm_c
int ccp4_lwsymm_c(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4], char ltypex[], int nspgrx, char spgrnx[], char pgnamx[], char spgconf[])
Definition: cmtzlib.c:2291
MTZCOL::active
int active
Definition: mtzdata.h:55
ccp4_lrsymi_c
int ccp4_lrsymi_c(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx, char *spgrnx, char *pgnamx, char *spgconf)
Definition: cmtzlib.c:1284
ccp4_array.h
Header file for resizable array implementation.
MtzNumActiveCol
int MtzNumActiveCol(const MTZ *mtz)
Definition: cmtzlib.c:3752
ccp4_lwsymconf
int ccp4_lwsymconf(MTZ *mtz, char spgconf[])
Definition: cmtzlib.c:2273
ccp4_lrrefl
int ccp4_lrrefl(const MTZ *mtz, float *resol, float adata[], int logmss[], int iref)
Definition: cmtzlib.c:1498
MtzMemTidy
void MtzMemTidy(void)
Definition: cmtzlib_f.c:107
MTZXTAL::cell
float cell[6]
Definition: mtzdata.h:78
ccp4_file_setstamp
int ccp4_file_setstamp(CCP4File *cfile, const size_t offset)
Definition: library_file.c:625
MtzNxtal
int MtzNxtal(const MTZ *mtz)
Definition: cmtzlib.c:3620
bathead::ngonax
int ngonax
Definition: mtzdata.h:103
MtzIsetInXtal
MTZSET * MtzIsetInXtal(const MTZXTAL *xtal, const int iset)
Definition: cmtzlib.c:3664
ccp4_nan
union float_uint_uchar ccp4_nan()
Definition: library_utils.c:208
bathead::theta
float theta[2]
Definition: mtzdata.h:141
MTZCOL
Definition: mtzdata.h:53
MtzColsInSet
MTZCOL ** MtzColsInSet(MTZSET *set)
Definition: cmtzlib.c:3712
MTZ::nxtal
int nxtal
Definition: mtzdata.h:173
MtzFreeBatch
int MtzFreeBatch(MTZBAT *batch)
Definition: cmtzlib.c:3388
MtzFreeHist
int MtzFreeHist(char *hist)
Definition: cmtzlib.c:3441
MtzNcolsInSet
int MtzNcolsInSet(const MTZSET *set)
Definition: cmtzlib.c:3669
ccp4array_free
#define ccp4array_free(v)
Definition: ccp4_array.h:194
MAXSPGNAMELENGTH
#define MAXSPGNAMELENGTH
Definition: mtzdata.h:42
MTZCOL::grpname
char grpname[31]
Definition: mtzdata.h:61
ccp4array_delete_ordered
#define ccp4array_delete_ordered(v, i)
Definition: ccp4_array.h:169
ccp4_lrtitl
int ccp4_lrtitl(const MTZ *mtz, char *title)
Definition: cmtzlib.c:1095
MtzPut
int MtzPut(MTZ *mtz, const char *logname)
Definition: cmtzlib.c:2587
MtzColLookup
MTZCOL * MtzColLookup(const MTZ *mtz, const char *label)
Definition: cmtzlib.c:3871
bathead::num
int num
Definition: mtzdata.h:86
MtzNref
int MtzNref(const MTZ *mtz)
Definition: cmtzlib.c:3770
float_uint_uchar::f
float32 f
Definition: ccp4_types.h:45
ccp4_utils_malloc
void * ccp4_utils_malloc(size_t)
Definition: library_utils.c:401
ccp4_lrbats
int ccp4_lrbats(const MTZ *mtz, int *nbatx, int batchx[])
Definition: cmtzlib.c:1148
MtzAddColumn
MTZCOL * MtzAddColumn(MTZ *mtz, MTZSET *set, const char *label, const char *type)
Definition: cmtzlib.c:3531
CCP4File
struct _CFileStruct CCP4File
Definition: library_file.h:38
MTZCOL::grptype
char grptype[5]
Definition: mtzdata.h:62
SYMGRP::spcgrp
int spcgrp
Definition: mtzdata.h:148
ccp4_utils_itime
void ccp4_utils_itime(int iarray[3])
Definition: library_utils.c:612
ccp4_types.h
Header file containing various commonly used type definitions and some useful macros.
ccp4_lrsymi
int ccp4_lrsymi(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx, char *spgrnx, char *pgnamx)
Definition: cmtzlib.c:1277
MTZXTAL::resmax
float resmax
Definition: mtzdata.h:80
MtzWhdrLine
int MtzWhdrLine(CCP4File *fileout, int nitems, char buffer[])
Definition: cmtzlib.c:3215
MtzFreeCol
int MtzFreeCol(MTZCOL *col)
Definition: cmtzlib.c:3424
bathead::nbsetid
int nbsetid
Definition: mtzdata.h:109
MtzMallocCol
MTZCOL * MtzMallocCol(MTZ *mtz, int nref)
Definition: cmtzlib.c:3401
MTZ::batch
MTZBAT * batch
Definition: mtzdata.h:184
bathead::datum
float datum[3]
Definition: mtzdata.h:116
MTZCOL::label
char label[31]
Definition: mtzdata.h:53
MtzNcol
int MtzNcol(const MTZ *mtz)
Definition: cmtzlib.c:3743
float_uint_uchar::i
uint32 i
Definition: ccp4_types.h:46
MTZSET::setid
int setid
Definition: mtzdata.h:67
MXTALS
#define MXTALS
Definition: mtzdata.h:48
MTZ::fileout
CCP4File * fileout
Definition: mtzdata.h:169
MTZ::nref
int nref
Definition: mtzdata.h:175
MtzListColumn
int MtzListColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[])
Definition: cmtzlib.c:1197
MTZ::ncol_read
int ncol_read
Definition: mtzdata.h:174
ccp4_file_readchar
int ccp4_file_readchar(CCP4File *cfile, uint8 *buffer, size_t nitems)
Definition: library_file.c:1528
MtzNbat
int MtzNbat(const MTZ *mtz)
Definition: cmtzlib.c:3777
MTZSET::col
MTZCOL ** col
Definition: mtzdata.h:71
MTZCOL::max
float max
Definition: mtzdata.h:58
MtzXtalLookup
MTZXTAL * MtzXtalLookup(const MTZ *mtz, const char *label)
Definition: cmtzlib.c:3913
ccp4_lrbat
int ccp4_lrbat(MTZBAT *batch, float *buf, char *charbuf, int iprint)
Definition: cmtzlib.c:1934
MtzSetXtal
MTZXTAL * MtzSetXtal(const MTZ *mtz, const MTZSET *set)
Definition: cmtzlib.c:3609
MtzRrefl
int MtzRrefl(CCP4File *filein, int ncol, float *refldata)
Definition: cmtzlib.c:981
bathead::lcrflg
int lcrflg
Definition: mtzdata.h:96
ccp4_file_read
int ccp4_file_read(CCP4File *cfile, uint8 *buffer, size_t nitems)
Definition: library_file.c:1137
bathead::delcor
float delcor
Definition: mtzdata.h:137
MTZXTAL::set
MTZSET ** set
Definition: mtzdata.h:82
bathead::e1
float e1[3]
Definition: mtzdata.h:127
CCP4PARSERTOKEN
CCP4 Parser token Construct to hold the information about a single token.
Definition: ccp4_parser.h:127
SYMGRP::nsymp
int nsymp
Definition: mtzdata.h:153
MTZ::refs_in_memory
int refs_in_memory
Definition: mtzdata.h:177
ccp4_parse_start
CCP4PARSERARRAY * ccp4_parse_start(const int maxtokens)
Definition: ccp4_parser.c:71
MtzDeleteRefl
int MtzDeleteRefl(MTZ *mtz, int iref)
Definition: cmtzlib.c:2466
MTZSET::ncol
int ncol
Definition: mtzdata.h:70
MtzBatchToArray
int MtzBatchToArray(MTZBAT *batch, int *intbuf, float *fltbuf)
Definition: cmtzlib.c:3140
ccp4_utils_isnan
int ccp4_utils_isnan(const union float_uint_uchar *)
Definition: library_utils.c:235
ccp4_lrassn
MTZCOL ** ccp4_lrassn(const MTZ *mtz, const char labels[][31], const int nlabels, char types[][3])
Definition: cmtzlib.c:1424
MtzFindInd
int MtzFindInd(const MTZ *mtz, int *ind_xtal, int *ind_set, int ind_col[3])
Definition: cmtzlib.c:993
bathead::alambd
float alambd
Definition: mtzdata.h:135
MtzNumActiveSet
int MtzNumActiveSet(const MTZ *mtz)
Definition: cmtzlib.c:3735
ccp4_vars.h
Standard strings for certain quantites - for future use.
ccp4_file_tell
long ccp4_file_tell(CCP4File *cfile)
Definition: library_file.c:2089
MtzToggleColumn
int MtzToggleColumn(MTZCOL *col)
Definition: cmtzlib.c:3586
MTZXTAL
Definition: mtzdata.h:75
ccp4array_new_size
#define ccp4array_new_size(v, s)
Definition: ccp4_array.h:106
ccp4_lwbat
int ccp4_lwbat(MTZ *mtz, MTZBAT *batch, const int batno, const float *buf, const char *charbuf)
Definition: cmtzlib.c:2377
MtzNsetsInXtal
int MtzNsetsInXtal(const MTZXTAL *xtal)
Definition: cmtzlib.c:3644
MtzNumSourceCol
int MtzNumSourceCol(const MTZ *mtz)
Definition: cmtzlib.c:3761
MTZCOL::grpposn
int grpposn
Definition: mtzdata.h:63
MtzNumSourceColsInSet
int MtzNumSourceColsInSet(const MTZSET *set)
Definition: cmtzlib.c:3683
MtzDebugHierarchy
void MtzDebugHierarchy(const MTZ *mtz)
Definition: cmtzlib.c:1163
ccp4_lhprt_adv
int ccp4_lhprt_adv(const MTZ *mtz, int iprint)
Definition: cmtzlib.c:1880
bathead::detlm
float detlm[2][2][2]
Definition: mtzdata.h:142
MTZRECORDLENGTH
#define MTZRECORDLENGTH
Definition: mtzdata.h:41
MtzPathMatch
int MtzPathMatch(const char *path1, const char *path2)
Definition: cmtzlib.c:3852
MTZ::filein
CCP4File * filein
Definition: mtzdata.h:168
mat4_to_symop
char * mat4_to_symop(char *symchs_begin, char *symchs_end, const float rsm[4][4])
Definition: ccp4_parser.c:1625
bathead::divhd
float divhd
Definition: mtzdata.h:138
MTZCOL::min
float min
Definition: mtzdata.h:57
ccp4_lridx
int ccp4_lridx(const MTZ *mtz, const MTZSET *set, char crystal_name[64], char dataset_name[64], char project_name[64], int *isets, float datcell[6], float *datwave)
Definition: cmtzlib.c:1472
bathead::jumpax
int jumpax
Definition: mtzdata.h:93
ccp4array_resize
#define ccp4array_resize(v, s)
Definition: ccp4_array.h:116
MTZ::mnf
MNF mnf
Definition: mtzdata.h:181
ccp4_file_seek
int ccp4_file_seek(CCP4File *cfile, long offset, int whence)
Definition: library_file.c:2009
ccp4_utils_idate
void ccp4_utils_idate(int iarray[3])
Definition: library_utils.c:581
MTZCOL::colsource
char colsource[37]
Definition: mtzdata.h:60
SYMGRP::symtyp
char symtyp
Definition: mtzdata.h:154
MTZCOL::type
char type[3]
Definition: mtzdata.h:54
MSETS
#define MSETS
Definition: mtzdata.h:49
ccp4_parser.h
Functions to read in and "parse" CCP4-style keyworded input.
SYMGRP::pgname
char pgname[11]
Definition: mtzdata.h:155
ccp4_file_writechar
int ccp4_file_writechar(CCP4File *cfile, const uint8 *buffer, size_t nitems)
Definition: library_file.c:1972
MTZXTAL::xname
char xname[65]
Definition: mtzdata.h:76
ccp4_file_length
long ccp4_file_length(CCP4File *cfile)
Definition: library_file.c:2055
ccp4_lrreff
int ccp4_lrreff(const MTZ *mtz, float *resol, float adata[], int logmss[], const MTZCOL *lookup[], const int ncols, const int iref)
Definition: cmtzlib.c:1561
SYMGRP::nsym
int nsym
Definition: mtzdata.h:150
MtzGet
MTZ * MtzGet(const char *logname, int read_refs)
Definition: cmtzlib.c:69
MtzIxtal
MTZXTAL * MtzIxtal(const MTZ *mtz, const int ixtal)
Definition: cmtzlib.c:3639
symop_to_mat4
const char * symop_to_mat4(const char *symchs_begin, const char *symchs_end, float *rot)
Definition: ccp4_parser.c:1398
MtzXtalPath
char * MtzXtalPath(const MTZXTAL *xtal)
Definition: cmtzlib.c:3789
mtzdata.h
Definition of MTZ data structure.
MTZ::unknown_headers
char * unknown_headers
Definition: mtzdata.h:187
ccp4_file_write
int ccp4_file_write(CCP4File *cfile, const uint8 *buffer, size_t nitems)
Definition: library_file.c:1566
ccp4_ismnf
int ccp4_ismnf(const MTZ *mtz, const float datum)
Definition: cmtzlib.c:1651
NBATCHREALS
#define NBATCHREALS
Definition: mtzdata.h:46
MtzAddDataset
MTZSET * MtzAddDataset(MTZ *mtz, MTZXTAL *xtl, const char *dname, const float wavelength)
Definition: cmtzlib.c:3488
MtzNumActiveColsInSet
int MtzNumActiveColsInSet(const MTZSET *set)
Definition: cmtzlib.c:3674
ccp4_file_rarch
int ccp4_file_rarch(CCP4File *cfile)
Definition: library_file.c:1053
MtzSpacegroupNumber
int MtzSpacegroupNumber(const MTZ *mtz)
Definition: cmtzlib.c:1299
CCP4PARSERTOKEN::value
double value
Definition: ccp4_parser.h:130
SYMGRP::sym
float sym[192][4][4]
Definition: mtzdata.h:151
MCOLUMNS
#define MCOLUMNS
Definition: mtzdata.h:50
ccp4_lrsymm
int ccp4_lrsymm(const MTZ *mtz, int *nsymx, float rsymx[192][4][4])
Definition: cmtzlib.c:1306
MTZ
Definition: mtzdata.h:168
bathead::jsaxs
int jsaxs
Definition: mtzdata.h:100
MtzInd2reso
float MtzInd2reso(const int in[3], const double coefhkl[6])
Definition: cmtzlib.c:1024
MtzCallocHist
char * MtzCallocHist(int nhist)
Definition: cmtzlib.c:3431
bathead::phiend
float phiend
Definition: mtzdata.h:118
MtzHklcoeffs
int MtzHklcoeffs(const float cell[6], double coefhkl[6])
Definition: cmtzlib.c:1041
bathead::cell
float cell[6]
Definition: mtzdata.h:110
MtzWrefl
int MtzWrefl(CCP4File *fileout, int ncol, float *refldata)
Definition: cmtzlib.c:3242
bathead::misflg
int misflg
Definition: mtzdata.h:92
CCP4PARSERTOKEN::fullstring
char * fullstring
Definition: ccp4_parser.h:128
MtzIcolInSet
MTZCOL * MtzIcolInSet(const MTZSET *set, const int icol)
Definition: cmtzlib.c:3717
bathead::sdbfac
float sdbfac
Definition: mtzdata.h:125
MTZ::mtzsymm
SYMGRP mtzsymm
Definition: mtzdata.h:182
MTZ::n_orig_bat
int n_orig_bat
Definition: mtzdata.h:178
bathead::ndet
int ndet
Definition: mtzdata.h:107
bathead::ncryst
int ncryst
Definition: mtzdata.h:95
ccp4_lrhist
int ccp4_lrhist(const MTZ *mtz, char history[][MTZRECORDLENGTH], int nlines)
Definition: cmtzlib.c:1107
bathead::ldtype
int ldtype
Definition: mtzdata.h:98
ccp4_lrcell
int ccp4_lrcell(const MTZXTAL *xtl, float cell[])
Definition: cmtzlib.c:1251
SIZE1
#define SIZE1
Definition: mtzdata.h:40
bathead::phixyz
float phixyz[2][3]
Definition: mtzdata.h:113
SYMGRP::spg_confidence
char spg_confidence
Definition: mtzdata.h:156
CCP4PARSERARRAY
CCP4 Parser array Construct to hold the information about a parsed line.
Definition: ccp4_parser.h:149
ccp4_file_close
int ccp4_file_close(CCP4File *cfile)
Definition: library_file.c:1025
bathead::divvd
float divvd
Definition: mtzdata.h:139
ccp4_file_warch
int ccp4_file_warch(CCP4File *cfile)
Definition: library_file.c:1102
float_uint_uchar
Common data structure for floats, ints, and chars.
Definition: ccp4_types.h:44
bathead::source
float source[3]
Definition: mtzdata.h:133
MtzNumActiveSetsInXtal
int MtzNumActiveSetsInXtal(const MTZ *mtz, const MTZXTAL *xtal)
Definition: cmtzlib.c:3649
bathead::umat
float umat[9]
Definition: mtzdata.h:111
bathead::title
char title[71]
Definition: mtzdata.h:87
bathead::gonlab
char gonlab[3][9]
Definition: mtzdata.h:88
bathead::time2
float time2
Definition: mtzdata.h:121
bathead
Definition: mtzdata.h:86
MtzAddHistory
int MtzAddHistory(MTZ *mtz, const char history[][MTZRECORDLENGTH], const int nlines)
Definition: cmtzlib.c:2129
MtzNbatchesInSet
int MtzNbatchesInSet(const MTZ *mtz, const MTZSET *set)
Definition: cmtzlib.c:3692
MTZ::title
char title[71]
Definition: mtzdata.h:170
MTZ::resmax_out
float resmax_out
Definition: mtzdata.h:179
MtzAssignHKLtoBase
int MtzAssignHKLtoBase(MTZ *mtz)
Definition: cmtzlib.c:2194
bathead::lbcell
int lbcell[6]
Definition: mtzdata.h:91
MtzMalloc
MTZ * MtzMalloc(int nxtal, int nset[])
Definition: cmtzlib.c:3252
ccp4_file_setmode
int ccp4_file_setmode(CCP4File *cfile, const int mode)
Definition: library_file.c:649
bathead::phistt
float phistt
Definition: mtzdata.h:117
ccp4_liberr_verbosity
int ccp4_liberr_verbosity(int iverb)
Definition: library_err.c:258
MTZXTAL::xtalid
int xtalid
Definition: mtzdata.h:75
ccp4_errno.h
Header file for error handling routines Error codes based on system errors.
ccp4uc_cells_differ
int ccp4uc_cells_differ(const double cell1[6], const double cell2[6], const double tolerance)
Definition: ccp4_unitcell.c:307
MtzMallocBatch
MTZBAT * MtzMallocBatch(void)
Definition: cmtzlib.c:3371
MTZ::histlines
int histlines
Definition: mtzdata.h:172
float_uint_uchar::c
uint8 c[4]
Definition: ccp4_types.h:47
MTZ::order
MTZCOL * order[5]
Definition: mtzdata.h:185
MtzAddXtal
MTZXTAL * MtzAddXtal(MTZ *mtz, const char *xname, const char *pname, const float cell[6])
Definition: cmtzlib.c:3450
MTZ_MAJOR_VERSN
#define MTZ_MAJOR_VERSN
Definition: mtzdata.h:34
bathead::bscale
float bscale
Definition: mtzdata.h:122
bathead::sdbscale
float sdbscale
Definition: mtzdata.h:124
cmtzlib.h
C-level library for input, output and manipulation of MTZ files.
MtzSetPath
char * MtzSetPath(const MTZ *mtz, const MTZSET *set)
Definition: cmtzlib.c:3803
bathead::crydat
float crydat[12]
Definition: mtzdata.h:115
MTZ::resmin_out
float resmin_out
Definition: mtzdata.h:180
bathead::e2
float e2[3]
Definition: mtzdata.h:129
NBATCHWORDS
#define NBATCHWORDS
Definition: mtzdata.h:44
MtzColType
char * MtzColType(MTZCOL *col)
Definition: cmtzlib.c:3722
bathead::so
float so[3]
Definition: mtzdata.h:134
MtzParseLabin
int MtzParseLabin(char *labin_line, const char prog_labels[][31], const int nlprgi, char user_labels[][2][31])
Definition: cmtzlib.c:1322
MTZXTAL::nset
int nset
Definition: mtzdata.h:81
MtzSetSortOrder
int MtzSetSortOrder(MTZ *mtz, MTZCOL *colsort[5])
Definition: cmtzlib.c:2119
MtzPrintBatchHeader
int MtzPrintBatchHeader(const MTZBAT *batch)
Definition: cmtzlib.c:1961
ccp4_lhprt
int ccp4_lhprt(const MTZ *mtz, int iprint)
Definition: cmtzlib.c:1662
CCP4PARSERARRAY::keyword
char keyword[5]
Definition: ccp4_parser.h:151
bathead::iortyp
int iortyp
Definition: mtzdata.h:89
MtzResLimits
int MtzResLimits(const MTZ *mtz, float *minres, float *maxres)
Definition: cmtzlib.c:1262
MTZCOL::source
unsigned int source
Definition: mtzdata.h:56
bathead::next
struct bathead * next
Definition: mtzdata.h:144
ccp4_lwrefl
int ccp4_lwrefl(MTZ *mtz, const float adata[], MTZCOL *lookup[], const int ncol, const int iref)
Definition: cmtzlib.c:2483
MtzRJustPath
int MtzRJustPath(char *path, const char *partial, const int njust)
Definition: cmtzlib.c:3837
ccp4_parse_end
int ccp4_parse_end(CCP4PARSERARRAY *parsePtr)
Definition: ccp4_parser.c:143
MTZCOL::ref
float * ref
Definition: mtzdata.h:59
bathead::nbscal
int nbscal
Definition: mtzdata.h:101
SYMGRP::spcgrpname
char spcgrpname[MAXSPGNAMELENGTH+1]
Definition: mtzdata.h:149
ccp4_utils_calloc
void * ccp4_utils_calloc(size_t, size_t)
Definition: library_utils.c:430
MTZ::n_unknown_headers
int n_unknown_headers
Definition: mtzdata.h:188
MtzXtals
MTZXTAL ** MtzXtals(MTZ *mtz)
Definition: cmtzlib.c:3634
MTZSET::wavelength
float wavelength
Definition: mtzdata.h:69
MTZXTAL::resmin
float resmin
Definition: mtzdata.h:79
MtzSetLookup
MTZSET * MtzSetLookup(const MTZ *mtz, const char *label)
Definition: cmtzlib.c:3893
MtzSetsInXtal
MTZSET ** MtzSetsInXtal(MTZXTAL *xtal)
Definition: cmtzlib.c:3659
MtzAssignColumn
int MtzAssignColumn(MTZ *mtz, MTZCOL *col, const char crystal_name[], const char dataset_name[])
Definition: cmtzlib.c:2221
NBATCHINTEGERS
#define NBATCHINTEGERS
Definition: mtzdata.h:45
ccp4_lrsort
int ccp4_lrsort(const MTZ *mtz, int isort[5])
Definition: cmtzlib.c:1123
sort_batches
MTZBAT * sort_batches(MTZBAT *batch, int numbat)
Definition: cmtzlib.c:2988
MtzOpenForWrite
CCP4File * MtzOpenForWrite(const char *logname)
Definition: cmtzlib.c:3097
MtzFree
int MtzFree(MTZ *mtz)
Definition: cmtzlib.c:3321
bathead::lbmflg
int lbmflg
Definition: mtzdata.h:104
bathead::scanax
float scanax[3]
Definition: mtzdata.h:119
ccp4_utils_realloc
void * ccp4_utils_realloc(void *, size_t)
Definition: library_utils.c:416
MtzArrayToBatch
int MtzArrayToBatch(const int *intbuf, const float *fltbuf, MTZBAT *batch)
Definition: cmtzlib.c:913