00001
00002
00003
00004
00005
00006 #ifndef XDS_UNMERGE_HEADER
00007 #define XDS_UNMERGE_HEADER
00008
00009 #include <string>
00010 #include "hkl_controls.hh"
00011 #include "controls.hh"
00012 #include "hkl_unmerge.hh"
00013 #include "hkl_datatypes.hh"
00014
00015
00016 #include <clipper/clipper.h>
00017 using clipper::Vec3;
00018 using clipper::Mat33;
00019
00020
00021 namespace XDSIO
00022 {
00023
00024 class KeyValues
00025 {
00026
00027 public:
00028 KeyValues() {}
00029 KeyValues(const clipper::String& Key)
00030 {
00031 key = Key;
00032 values.clear();
00033 }
00034
00035 clipper::String key;
00036 std::vector<clipper::String> values;
00037 };
00038
00039 enum XDStype {NONE, XDS_INTEGRATE, XDS_ASCII, XSCALE};
00040
00041 class XDSunmergeFile
00042 {
00043 public:
00044 XDSunmergeFile(): ftype(NONE) {}
00046 XDSunmergeFile(const std::string& xdsName,
00047 const int& verbose,
00048 std::string& output);
00050 void init(const std::string& xdsName,
00051 const int& verbose,
00052 std::string& output);
00053
00055 scala::FileRead FillHklList (std::string& output,
00056 const int& verbose,
00057 scala::hkl_unmerge_list& hkl_list);
00058
00060 scala::FileRead AddHklList (const scala::file_select& file_sel,
00061 const scala::all_controls& controls,
00062 const scala::PxdName& InputPxdName,
00063 const scala::Scell& newcell,
00064 std::string& output,
00065 const int& verbose,
00066 scala::hkl_unmerge_list& hkl_list);
00086
00087 int Ncols() const {return nitem;}
00089 scala::SpaceGroup Spacegroup() const {return spacegroup;}
00091 scala::Scell Cell() const {return cell;}
00092
00093 private:
00094
00095 void ClearColumnNumbers();
00096 int ProcessKeyValues(const KeyValues& keyval, std::string& output);
00097 void XDStoCambridgeFrame(std::string& output,
00098 const int& verbose);
00099 int ReadObservations(FILE* xdsin,
00100 const scala::file_select& file_sel,
00101 const scala::all_controls& controls,
00102 std::string& output,
00103 scala::hkl_unmerge_list& hkl_list);
00104 scala::data_flags CheckColumns(std::string& output) const;
00105 void ReconstructOrientation(scala::hkl_unmerge_list& hkl_list,
00106 std::string& output);
00107 int MakeDataset(const scala::PxdName& InputPxdName);
00108 int MakeBatches(const scala::hkl_symmetry& Symm,
00109 const int& Idataset);
00110 int SetItems();
00111
00112
00113
00114 std::vector<scala::Xdataset> datasets;
00115 std::vector<scala::Batch> batches;
00116
00117 std::string xdsname;
00118 FILE* xdsin;
00119 bool atdata;
00120 std::string xHM;
00121 bool GeomInfo;
00122 scala::SpaceGroup spacegroup;
00123
00124
00125
00126 XDStype ftype;
00127
00128 int spacegroup_number;
00129
00130 scala::Scell cell;
00131
00132 std::string xdsdate;
00133
00134 std::string image_template;
00135
00136 int FirstImage, LastImage;
00137 double wavelength;
00138
00139 clipper::Vec3<double> beam;
00140
00141 clipper::Vec3<double> rotaxis;
00142
00143 double osc_range;
00144
00145 double phi0;
00146
00147 int image0;
00148
00149 clipper::Vec3<double> dxaxis;
00150
00151 clipper::Vec3<double> dyaxis;
00152
00153 double det_dist;
00154
00155 double orgx, orgy;
00156
00157 int nxpix, nypix;
00158
00159 double qxpixsize, qypixsize;
00160
00161 int nitem_rec;
00162 int nitem;
00163
00164 int col_H, col_K, col_L, col_IOBS, col_SIGMAI, col_XD, col_YD, col_ZD;
00165 int col_RLP, col_PEAK, col_CORR, col_PSI, col_ISET, col_DCY;
00166
00167
00168 Mat33<double> Qxds2cam;
00169
00170
00171
00172
00173
00174
00175
00176
00177 Mat33<double> QEd;
00178
00179
00180 Mat33<double> Umat;
00181 Vec3<double> s0C;
00182
00183
00184 int Nbatches;
00185 std::vector<int> NobsInBatch;
00186 };
00187 }
00188 #endif