diff --git a/Code/Mantid/Framework/Crystal/src/PredictPeaks.cpp b/Code/Mantid/Framework/Crystal/src/PredictPeaks.cpp index 1e195549ef217caac3b1a6c3d3080fedd27c91d9..0a03cfdb7a5b19bdf7368c2b08fd0d1d6c199472 100644 --- a/Code/Mantid/Framework/Crystal/src/PredictPeaks.cpp +++ b/Code/Mantid/Framework/Crystal/src/PredictPeaks.cpp @@ -318,7 +318,7 @@ namespace Crystal { // ---------------- Determine which HKL to look for ------------------------------------- // Inverse d-spacing that is the limit to look for. - double dstar = 1.0/minD; + double Qmax = 2.*M_PI/minD; V3D hklMin(0,0,0); V3D hklMax(0,0,0); for (double qx=-1; qx < 2; qx += 2) @@ -327,7 +327,7 @@ namespace Crystal { // Build a q-vector for this corner of a cube V3D Q(qx,qy,qz); - Q *= dstar; + Q *= Qmax; V3D hkl = crystal.hklFromQ(Q); // Find the limits of each hkl for (size_t i=0; i<3; i++) diff --git a/Code/Mantid/Framework/Geometry/src/Crystal/OrientedLattice.cpp b/Code/Mantid/Framework/Geometry/src/Crystal/OrientedLattice.cpp index e1b5647249f0e023bb18d4375c9ad3fb107d5f5e..cecae936264076e9058a85afce83013fa9d98167 100644 --- a/Code/Mantid/Framework/Geometry/src/Crystal/OrientedLattice.cpp +++ b/Code/Mantid/Framework/Geometry/src/Crystal/OrientedLattice.cpp @@ -163,7 +163,7 @@ namespace Geometry { DblMatrix UBinv = this->getUB(); UBinv.Invert(); - V3D out = UBinv*Q; //transform back to HKL + V3D out = UBinv*Q/TWO_PI; //transform back to HKL return out; } diff --git a/Code/Mantid/Framework/Geometry/test/OrientedLatticeTest.h b/Code/Mantid/Framework/Geometry/test/OrientedLatticeTest.h index 2ea23bcbbb699cd4ff60b10d61fea8bf5780ceea..a2006de288f493c1149fbd1232cb24d7337fe006 100644 --- a/Code/Mantid/Framework/Geometry/test/OrientedLatticeTest.h +++ b/Code/Mantid/Framework/Geometry/test/OrientedLatticeTest.h @@ -41,7 +41,7 @@ public: // Convert to and from HKL V3D hkl = u.hklFromQ(V3D(1.0, 2.0, 3.0)); double dstar = u.dstar(hkl[0], hkl[1], hkl[2]); - TS_ASSERT_DELTA( dstar, sqrt(1+4.0+9.0), 1e-4); // The d-spacing after a round trip matches the Q we put in + TS_ASSERT_DELTA( dstar, .5*sqrt(1+4.0+9.0)/M_PI, 1e-4); // The d-spacing after a round trip matches the Q we put in }