Skip to content
Snippets Groups Projects
Commit 6d81aa62 authored by Harriet Brown's avatar Harriet Brown
Browse files

apply changes from code review

changes two if statments into a single with an &&, changed const to constexpr,
and changed added strings into os.path.join
parent 5c4e2b96
No related branches found
No related tags found
No related merge requests found
......@@ -115,9 +115,9 @@ void CalculatePlaczekSelfScattering::exec() {
}
// set detector law term (eps1)
std::vector<double> eps1;
const double lambdaD = 1.44;
constexpr double LAMBDA_D = 1.44;
for (size_t i = 0; i < xLambda.size() - 1; i++) {
double xTerm = -(xLambda[i] + dx) / lambdaD;
double xTerm = -(xLambda[i] + dx) / LAMBDA_D;
eps1.push_back(xTerm * exp(xTerm) / (1.0 - exp(xTerm)));
}
/* Placzek
......@@ -136,10 +136,8 @@ void CalculatePlaczekSelfScattering::exec() {
size_t nReserve = 0;
const API::SpectrumInfo specInfo = inWS->spectrumInfo();
for (size_t detIndex = 0; detIndex < specInfo.size(); detIndex++) {
if (!(specInfo.isMonitor(detIndex))) {
if (!(specInfo.l2(detIndex) == 0.0)) {
nReserve += 1;
}
if (!(specInfo.isMonitor(detIndex)) && !(specInfo.l2(detIndex) == 0.0)) {
nReserve += 1;
}
}
xLambdas.reserve(nReserve);
......
......@@ -5,7 +5,7 @@
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
from __future__ import (absolute_import, division, print_function)
import os
from isis_powder.routines import absorb_corrections, common, instrument_settings
from isis_powder.abstract_inst import AbstractInst
......@@ -55,7 +55,7 @@ class Polaris(AbstractInst):
# Generate pdf
run_details = self._get_run_details(self._inst_settings.run_number)
focus_file_path = self._generate_out_file_paths(run_details)["nxs_filename"]
cal_file_name = self._inst_settings.calibration_dir + '/' + self._inst_settings.grouping_file_name
cal_file_name = os.path.join(self._inst_settings.calibration_dir, self._inst_settings.grouping_file_name)
pdf_output = polaris_algs.generate_ts_pdf(run_number=self._inst_settings.run_number,
focus_file_path=focus_file_path,
merge_banks=self._inst_settings.merge_banks,
......
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