00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00095 #ifndef __CMTZLib__
00096 #define __CMTZLib__
00097
00098 static char rcsidhm[100] = "$Id$";
00099
00100
00101 #include "ccp4_utils.h"
00102
00103 #ifdef __cplusplus
00104 namespace CMtz {
00105 extern "C" {
00106 typedef CCP4::CCP4File CCP4File;
00107 #endif
00108
00109
00110 #include "mtzdata.h"
00111
00112
00113
00120 MTZ *MtzGet(const char *logname, int read_refs);
00121
00133 MTZ *MtzGetUserCellTolerance(const char *logname, int read_refs, const double cell_tolerance);
00134
00141 int MtzRrefl(CCP4File *filein, int ncol, float *refldata);
00142
00149 int MtzPut(MTZ *mtz, const char *logname);
00150
00158 CCP4File *MtzOpenForWrite(const char *logname);
00159
00167 int MtzWhdrLine(CCP4File *fileout, int nitems, char buffer[]);
00168
00176 int MtzWrefl(CCP4File *fileout, int ncol, float *refldata);
00177
00184 int MtzDeleteRefl(MTZ *mtz, int iref);
00185
00186
00187
00199 MTZ *MtzMalloc(int nxtal, int nset[]);
00200
00205 int MtzFree(MTZ *mtz);
00206
00213 MTZCOL *MtzMallocCol(MTZ *mtz, int nref);
00214
00219 int MtzFreeCol(MTZCOL *col);
00220
00224 MTZBAT *MtzMallocBatch(void);
00225
00230 int MtzFreeBatch(MTZBAT *batch);
00231
00236 char *MtzCallocHist(int nhist);
00237
00242 int MtzFreeHist(char *hist);
00243
00249 void MtzMemTidy(void);
00250
00251
00252
00257 int MtzNbat(const MTZ *mtz);
00258
00263 int MtzNref(const MTZ *mtz);
00264
00269 int MtzSpacegroupNumber(const MTZ *mtz);
00270
00278 int MtzResLimits(const MTZ *mtz, float *minres, float *maxres);
00279
00280
00281
00286 int MtzNxtal(const MTZ *mtz);
00287
00292 int MtzNumActiveXtal(const MTZ *mtz);
00293
00298 MTZXTAL **MtzXtals(MTZ *mtz);
00299
00305 MTZXTAL *MtzIxtal(const MTZ *mtz, const int ixtal);
00306
00313 char *MtzXtalPath(const MTZXTAL *xtal);
00314
00320 MTZXTAL *MtzXtalLookup(const MTZ *mtz, const char *label);
00321
00329 MTZXTAL *MtzAddXtal(MTZ *mtz, const char *xname, const char *pname,
00330 const float cell[6]);
00331
00336 int MtzNsetsInXtal(const MTZXTAL *xtal);
00337
00342 int MtzNumActiveSetsInXtal(const MTZ *mtz, const MTZXTAL *xtal);
00343
00349 MTZSET **MtzSetsInXtal(MTZXTAL *xtal);
00350
00357 MTZSET *MtzIsetInXtal(const MTZXTAL *xtal, const int iset);
00358
00359
00360
00365 int MtzNset(const MTZ *mtz);
00366
00371 int MtzNumActiveSet(const MTZ *mtz);
00372
00380 MTZXTAL *MtzSetXtal(const MTZ *mtz, const MTZSET *set);
00381
00390 char *MtzSetPath(const MTZ *mtz, const MTZSET *set);
00391
00398 MTZSET *MtzSetLookup(const MTZ *mtz, const char *label);
00399
00407 MTZSET *MtzAddDataset(MTZ *mtz, MTZXTAL *xtl, const char *dname,
00408 const float wavelength);
00409
00416 int MtzNcolsInSet(const MTZSET *set);
00417
00422 int MtzNumActiveColsInSet(const MTZSET *set);
00423
00429 int MtzNumSourceColsInSet(const MTZSET *set);
00430
00436 int MtzNbatchesInSet(const MTZ *mtz, const MTZSET *set);
00437
00443 MTZCOL **MtzColsInSet(MTZSET *set);
00444
00452 MTZCOL *MtzIcolInSet(const MTZSET *set, const int icol);
00453
00454
00455
00463 MTZCOL *MtzAddColumn(MTZ *mtz, MTZSET *set, const char *label,
00464 const char *type);
00465
00470 int MtzAssignHKLtoBase(MTZ *mtz);
00471
00484 int MtzAssignColumn(MTZ *mtz, MTZCOL *col, const char crystal_name[],
00485 const char dataset_name[]);
00486
00493 int MtzToggleColumn(MTZCOL *col);
00494
00501 MTZSET *MtzColSet(const MTZ *mtz, const MTZCOL *col);
00502
00507 int MtzNcol(const MTZ *mtz);
00508
00513 int MtzNumActiveCol(const MTZ *mtz);
00514
00520 int MtzNumSourceCol(const MTZ *mtz);
00521
00529 char *MtzColPath(const MTZ *mtz, const MTZCOL *col);
00530
00537 int MtzRJustPath(char *path, const char *partial, const int njust);
00538
00544 int MtzPathMatch(const char *path1, const char *path2);
00545
00551 MTZCOL *MtzColLookup(const MTZ *mtz, const char *label);
00552
00557 char *MtzColType(MTZCOL *col);
00558
00564 void MtzDebugHierarchy(const MTZ *mtz);
00565
00573 int MtzListColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
00574
00582 int MtzListInputColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
00583
00584
00585
00594 int MtzFindInd(const MTZ *mtz, int *ind_xtal, int *ind_set, int ind_col[3]);
00595
00602 float MtzInd2reso(const int in[3], const double coefhkl[6]);
00603
00609 int MtzHklcoeffs(const float cell[6], double coefhkl[6]);
00610
00617 int MtzArrayToBatch(const int *intbuf, const float *fltbuf, MTZBAT *batch);
00618
00625 int MtzBatchToArray(MTZBAT *batch, int *intbuf, float *fltbuf);
00626
00635 MTZBAT *sort_batches(MTZBAT *batch, int numbat);
00636
00637
00638
00645 int ccp4_lrtitl(const MTZ *mtz, char *title);
00646
00653 int ccp4_lrhist(const MTZ *mtz, char history[][MTZRECORDLENGTH], int nlines);
00654
00660 int ccp4_lrsort(const MTZ *mtz, int isort[5]);
00661
00668 int ccp4_lrbats(const MTZ *mtz, int *nbatx, int batchx[]);
00669
00675 int ccp4_lrcell(const MTZXTAL *xtl, float cell[]);
00676
00686 int ccp4_lrsymi(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx,
00687 char *spgrnx, char *pgnamx);
00688
00698 int ccp4_lrsymm(const MTZ *mtz, int *nsymx, float rsymx[192][4][4]);
00699
00709 int MtzParseLabin(char *labin_line, const char prog_labels[][31],
00710 const int nlprgi, char user_labels[][2][31]);
00711
00725 MTZCOL **ccp4_lrassn(const MTZ *mtz, const char labels[][31], const int nlabels,
00726 char types[][3]);
00727
00741 int ccp4_lridx(const MTZ *mtz, const MTZSET *set, char crystal_name[64],
00742 char dataset_name[64], char project_name[64], int *isets,
00743 float datcell[6], float *datwave);
00744
00760 int ccp4_lrrefl(const MTZ *mtz, float *resol, float adata[], int logmss[], int iref);
00761
00778 int ccp4_lrreff(const MTZ *mtz, float *resol, float adata[], int logmss[],
00779 const MTZCOL *lookup[], const int ncols, const int iref);
00780
00788 int ccp4_ismnf(const MTZ *mtz, const float datum);
00789
00795 int ccp4_lhprt(const MTZ *mtz, int iprint);
00796
00803 int ccp4_lhprt_adv(const MTZ *mtz, int iprint);
00804
00812 int ccp4_lrbat(MTZBAT *batch, float *buf, char *charbuf, int iprint);
00813
00818 int MtzPrintBatchHeader(const MTZBAT *batch);
00819
00827 int ccp4_lwtitl(MTZ *mtz, const char *ftitle, int flag);
00828
00838 int MtzSetSortOrder(MTZ *mtz, MTZCOL *colsort[5]);
00839
00846 int MtzAddHistory(MTZ *mtz, const char history[][MTZRECORDLENGTH], const int nlines);
00847
00862 int ccp4_lwsymm(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4],
00863 char ltypex[], int nspgrx, char spgrnx[], char pgnamx[]);
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877 MTZCOL **ccp4_lwassn(MTZ *mtz, const char labels[][31], const int nlabels,
00878 const char types[][3], const int iappnd);
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896 int ccp4_lwidx(MTZ *mtz, const char crystal_name[], const char dataset_name[],
00897 const char project_name[], const float datcell[6], const float *datwave);
00898
00899
00917 int ccp4_lwrefl(MTZ *mtz, const float adata[], MTZCOL *lookup[],
00918 const int ncol, const int iref);
00919
00933 int ccp4_lwbat(MTZ *mtz, MTZBAT *batch, const int batno, const float *buf, const char *charbuf);
00934
00935 int ccp4_lwbsetid(MTZ *mtz, MTZBAT *batch, const char xname[], const char dname[]);
00936
00937
00938
00939
00940
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 #ifdef __cplusplus
00994 } }
00995 #endif
00996 #endif