BraggPrediction: Set Lorentz-polarization correction properly
This commit is contained in:
@@ -98,18 +98,12 @@ std::vector<Reflection> IntegrateInternal(const DiffractionExperiment &experimen
|
||||
IntegrateReflection(r, ptr, image.GetWidth(), image.GetHeight(), special_value, saturation,
|
||||
r_3, r_1_sq, r_2_sq, r_3_sq);
|
||||
if (r.observed) {
|
||||
float corr = 1.0;
|
||||
if (experiment.GetPolarizationFactor())
|
||||
corr /= geom.CalcAzIntPolarizationCorr(r.predicted_x, r.predicted_y,
|
||||
r.lp *= geom.CalcAzIntPolarizationCorr(r.predicted_x, r.predicted_y,
|
||||
experiment.GetPolarizationFactor().value());
|
||||
Coord S{r.S_x, r.S_y, r.S_z};
|
||||
if (experiment.GetGoniometer().has_value())
|
||||
corr *= std::fabs(m2 * (S % S0)) / (S * S0);
|
||||
|
||||
r.lp = 1.0f / corr;
|
||||
r.I *= corr;
|
||||
r.bkg *= corr;
|
||||
r.sigma *= corr;
|
||||
r.I *= r.lp;
|
||||
r.bkg *= r.lp;
|
||||
r.sigma *= r.lp;
|
||||
r.image_number = static_cast<float>(image_number);
|
||||
ret.emplace_back(r);
|
||||
}
|
||||
|
||||
@@ -100,6 +100,7 @@ int BraggPrediction::Calc(const DiffractionExperiment &experiment, const Crystal
|
||||
.predicted_y = y,
|
||||
.d = d,
|
||||
.dist_ewald = dist_ewald_sphere,
|
||||
.lp = 1.0,
|
||||
.S_x = S_x,
|
||||
.S_y = S_y,
|
||||
.S_z = S_z
|
||||
|
||||
@@ -84,6 +84,7 @@ namespace {
|
||||
out.S_x = Sx;
|
||||
out.S_y = Sy;
|
||||
out.S_z = Sz;
|
||||
out.lp = 1.0f;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user