00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00129 #ifndef __CMTZLib__
00130 #define __CMTZLib__
00131
00132 static char rcsidhm[100] = "$Id: cmtzlib_8h-source.html,v 1.8 2004/07/05 14:36:56 mdw Exp $";
00133
00134
00135 #include "ccp4_utils.h"
00136
00137 #ifdef __cplusplus
00138 namespace CMtz {
00139 extern "C" {
00140 typedef CCP4::CCP4File CCP4File;
00141 #endif
00142
00143
00144 #include "mtzdata.h"
00145
00146
00147
00154 MTZ *MtzGet(const char *logname, int read_refs);
00155
00162 int MtzRrefl(CCP4File *filein, int ncol, float *refldata);
00163
00170 int MtzPut(MTZ *mtz, const char *logname);
00171
00176 CCP4File *MtzOpenForWrite(const char *logname);
00177
00185 int MtzWhdrLine(CCP4File *fileout, int nitems, char buffer[]);
00186
00194 int MtzWrefl(CCP4File *fileout, int ncol, float *refldata);
00195
00202 int MtzDeleteRefl(MTZ *mtz, int iref);
00203
00204
00205
00217 MTZ *MtzMalloc(int nxtal, int nset[]);
00218
00223 int MtzFree(MTZ *mtz);
00224
00231 MTZCOL *MtzMallocCol(MTZ *mtz, int nref);
00232
00237 int MtzFreeCol(MTZCOL *col);
00238
00242 MTZBAT *MtzMallocBatch(void);
00243
00248 int MtzFreeBatch(MTZBAT *batch);
00249
00254 char *MtzCallocHist(int nhist);
00255
00260 int MtzFreeHist(char *hist);
00261
00267 void MtzMemTidy(void);
00268
00269
00270
00275 int MtzNbat(const MTZ *mtz);
00276
00281 int MtzNref(const MTZ *mtz);
00282
00287 int MtzSpacegroupNumber(const MTZ *mtz);
00288
00296 int MtzResLimits(const MTZ *mtz, float *minres, float *maxres);
00297
00298
00299
00304 int MtzNxtal(const MTZ *mtz);
00305
00310 int MtzNumActiveXtal(const MTZ *mtz);
00311
00316 MTZXTAL **MtzXtals(MTZ *mtz);
00317
00323 MTZXTAL *MtzIxtal(const MTZ *mtz, const int ixtal);
00324
00331 char *MtzXtalPath(const MTZXTAL *xtal);
00332
00338 MTZXTAL *MtzXtalLookup(const MTZ *mtz, const char *label);
00339
00347 MTZXTAL *MtzAddXtal(MTZ *mtz, const char *xname, const char *pname,
00348 const float cell[6]);
00349
00354 int MtzNsetsInXtal(const MTZXTAL *xtal);
00355
00360 int MtzNumActiveSetsInXtal(const MTZ *mtz, const MTZXTAL *xtal);
00361
00367 MTZSET **MtzSetsInXtal(MTZXTAL *xtal);
00368
00375 MTZSET *MtzIsetInXtal(const MTZXTAL *xtal, const int iset);
00376
00377
00378
00383 int MtzNset(const MTZ *mtz);
00384
00389 int MtzNumActiveSet(const MTZ *mtz);
00390
00398 MTZXTAL *MtzSetXtal(const MTZ *mtz, const MTZSET *set);
00399
00408 char *MtzSetPath(const MTZ *mtz, const MTZSET *set);
00409
00416 MTZSET *MtzSetLookup(const MTZ *mtz, const char *label);
00417
00425 MTZSET *MtzAddDataset(MTZ *mtz, MTZXTAL *xtl, const char *dname,
00426 const float wavelength);
00427
00434 int MtzNcolsInSet(const MTZSET *set);
00435
00440 int MtzNumActiveColsInSet(const MTZSET *set);
00441
00447 int MtzNumSourceColsInSet(const MTZSET *set);
00448
00454 int MtzNbatchesInSet(const MTZ *mtz, const MTZSET *set);
00455
00461 MTZCOL **MtzColsInSet(MTZSET *set);
00462
00470 MTZCOL *MtzIcolInSet(const MTZSET *set, const int icol);
00471
00472
00473
00481 MTZCOL *MtzAddColumn(MTZ *mtz, MTZSET *set, const char *label,
00482 const char *type);
00483
00488 int MtzAssignHKLtoBase(MTZ *mtz);
00489
00502 int MtzAssignColumn(MTZ *mtz, MTZCOL *col, const char crystal_name[],
00503 const char dataset_name[]);
00504
00511 int MtzToggleColumn(MTZCOL *col);
00512
00519 MTZSET *MtzColSet(const MTZ *mtz, const MTZCOL *col);
00520
00525 int MtzNcol(const MTZ *mtz);
00526
00531 int MtzNumActiveCol(const MTZ *mtz);
00532
00538 int MtzNumSourceCol(const MTZ *mtz);
00539
00547 char *MtzColPath(const MTZ *mtz, const MTZCOL *col);
00548
00555 int MtzRJustPath(char *path, const char *partial, const int njust);
00556
00562 int MtzPathMatch(const char *path1, const char *path2);
00563
00569 MTZCOL *MtzColLookup(const MTZ *mtz, const char *label);
00570
00575 char *MtzColType(MTZCOL *col);
00576
00582 void MtzDebugHierarchy(const MTZ *mtz);
00583
00591 int MtzListColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
00592
00600 int MtzListInputColumn(const MTZ *mtz, char clabs[][31], char ctyps[][3], int csetid[]);
00601
00602
00603
00612 int MtzFindInd(const MTZ *mtz, int *ind_xtal, int *ind_set, int ind_col[3]);
00613
00620 float MtzInd2reso(const int in[3], const double coefhkl[6]);
00621
00627 int MtzHklcoeffs(const float cell[6], double coefhkl[6]);
00628
00635 int MtzArrayToBatch(const int *intbuf, const float *fltbuf, MTZBAT *batch);
00636
00643 int MtzBatchToArray(MTZBAT *batch, int *intbuf, float *fltbuf);
00644
00653 MTZBAT *sort_batches(MTZBAT *batch, int numbat);
00654
00655
00656
00663 int ccp4_lrtitl(const MTZ *mtz, char *title);
00664
00671 int ccp4_lrhist(const MTZ *mtz, char history[][MTZRECORDLENGTH], int nlines);
00672
00678 int ccp4_lrsort(const MTZ *mtz, int isort[5]);
00679
00686 int ccp4_lrbats(const MTZ *mtz, int *nbatx, int batchx[]);
00687
00693 int ccp4_lrcell(const MTZXTAL *xtl, float cell[]);
00694
00704 int ccp4_lrsymi(const MTZ *mtz, int *nsympx, char *ltypex, int *nspgrx,
00705 char *spgrnx, char *pgnamx);
00706
00716 int ccp4_lrsymm(const MTZ *mtz, int *nsymx, float rsymx[192][4][4]);
00717
00727 int MtzParseLabin(char *labin_line, const char prog_labels[][31],
00728 const int nlprgi, char user_labels[][2][31]);
00729
00743 MTZCOL **ccp4_lrassn(const MTZ *mtz, const char labels[][31], const int nlabels,
00744 char types[][3]);
00745
00759 int ccp4_lridx(const MTZ *mtz, const MTZSET *set, char crystal_name[64],
00760 char dataset_name[64], char project_name[64], int *isets,
00761 float datcell[6], float *datwave);
00762
00778 int ccp4_lrrefl(const MTZ *mtz, float *resol, float adata[], int logmss[], int iref);
00779
00796 int ccp4_lrreff(const MTZ *mtz, float *resol, float adata[], int logmss[],
00797 const MTZCOL *lookup[], const int ncols, const int iref);
00798
00806 int ccp4_ismnf(const MTZ *mtz, const float datum);
00807
00813 int ccp4_lhprt(const MTZ *mtz, int iprint);
00814
00821 int ccp4_lhprt_adv(const MTZ *mtz, int iprint);
00822
00830 int ccp4_lrbat(MTZBAT *batch, float *buf, char *charbuf, int iprint);
00831
00836 int MtzPrintBatchHeader(const MTZBAT *batch);
00837
00845 int ccp4_lwtitl(MTZ *mtz, const char *ftitle, int flag);
00846
00856 int MtzSetSortOrder(MTZ *mtz, MTZCOL *colsort[5]);
00857
00864 int MtzAddHistory(MTZ *mtz, const char history[][MTZRECORDLENGTH], const int nlines);
00865
00880 int ccp4_lwsymm(MTZ *mtz, int nsymx, int nsympx, float rsymx[192][4][4],
00881 char ltypex[], int nspgrx, char spgrnx[], char pgnamx[]);
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895 MTZCOL **ccp4_lwassn(MTZ *mtz, const char labels[][31], const int nlabels,
00896 const char types[][3], const int iappnd);
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914 int ccp4_lwidx(MTZ *mtz, const char crystal_name[], const char dataset_name[],
00915 const char project_name[], const float datcell[6], const float *datwave);
00916
00917
00930 int ccp4_lwrefl(MTZ *mtz, const float adata[], MTZCOL *lookup[],
00931 const int ncol, const int iref);
00932
00946 int ccp4_lwbat(MTZ *mtz, MTZBAT *batch, const int batno, const float *buf, const char *charbuf);
00947
00948 int ccp4_lwbsetid(MTZ *mtz, MTZBAT *batch, const char xname[], const char dname[]);
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
00999
01000
01001
01002
01003
01004
01005
01006 #ifdef __cplusplus
01007 } }
01008 #endif
01009 #endif