Commit 603a0eca by maarten

met map-maker server

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@393 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent cccbfe02
...@@ -80,7 +80,8 @@ class MapMaker ...@@ -80,7 +80,8 @@ class MapMaker
std::initializer_list<std::string> fbLabels = { "FWT", "PHWT" }, std::initializer_list<std::string> fbLabels = { "FWT", "PHWT" },
std::initializer_list<std::string> fdLabels = { "DELFWT", "PHDELWT" }, std::initializer_list<std::string> fdLabels = { "DELFWT", "PHDELWT" },
std::initializer_list<std::string> foLabels = { "FP", "SIGFP" }, std::initializer_list<std::string> foLabels = { "FP", "SIGFP" },
std::initializer_list<std::string> fcLabels = { "FC_ALL", "PHIC_ALL" }); std::initializer_list<std::string> fcLabels = { "FC_ALL", "PHIC_ALL" },
std::initializer_list<std::string> faLabels = { "FAN", "PHAN" });
void loadMaps( void loadMaps(
const boost::filesystem::path& fbMapFile, const boost::filesystem::path& fbMapFile,
...@@ -106,9 +107,11 @@ class MapMaker ...@@ -106,9 +107,11 @@ class MapMaker
MapType& fb() { return mFb; } MapType& fb() { return mFb; }
MapType& fd() { return mFd; } MapType& fd() { return mFd; }
MapType& fa() { return mFa; }
const MapType& fb() const { return mFb; } const MapType& fb() const { return mFb; }
const MapType& fd() const { return mFd; } const MapType& fd() const { return mFd; }
const MapType& fa() const { return mFa; }
double resLow() const { return mResLow; } double resLow() const { return mResLow; }
double resHigh() const { return mResHigh; } double resHigh() const { return mResHigh; }
...@@ -117,7 +120,6 @@ class MapMaker ...@@ -117,7 +120,6 @@ class MapMaker
const Cell& cell() const { return mHKLInfo.cell(); } const Cell& cell() const { return mHKLInfo.cell(); }
const Grid_sampling& gridSampling() const { return mGrid; } const Grid_sampling& gridSampling() const { return mGrid; }
private: private:
void loadFoFreeFromReflectionsFile(const boost::filesystem::path& hklin); void loadFoFreeFromReflectionsFile(const boost::filesystem::path& hklin);
...@@ -127,7 +129,7 @@ class MapMaker ...@@ -127,7 +129,7 @@ class MapMaker
void fixMTZ(); void fixMTZ();
MapType mFb, mFd; MapType mFb, mFd, mFa;
Grid_sampling mGrid; Grid_sampling mGrid;
float mSamplingRate; float mSamplingRate;
double mResLow, mResHigh; double mResLow, mResHigh;
...@@ -137,7 +139,7 @@ class MapMaker ...@@ -137,7 +139,7 @@ class MapMaker
HKL_info mHKLInfo; HKL_info mHKLInfo;
HKL_data<F_sigF> mFoData; HKL_data<F_sigF> mFoData;
HKL_data<Flag> mFreeData; HKL_data<Flag> mFreeData;
HKL_data<F_phi> mFcData, mFbData, mFdData; HKL_data<F_phi> mFcData, mFbData, mFdData, mFaData;
HKL_data<Phi_fom> mPhiFomData; HKL_data<Phi_fom> mPhiFomData;
}; };
......
...@@ -152,12 +152,14 @@ MapMaker<FTYPE>::~MapMaker() ...@@ -152,12 +152,14 @@ MapMaker<FTYPE>::~MapMaker()
template<typename FTYPE> template<typename FTYPE>
void MapMaker<FTYPE>::loadMTZ(const fs::path& hklin, float samplingRate, void MapMaker<FTYPE>::loadMTZ(const fs::path& hklin, float samplingRate,
initializer_list<string> fbLabels, initializer_list<string> fdLabels, initializer_list<string> fbLabels, initializer_list<string> fdLabels,
initializer_list<string> foLabels, initializer_list<string> fcLabels) initializer_list<string> foLabels, initializer_list<string> fcLabels,
initializer_list<string> faLabels)
{ {
if (VERBOSE) if (VERBOSE)
cerr << "Reading map from " << hklin << endl cerr << "Reading map from " << hklin << endl
<< " with labels: FB: " << ba::join(fbLabels, ",") << endl << " with labels: FB: " << ba::join(fbLabels, ",") << endl
<< " with labels: FD: " << ba::join(fdLabels, ",") << endl << " with labels: FD: " << ba::join(fdLabels, ",") << endl
<< " with labels: FA: " << ba::join(faLabels, ",") << endl
<< " with labels: FO: " << ba::join(foLabels, ",") << endl << " with labels: FO: " << ba::join(foLabels, ",") << endl
<< " with labels: FC: " << ba::join(fcLabels, ",") << endl; << " with labels: FC: " << ba::join(fcLabels, ",") << endl;
...@@ -202,10 +204,26 @@ void MapMaker<FTYPE>::loadMTZ(const fs::path& hklin, float samplingRate, ...@@ -202,10 +204,26 @@ void MapMaker<FTYPE>::loadMTZ(const fs::path& hklin, float samplingRate,
mtzin.import_hkl_info(mHKLInfo); mtzin.import_hkl_info(mHKLInfo);
bool hasFAN = false;
const regex rx(R"(^/[^/]+/[^/]+/(.+) \S$)");
for (auto& label: mtzin.column_labels())
{
smatch m;
if (regex_match(label, m, rx) and m[1] == "FAN")
{
hasFAN = true;
break;
}
}
mtzin.import_hkl_data(mFbData, mtzin.import_hkl_data(mFbData,
(boost::format(kBasePath) % "*" % "*" % ba::join(fbLabels, ",")).str()); (boost::format(kBasePath) % "*" % "*" % ba::join(fbLabels, ",")).str());
mtzin.import_hkl_data(mFdData, mtzin.import_hkl_data(mFdData,
(boost::format(kBasePath) % "*" % "*" % ba::join(fdLabels, ",")).str()); (boost::format(kBasePath) % "*" % "*" % ba::join(fdLabels, ",")).str());
if (hasFAN)
mtzin.import_hkl_data(mFaData,
(boost::format(kBasePath) % "*" % "*" % ba::join(faLabels, ",")).str());
mtzin.import_hkl_data(mFoData, mtzin.import_hkl_data(mFoData,
(boost::format(kBasePath) % "*" % "*" % ba::join(foLabels, ",")).str()); (boost::format(kBasePath) % "*" % "*" % ba::join(foLabels, ",")).str());
mtzin.import_hkl_data(mFcData, mtzin.import_hkl_data(mFcData,
...@@ -245,12 +263,19 @@ void MapMaker<FTYPE>::loadMTZ(const fs::path& hklin, float samplingRate, ...@@ -245,12 +263,19 @@ void MapMaker<FTYPE>::loadMTZ(const fs::path& hklin, float samplingRate,
clipper::Xmap<FTYPE>& fbMap = mFb; clipper::Xmap<FTYPE>& fbMap = mFb;
clipper::Xmap<FTYPE>& fdMap = mFd; clipper::Xmap<FTYPE>& fdMap = mFd;
clipper::Xmap<FTYPE>& faMap = mFa;
fbMap.init(spacegroup, cell, mGrid); // define map fbMap.init(spacegroup, cell, mGrid); // define map
fbMap.fft_from(mFbData); // generate map fbMap.fft_from(mFbData); // generate map
fdMap.init(spacegroup, cell, mGrid); // define map fdMap.init(spacegroup, cell, mGrid); // define map
fdMap.fft_from(mFdData); // generate map fdMap.fft_from(mFdData); // generate map
if (not mFaData.is_null())
{
faMap.init(spacegroup, cell, mGrid);
faMap.fft_from(mFaData);
}
if (VERBOSE) if (VERBOSE)
{ {
...@@ -560,10 +585,10 @@ void MapMaker<FTYPE>::recalc(const Structure& structure, ...@@ -560,10 +585,10 @@ void MapMaker<FTYPE>::recalc(const Structure& structure,
clipper::Xmap<FTYPE>& fdMap = mFd; clipper::Xmap<FTYPE>& fdMap = mFd;
fbMap.init(spacegroup, cell, mGrid); // define map fbMap.init(spacegroup, cell, mGrid); // define map
fbMap.fft_from(mFbData); // generate map fbMap.fft_from(mFbData); // generate map
fdMap.init(spacegroup, cell, mGrid); // define map fdMap.init(spacegroup, cell, mGrid); // define map
fdMap.fft_from(mFdData); // generate map fdMap.fft_from(mFdData); // generate map
if (VERBOSE) if (VERBOSE)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment