Skip to content
Snippets Groups Projects
Commit 483603bb authored by Thannozzz's avatar Thannozzz
Browse files

added definitation of reciprocal space cut. Added everything related to input

parent c637433b
No related branches found
No related tags found
1 merge request!19Merge develop into main
......@@ -540,6 +540,51 @@ void Params::read_xml(std::string filename) {
boost::lexical_cast<string>(kappa.value));
}
}
/** Added by Arnab Majumdar, hereon
new feature - background subtraction
*/
if (xmli.exists("//scattering/background/cut")) {
if (xmli.exists("//scattering/background/cut/box")){
Info::Inst()->write(string("Removing unwanted from simulation box in reciprocal space"));
ScatteringBackgroundCutBoxParameters box;
box.sld=ImagNum(0,0);
box.xlength=10.0;
box.ylength=10.0;
box.zlength=10.0;
box.midpoint.x=0.0;
box.midpoint.y=0.0;
box.midpoint.z=0.0;
if (xmli.exists("//scattering/background/cut/box/sld")){
box.sld.re=xmli.get_value<double>("//scattering/background/cut/box/sld/real");
box.sld.im=xmli.get_value<double>("//scattering/background/cut/box/sld/imaginary");
}
if (xmli.exists("//scattering/background/cut/box/xlength"))
box.xlength=xmli.get_value<double>("//scattering/background/cut/box/xlength");
if (xmli.exists("//scattering/background/cut/box/ylength"))
box.ylength=xmli.get_value<double>("//scattering/background/cut/box/ylength");
if (xmli.exists("//scattering/background/cut/box/zlength"))
box.zlength=xmli.get_value<double>("//scattering/background/cut/box/zlength");
if (xmli.exists("//scattering/background/cut/box/midpoint/x"))
box.midpoint.x=xmli.get_value<double>("//scattering/background/cut/box/midpoint/x");
if (xmli.exists("//scattering/background/cut/box/midpoint/y"))
box.midpoint.y=xmli.get_value<double>("//scattering/background/cut/box/midpoint/y");
if (xmli.exists("//scattering/background/cut/box/midpoint/z"))
box.midpoint.z=xmli.get_value<double>("//scattering/background/cut/box/midpoint/z");
Info::Inst()->write(string("Box details:"));
Info::Inst()->write(string("sld =") + boost::lexical_cast<string>(box.sld) + string(", lengths are ")
+ boost::lexical_cast<string>(box.xlength) + string(", ")
+ boost::lexical_cast<string>(box.ylength) + string(", ")
+ boost::lexical_cast<string>(box.zlength)
+ string(", midpoint is (")
+ boost::lexical_cast<string>(box.midpoint.x) + string(", ")
+ boost::lexical_cast<string>(box.midpoint.y) + string(", ")
+ boost::lexical_cast<string>(box.midpoint.z) + string(")"));
scattering.background.cut.box=box;
}
}
}
// generating qqqvectors, i.e. the spectrum
if (xmli.exists("//scattering/vectors")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment