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 #include "ccp4_utils.h"
00105
00106 #ifdef __cplusplus
00107 namespace CMtz {
00108 extern "C" {
00109 typedef CCP4::CCP4File CCP4File;
00110 #endif
00111
00112
00113 #include "mtzdata.h"
00114
00115
00116
00123 MTZ *MtzGet(const char *logname, int read_refs);
00124
00136 MTZ *MtzGetUserCellTolerance(const char *logname, int read_refs, const double cell_tolerance);
00137
00144 int MtzRrefl(CCP4File *filein, int ncol, float *refldata);
00145
00152 int MtzPut(MTZ *mtz, const char *logname);
00153
00161 CCP4File *MtzOpenForWrite(const char *logname);
00162
00170 int MtzWhdrLine(CCP4File *fileout, int nitems, char buffer[]);
00171
00179 int MtzWrefl(CCP4File *fileout, int ncol, float *refldata);
00180
00187 int MtzDeleteRefl(MTZ *mtz, int iref);
00188
00189
00190
00202 MTZ *MtzMalloc(int nxtal, int nset[]);
00203
00208 int MtzFree(MTZ *mtz);
00209
00216 MTZCOL *MtzMallocCol(MTZ *mtz, int nref);
00217
00222 int MtzFreeCol(MTZCOL *col);
00223
00227 MTZBAT *MtzMallocBatch(void);
00228
00233 int MtzFreeBatch(MTZBAT *batch);
00234
00239 char *MtzCallocHist(int nhist);
00240
00245 int MtzFreeHist(char *hist);
00246
00252 void MtzMemTidy(void);
00253
00254
00255
00260 int MtzNbat(const MTZ *mtz);
00261
00266 int MtzNref(const MTZ *mtz);
00267
00272 int MtzSpacegroupNumber(const MTZ *mtz);
00273
00281 int MtzResLimits(const MTZ *mtz, float *minres, float *maxres);
00282
00283
00284
00289 int MtzNxtal(const MTZ *mtz);
00290
00295 int MtzNumActiveXtal(const MTZ *mtz);
00296
00301 MTZXTAL **MtzXtals(MTZ *mtz);
00302
00308 MTZXTAL *MtzIxtal(const MTZ *mtz, const int ixtal);
00309
00316 char *MtzXtalPath(const MTZXTAL *xtal);
00317
00323 MTZXTAL *MtzXtalLookup(const MTZ *mtz, const char *label);
00324
00332 MTZXTAL *MtzAddXtal(MTZ *mtz, const char *xname, const char *pname,
00333 const float cell[6]);
00334
00339 int MtzNsetsInXtal(const MTZXTAL *xtal);
00340
00345 int MtzNumActiveSetsInXtal(const MTZ *mtz, const MTZXTAL *xtal);
00346
00352 MTZSET **MtzSetsInXtal(MTZXTAL *xtal);
00353
00360 MTZSET *MtzIsetInXtal(const MTZXTAL *xtal, const int iset);
00361
00362
00363
00368 int MtzNset(const MTZ *mtz);
00369
00374 int MtzNumActiveSet(const MTZ *mtz);
00375
00383 MTZXTAL *MtzSetXtal(const MTZ *mtz, const MTZSET *set);
00384
00393 char *MtzSetPath(const MTZ *mtz, const MTZSET *set);
00394
00401 MTZSET *MtzSetLookup(const MTZ *mtz, const char *label);
00402
00410 MTZSET *MtzAddDataset(MTZ *mtz, MTZXTAL *xtl, const char *dname,
00411 const float wavelength);
00412
00419 int MtzNcolsInSet(const MTZSET *set);
00420
00425 int MtzNumActiveColsInSet(const MTZSET *set);
00426
00432 int MtzNumSourceColsInSet(const MTZSET *set);
00433
00439 int MtzNbatchesInSet(const MTZ *mtz, const MTZSET *set);
00440
00446 MTZCOL **MtzColsInSet(MTZSET *set);
00447
00455 MTZCOL *MtzIcolInSet(const MTZSET *set, const int icol);
00456
00457
00458
00466 MTZCOL *MtzAddColumn(MTZ *mtz, MTZSET *set, const char *label,
00467 const char *type);
00468
00473 int MtzAssignHKLtoBase(MTZ *mtz);
00474
00487 int MtzAssignColumn(MTZ *mtz, MTZCOL *col, const char crystal_name[],
00488 const char dataset_name[]);
00489
00496 int MtzToggleColumn(MTZCOL *col);
00497
00504 MTZSET *MtzColSet(const MTZ *mtz, const MTZCOL *col);
00505
00510 int MtzNcol(const MTZ *mtz);
00511
00516 int MtzNumActiveCol(const MTZ *mtz);
00517
00523 int MtzNumSourceCol(const MTZ *mtz);
00524
00532 char *MtzColPath(const MTZ *mtz, const MTZCOL *col);
00533
00540 int MtzRJustPath(char *path, const char *partial, const int njust);
00541
00547 int MtzPathMatch(const char *path1, const char *path2);
00548
00554 MTZCOL *MtzColLookup(const MTZ *mtz, const char *label);
00555
00560 char *MtzColType(MTZCOL *col);
00561
00567 void MtzDebugHierarchy(const MTZ *mtz);
00568
00576 int MtzListColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
00577
00585 int MtzListInputColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
00586
00587
00588
00597 int MtzFindInd(const MTZ *mtz, int *ind_xtal, int *ind_set, int ind_col[3]);
00598
00605 float MtzInd2reso(const int in[3], const double coefhkl[6]);
00606
00612 int MtzHklcoeffs(const float cell[6], double coefhkl[6]);
00613
00620 int MtzArrayToBatch(const int *intbuf, const float *fltbuf, MTZBAT *batch);
00621
00628 int MtzBatchToArray(MTZBAT *batch, int *intbuf, float *fltbuf);
00629
00638 MTZBAT *sort_batches(MTZBAT *batch, int numbat);
00639
00640
00641
00648 int ccp4_lrtitl(const MTZ *mtz, char *title);
00649
00656 int ccp4_lrhist(const MTZ *mtz, char history[][MTZRECORDLENGTH], int nlines);
00657
00663 int ccp4_lrsort(const MTZ *mtz, int isort[5]);
00664
00671 int ccp4_lrbats(const MTZ *mtz, int *nbatx, int batchx[]);
00672
00678 int ccp4_lrcell(const MTZXTAL *xtl, float cell[]);
00679
00689 int ccp4_lrsymi(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx,
00690 char *spgrnx, char *pgnamx);
00691
00701 int ccp4_lrsymm(const MTZ *mtz, int *nsymx, float rsymx[192][4][4]);
00702
00712 int MtzParseLabin(char *labin_line, const char prog_labels[][31],
00713 const int nlprgi, char user_labels[][2][31]);
00714
00728 MTZCOL **ccp4_lrassn(const MTZ *mtz, const char labels[][31], const int nlabels,
00729 char types[][3]);
00730
00744 int ccp4_lridx(const MTZ *mtz, const MTZSET *set, char crystal_name[64],
00745 char dataset_name[64], char project_name[64], int *isets,
00746 float datcell[6], float *datwave);
00747
00763 int ccp4_lrrefl(const MTZ *mtz, float *resol, float adata[], int logmss[], int iref);
00764
00781 int ccp4_lrreff(const MTZ *mtz, float *resol, float adata[], int logmss[],
00782 const MTZCOL *lookup[], const int ncols, const int iref);
00783
00791 int ccp4_ismnf(const MTZ *mtz, const float datum);
00792
00798 int ccp4_lhprt(const MTZ *mtz, int iprint);
00799
00806 int ccp4_lhprt_adv(const MTZ *mtz, int iprint);
00807
00815 int ccp4_lrbat(MTZBAT *batch, float *buf, char *charbuf, int iprint);
00816
00821 int MtzPrintBatchHeader(const MTZBAT *batch);
00822
00830 int ccp4_lwtitl(MTZ *mtz, const char *ftitle, int flag);
00831
00841 int MtzSetSortOrder(MTZ *mtz, MTZCOL *colsort[5]);
00842
00849 int MtzAddHistory(MTZ *mtz, const char history[][MTZRECORDLENGTH], const int nlines);
00850
00866 int ccp4_lwsymm(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4],
00867 char ltypex[], int nspgrx, char spgrnx[], char pgnamx[]);
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881 MTZCOL **ccp4_lwassn(MTZ *mtz, const char labels[][31], const int nlabels,
00882 const char types[][3], const int iappnd);
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900 int ccp4_lwidx(MTZ *mtz, const char crystal_name[], const char dataset_name[],
00901 const char project_name[], const float datcell[6], const float *datwave);
00902
00903
00921 int ccp4_lwrefl(MTZ *mtz, const float adata[], MTZCOL *lookup[],
00922 const int ncol, const int iref);
00923
00937 int ccp4_lwbat(MTZ *mtz, MTZBAT *batch, const int batno, const float *buf, const char *charbuf);
00938
00939 int ccp4_lwbsetid(MTZ *mtz, MTZBAT *batch, const char xname[], const char dname[]);
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
00994
00995
00996
00997 #ifdef __cplusplus
00998 } }
00999 #endif
01000 #endif