00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00099 #ifndef __CMTZLib__
00100 #define __CMTZLib__
00101
00102
00103
00104
00105 #include "ccp4_utils.h"
00106
00107 #ifdef __cplusplus
00108 namespace CMtz {
00109 extern "C" {
00110 typedef CCP4::CCP4File CCP4File;
00111 #endif
00112
00113
00114 #include "mtzdata.h"
00115
00116
00117
00124 MTZ *MtzGet(const char *logname, int read_refs);
00125
00137 MTZ *MtzGetUserCellTolerance(const char *logname, int read_refs, const double cell_tolerance);
00138
00145 int MtzRrefl(CCP4File *filein, int ncol, float *refldata);
00146
00153 int MtzPut(MTZ *mtz, const char *logname);
00154
00162 CCP4File *MtzOpenForWrite(const char *logname);
00163
00171 int MtzWhdrLine(CCP4File *fileout, int nitems, char buffer[]);
00172
00180 int MtzWrefl(CCP4File *fileout, int ncol, float *refldata);
00181
00188 int MtzDeleteRefl(MTZ *mtz, int iref);
00189
00190
00191
00203 MTZ *MtzMalloc(int nxtal, int nset[]);
00204
00209 int MtzFree(MTZ *mtz);
00210
00217 MTZCOL *MtzMallocCol(MTZ *mtz, int nref);
00218
00223 int MtzFreeCol(MTZCOL *col);
00224
00228 MTZBAT *MtzMallocBatch(void);
00229
00234 int MtzFreeBatch(MTZBAT *batch);
00235
00240 char *MtzCallocHist(int nhist);
00241
00246 int MtzFreeHist(char *hist);
00247
00253 void MtzMemTidy(void);
00254
00255
00256
00261 int MtzNbat(const MTZ *mtz);
00262
00267 int MtzNref(const MTZ *mtz);
00268
00273 int MtzSpacegroupNumber(const MTZ *mtz);
00274
00282 int MtzResLimits(const MTZ *mtz, float *minres, float *maxres);
00283
00284
00285
00290 int MtzNxtal(const MTZ *mtz);
00291
00296 int MtzNumActiveXtal(const MTZ *mtz);
00297
00302 MTZXTAL **MtzXtals(MTZ *mtz);
00303
00309 MTZXTAL *MtzIxtal(const MTZ *mtz, const int ixtal);
00310
00317 char *MtzXtalPath(const MTZXTAL *xtal);
00318
00324 MTZXTAL *MtzXtalLookup(const MTZ *mtz, const char *label);
00325
00333 MTZXTAL *MtzAddXtal(MTZ *mtz, const char *xname, const char *pname,
00334 const float cell[6]);
00335
00340 int MtzNsetsInXtal(const MTZXTAL *xtal);
00341
00346 int MtzNumActiveSetsInXtal(const MTZ *mtz, const MTZXTAL *xtal);
00347
00353 MTZSET **MtzSetsInXtal(MTZXTAL *xtal);
00354
00361 MTZSET *MtzIsetInXtal(const MTZXTAL *xtal, const int iset);
00362
00363
00364
00369 int MtzNset(const MTZ *mtz);
00370
00375 int MtzNumActiveSet(const MTZ *mtz);
00376
00384 MTZXTAL *MtzSetXtal(const MTZ *mtz, const MTZSET *set);
00385
00394 char *MtzSetPath(const MTZ *mtz, const MTZSET *set);
00395
00402 MTZSET *MtzSetLookup(const MTZ *mtz, const char *label);
00403
00411 MTZSET *MtzAddDataset(MTZ *mtz, MTZXTAL *xtl, const char *dname,
00412 const float wavelength);
00413
00420 int MtzNcolsInSet(const MTZSET *set);
00421
00426 int MtzNumActiveColsInSet(const MTZSET *set);
00427
00433 int MtzNumSourceColsInSet(const MTZSET *set);
00434
00440 int MtzNbatchesInSet(const MTZ *mtz, const MTZSET *set);
00441
00447 MTZCOL **MtzColsInSet(MTZSET *set);
00448
00456 MTZCOL *MtzIcolInSet(const MTZSET *set, const int icol);
00457
00458
00459
00467 MTZCOL *MtzAddColumn(MTZ *mtz, MTZSET *set, const char *label,
00468 const char *type);
00469
00474 int MtzAssignHKLtoBase(MTZ *mtz);
00475
00488 int MtzAssignColumn(MTZ *mtz, MTZCOL *col, const char crystal_name[],
00489 const char dataset_name[]);
00490
00497 int MtzToggleColumn(MTZCOL *col);
00498
00505 MTZSET *MtzColSet(const MTZ *mtz, const MTZCOL *col);
00506
00511 int MtzNcol(const MTZ *mtz);
00512
00517 int MtzNumActiveCol(const MTZ *mtz);
00518
00524 int MtzNumSourceCol(const MTZ *mtz);
00525
00533 char *MtzColPath(const MTZ *mtz, const MTZCOL *col);
00534
00541 int MtzRJustPath(char *path, const char *partial, const int njust);
00542
00548 int MtzPathMatch(const char *path1, const char *path2);
00549
00555 MTZCOL *MtzColLookup(const MTZ *mtz, const char *label);
00556
00561 char *MtzColType(MTZCOL *col);
00562
00568 void MtzDebugHierarchy(const MTZ *mtz);
00569
00577 int MtzListColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
00578
00586 int MtzListInputColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
00587
00588
00589
00598 int MtzFindInd(const MTZ *mtz, int *ind_xtal, int *ind_set, int ind_col[3]);
00599
00606 float MtzInd2reso(const int in[3], const double coefhkl[6]);
00607
00613 int MtzHklcoeffs(const float cell[6], double coefhkl[6]);
00614
00621 int MtzArrayToBatch(const int *intbuf, const float *fltbuf, MTZBAT *batch);
00622
00629 int MtzBatchToArray(MTZBAT *batch, int *intbuf, float *fltbuf);
00630
00639 MTZBAT *sort_batches(MTZBAT *batch, int numbat);
00640
00641
00642
00649 int ccp4_lrtitl(const MTZ *mtz, char *title);
00650
00657 int ccp4_lrhist(const MTZ *mtz, char history[][MTZRECORDLENGTH], int nlines);
00658
00664 int ccp4_lrsort(const MTZ *mtz, int isort[5]);
00665
00672 int ccp4_lrbats(const MTZ *mtz, int *nbatx, int batchx[]);
00673
00679 int ccp4_lrcell(const MTZXTAL *xtl, float cell[]);
00680
00690 int ccp4_lrsymi(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx,
00691 char *spgrnx, char *pgnamx);
00692
00702 int ccp4_lrsymm(const MTZ *mtz, int *nsymx, float rsymx[192][4][4]);
00703
00713 int MtzParseLabin(char *labin_line, const char prog_labels[][31],
00714 const int nlprgi, char user_labels[][2][31]);
00715
00729 MTZCOL **ccp4_lrassn(const MTZ *mtz, const char labels[][31], const int nlabels,
00730 char types[][3]);
00731
00745 int ccp4_lridx(const MTZ *mtz, const MTZSET *set, char crystal_name[64],
00746 char dataset_name[64], char project_name[64], int *isets,
00747 float datcell[6], float *datwave);
00748
00764 int ccp4_lrrefl(const MTZ *mtz, float *resol, float adata[], int logmss[], int iref);
00765
00782 int ccp4_lrreff(const MTZ *mtz, float *resol, float adata[], int logmss[],
00783 const MTZCOL *lookup[], const int ncols, const int iref);
00784
00792 int ccp4_ismnf(const MTZ *mtz, const float datum);
00793
00799 int ccp4_lhprt(const MTZ *mtz, int iprint);
00800
00807 int ccp4_lhprt_adv(const MTZ *mtz, int iprint);
00808
00816 int ccp4_lrbat(MTZBAT *batch, float *buf, char *charbuf, int iprint);
00817
00822 int MtzPrintBatchHeader(const MTZBAT *batch);
00823
00831 int ccp4_lwtitl(MTZ *mtz, const char *ftitle, int flag);
00832
00842 int MtzSetSortOrder(MTZ *mtz, MTZCOL *colsort[5]);
00843
00850 int MtzAddHistory(MTZ *mtz, const char history[][MTZRECORDLENGTH], const int nlines);
00851
00867 int ccp4_lwsymm(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4],
00868 char ltypex[], int nspgrx, char spgrnx[], char pgnamx[]);
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882 MTZCOL **ccp4_lwassn(MTZ *mtz, const char labels[][31], const int nlabels,
00883 const char types[][3], const int iappnd);
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901 int ccp4_lwidx(MTZ *mtz, const char crystal_name[], const char dataset_name[],
00902 const char project_name[], const float datcell[6], const float *datwave);
00903
00904
00922 int ccp4_lwrefl(MTZ *mtz, const float adata[], MTZCOL *lookup[],
00923 const int ncol, const int iref);
00924
00938 int ccp4_lwbat(MTZ *mtz, MTZBAT *batch, const int batno, const float *buf, const char *charbuf);
00939
00940 int ccp4_lwbsetid(MTZ *mtz, MTZBAT *batch, const char xname[], const char dname[]);
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998 #ifdef __cplusplus
00999 } }
01000 #endif
01001 #endif