Skip to content
Snippets Groups Projects
Commit 3b01893c authored by Yurov, Dmitry's avatar Yurov, Dmitry
Browse files

Add SpecularSimulation::setScan method

parent 24472220
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,25 @@ SimulationResult SpecularSimulation::result() const ...@@ -89,6 +89,25 @@ SimulationResult SpecularSimulation::result() const
return SimulationResult(*data, *converter); return SimulationResult(*data, *converter);
} }
void SpecularSimulation::setScan(const ISpecularScan& scan)
{
// TODO: move inside AngularSpecScan when pointwise resolution is implemented
if (scan.coordinateAxis()->getMin() < 0.0)
throw std::runtime_error(
"Error in SpecularSimulation::setScan: minimum value on coordinate axis is negative.");
m_data_handler.reset(scan.clone());
SpecularDetector1D detector(*scan.coordinateAxis());
m_instrument.setDetector(detector);
// TODO: remove when pointwise resolution is implemented
if (scan.dataType() == ISpecularScan::angle) {
const auto& angular_scan = static_cast<const AngularSpecScan&>(scan);
m_instrument.setBeamParameters(angular_scan.wavelength(), zero_alpha_i, zero_phi_i);
}
}
void SpecularSimulation::setBeamParameters(double lambda, const IAxis& alpha_axis, void SpecularSimulation::setBeamParameters(double lambda, const IAxis& alpha_axis,
const IFootprintFactor* beam_shape) const IFootprintFactor* beam_shape)
{ {
......
...@@ -53,6 +53,9 @@ public: ...@@ -53,6 +53,9 @@ public:
//! zeros. //! zeros.
SimulationResult result() const override; SimulationResult result() const override;
//! Sets chosen specular scan to the simulation.
void setScan(const ISpecularScan& scan);
void setBeamParameters(double lambda, int nbins, double alpha_i_min, double alpha_i_max, void setBeamParameters(double lambda, int nbins, double alpha_i_min, double alpha_i_max,
const IFootprintFactor* beam_shape = nullptr); const IFootprintFactor* beam_shape = nullptr);
void setBeamParameters(double lambda, std::vector<double> incident_angle_values, void setBeamParameters(double lambda, std::vector<double> incident_angle_values,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment