Skip to content
Snippets Groups Projects

In scan constructor, interpret limits as scan points, not as bin edges (#423)

Merged Wuttke, Joachim requested to merge i423 into main
34 files
+ 141
56
Compare changes
  • Side-by-side
  • Inline
Files
34
+ 11
0
@@ -127,3 +127,14 @@ bool FixedBinAxis::equals(const IAxis& other) const
}
return false;
}
//... In global namespace.
FixedBinAxis FixedScanAxis(const std::string& name, size_t nbins, double scan_start,
double scan_end)
{
if (nbins < 2)
throw std::runtime_error("Cannot create scan axis with less than two points");
const double delta = (scan_end - scan_start) / (nbins - 1);
return FixedBinAxis(name, nbins, scan_start - delta / 2, scan_end + delta / 2);
}
Loading