Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Framework/DataHandling/src/LoadEventNexus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1271,8 +1271,8 @@ void LoadEventNexus::loadEvents(API::Progress *const prog, const bool monitors)
if (eventsLoaded > 0) {
int nBins = getProperty("NumberOfBins");
auto binEdgesVec = std::vector<double>(nBins + 1);
binEdgesVec[0] = shortest_tof - 1;
binEdgesVec[nBins] = longest_tof + 1;
binEdgesVec[0] = shortest_tof; // left edge is inclusive
binEdgesVec[nBins] = longest_tof + 1; // right edge is exclusive
double binStep = (binEdgesVec[nBins] - binEdgesVec[0]) / nBins;
for (int binIndex = 1; binIndex < nBins; binIndex++) {
binEdgesVec[binIndex] = binEdgesVec[0] + (binStep * binIndex);
Expand Down
2 changes: 1 addition & 1 deletion Framework/DataHandling/test/LoadEventNexusTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ class LoadEventNexusTest : public CxxTest::TestSuite {
TS_ASSERT_EQUALS(WS->getNumberEvents(), 112266);
// TOF limits found. There is a pad of +-1 given around the actual TOF
// founds.
TS_ASSERT_DELTA((*WS->refX(0))[0], 44162.6, 0.05);
TS_ASSERT_DELTA((*WS->refX(0))[0], 44163.6, 0.05);
TS_ASSERT_DELTA((*WS->refX(0))[1], 60830.2, 0.05);
// Valid spectrum info
TS_ASSERT_EQUALS(WS->getSpectrum(0).getSpectrumNo(), 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9e7cd5cb0a44319e99aa8a1fd2a5b549
4eec33256ef34ab9cbc302eb4bdf9a7e
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/PowderReduceP2D_reference.p2d.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8bb9ff77463d810b9a72f7d3aaf2b9a8
9af80ceca5fe5d41c23940871f5783c1
27 changes: 15 additions & 12 deletions Testing/SystemTests/tests/framework/TOPAZPeakFinding.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import numpy
from mantid.simpleapi import *
from mantid.dataobjects import PeaksWorkspace, LeanElasticPeaksWorkspace
from mantid.geometry import UnitCell


class TOPAZPeakFinding(systemtesting.MantidSystemTest):
Expand All @@ -22,6 +23,8 @@ def requiredMemoryMB(self):
return 2000

def runTest(self):
unitcell_exp = UnitCell(4.714, 6.06, 10.40) # orthorhombic

# Load then convert to Q in the lab frame
LoadEventNexus(Filename=r"TOPAZ_3132_event.nxs", OutputWorkspace="topaz_3132")
ConvertToDiffractionMDWorkspace(
Expand Down Expand Up @@ -113,12 +116,12 @@ def runTest(self):
w = mtd["topaz_3132"]
s = w.sample()
ol = s.getOrientedLattice()
self.assertDelta(ol.a(), 4.714, 0.01, "Correct lattice a value not found.")
self.assertDelta(ol.b(), 6.06, 0.01, "Correct lattice b value not found.")
self.assertDelta(ol.c(), 10.42, 0.01, "Correct lattice c value not found.")
self.assertDelta(ol.alpha(), 90, 0.4, "Correct lattice angle alpha value not found.")
self.assertDelta(ol.beta(), 90, 0.4, "Correct lattice angle beta value not found.")
self.assertDelta(ol.gamma(), 90, 0.4, "Correct lattice angle gamma value not found.")
self.assertDelta(ol.a(), unitcell_exp.a(), 0.01, "Correct lattice a value not found.")
self.assertDelta(ol.b(), unitcell_exp.b(), 0.01, "Correct lattice b value not found.")
self.assertDelta(ol.c(), unitcell_exp.c(), 0.01, "Correct lattice c value not found.")
self.assertDelta(ol.alpha(), unitcell_exp.alpha(), 0.4, "Correct lattice angle alpha value not found.")
self.assertDelta(ol.beta(), unitcell_exp.beta(), 0.4, "Correct lattice angle beta value not found.")
self.assertDelta(ol.gamma(), unitcell_exp.gamma(), 0.4, "Correct lattice angle gamma value not found.")

# Compare new and old UBs
newUB = numpy.array(mtd["topaz_3132"].sample().getOrientedLattice().getUB())
Expand Down Expand Up @@ -155,12 +158,12 @@ def runTest(self):
w = mtd["topaz_3132"]
s = w.sample()
ol = s.getOrientedLattice()
self.assertDelta(ol.a(), 4.714, 0.01, "Correct lattice a value not found.")
self.assertDelta(ol.b(), 6.06, 0.01, "Correct lattice b value not found.")
self.assertDelta(ol.c(), 10.42, 0.01, "Correct lattice c value not found.")
self.assertDelta(ol.alpha(), 90, 0.4, "Correct lattice angle alpha value not found.")
self.assertDelta(ol.beta(), 90, 0.4, "Correct lattice angle beta value not found.")
self.assertDelta(ol.gamma(), 90, 0.4, "Correct lattice angle gamma value not found.")
self.assertDelta(ol.a(), unitcell_exp.a(), 0.01, "Correct lattice a value not found.")
self.assertDelta(ol.b(), unitcell_exp.b(), 0.01, "Correct lattice b value not found.")
self.assertDelta(ol.c(), unitcell_exp.c(), 0.01, "Correct lattice c value not found.")
self.assertDelta(ol.alpha(), unitcell_exp.alpha(), 0.4, "Correct lattice angle alpha value not found.")
self.assertDelta(ol.beta(), unitcell_exp.beta(), 0.4, "Correct lattice angle beta value not found.")
self.assertDelta(ol.gamma(), unitcell_exp.gamma(), 0.4, "Correct lattice angle gamma value not found.")

# Compare new and old UBs
newUB = numpy.array(mtd["topaz_3132"].sample().getOrientedLattice().getUB())
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
00c4d103c9ef25d6b91490546b44e4f1
b0387c5656e8396cb473835d38aa59c1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Modify :ref:`LoadEventNexus <algm-LoadEventNexus>` so the minimum histogram bin edge is equal to the lowest time-of-flight event rather than one less. The effect is that there is no longer negative bin edges unless there is actually a negative time-of-flight in the data.
Loading