Commit f8aa054e authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #22420 changes requested by reviewer

parent 91d939d1
...@@ -42,7 +42,8 @@ public: ...@@ -42,7 +42,8 @@ public:
int confidence(Kernel::FileDescriptor &descriptor) const override; int confidence(Kernel::FileDescriptor &descriptor) const override;
private: private:
bool m_ModStru; /// Flag for reading modulated structures
bool m_isModulatedStructure;
std::vector<double> m_offset1 = {0.0, 0.0, 0.0}; std::vector<double> m_offset1 = {0.0, 0.0, 0.0};
std::vector<double> m_offset2 = {0.0, 0.0, 0.0}; std::vector<double> m_offset2 = {0.0, 0.0, 0.0};
std::vector<double> m_offset3 = {0.0, 0.0, 0.0}; std::vector<double> m_offset3 = {0.0, 0.0, 0.0};
...@@ -86,6 +87,9 @@ private: ...@@ -86,6 +87,9 @@ private:
boost::shared_ptr<const Geometry::IComponent> getCachedBankByName( boost::shared_ptr<const Geometry::IComponent> getCachedBankByName(
std::string bankname, std::string bankname,
const boost::shared_ptr<const Geometry::Instrument> &inst); const boost::shared_ptr<const Geometry::Instrument> &inst);
/// Read offsets and add as property
void getOffsets(std::ifstream &in, API::Run &run, std::vector<double> m_offset, std::string &label, double &qSign);
}; };
} // namespace Mantid } // namespace Mantid
......
...@@ -10,8 +10,8 @@ namespace Crystal { ...@@ -10,8 +10,8 @@ namespace Crystal {
corresponding corresponding
to fractional h,k,and l values. to fractional h,k,and l values.
@author Ruth Mikkelson @author Vickie Lynch
@date 2012-12-05 @date 2018-07-13
Copyright &copy; 2012 ISIS Rutherford Appleton Laboratory & Copyright &copy; 2012 ISIS Rutherford Appleton Laboratory &
NScD Oak Ridge National Laboratory NScD Oak Ridge National Laboratory
......
...@@ -35,7 +35,8 @@ public: ...@@ -35,7 +35,8 @@ public:
} }
private: private:
bool m_ModStru = false; /// Flag for writing modulated structures
bool m_isModulatedStructure = false;
/// Initialise the properties /// Initialise the properties
void init() override; void init() override;
......
...@@ -289,7 +289,7 @@ namespace Crystal ...@@ -289,7 +289,7 @@ namespace Crystal
if (IndexingUtils::ValidIndex(hkl, tolerance)) if (IndexingUtils::ValidIndex(hkl, tolerance))
{ {
peaks[i].setModStru(V3D(0,0,0)); peaks[i].setModulationVector(V3D(0,0,0));
main_indexed++; main_indexed++;
h_error = fabs(round(hkl[0])-hkl[0]); h_error = fabs(round(hkl[0])-hkl[0]);
k_error = fabs(round(hkl[1])-hkl[1]); k_error = fabs(round(hkl[1])-hkl[1]);
...@@ -307,7 +307,7 @@ namespace Crystal ...@@ -307,7 +307,7 @@ namespace Crystal
hkl1[2] -= order * offsets1[2]; hkl1[2] -= order * offsets1[2];
if (IndexingUtils::ValidIndex(hkl1, satetolerance)) if (IndexingUtils::ValidIndex(hkl1, satetolerance))
{ {
peaks[i].setModStru(V3D(order,0,0)); peaks[i].setModulationVector(V3D(order,0,0));
sate_indexed++; sate_indexed++;
h_error = fabs(round(hkl1[0])-hkl1[0]); h_error = fabs(round(hkl1[0])-hkl1[0]);
k_error = fabs(round(hkl1[1])-hkl1[1]); k_error = fabs(round(hkl1[1])-hkl1[1]);
...@@ -324,7 +324,7 @@ namespace Crystal ...@@ -324,7 +324,7 @@ namespace Crystal
hkl1[2] -= order * offsets2[2]; hkl1[2] -= order * offsets2[2];
if (IndexingUtils::ValidIndex(hkl1, satetolerance)) if (IndexingUtils::ValidIndex(hkl1, satetolerance))
{ {
peaks[i].setModStru(V3D(0,order,0)); peaks[i].setModulationVector(V3D(0,order,0));
sate_indexed++; sate_indexed++;
h_error = fabs(round(hkl1[0])-hkl1[0]); h_error = fabs(round(hkl1[0])-hkl1[0]);
k_error = fabs(round(hkl1[1])-hkl1[1]); k_error = fabs(round(hkl1[1])-hkl1[1]);
...@@ -341,7 +341,7 @@ namespace Crystal ...@@ -341,7 +341,7 @@ namespace Crystal
hkl1[2] -= order * offsets3[2]; hkl1[2] -= order * offsets3[2];
if (IndexingUtils::ValidIndex(hkl1, satetolerance)) if (IndexingUtils::ValidIndex(hkl1, satetolerance))
{ {
peaks[i].setModStru(V3D(0,0,order)); peaks[i].setModulationVector(V3D(0,0,order));
sate_indexed++; sate_indexed++;
h_error = fabs(round(hkl1[0])-hkl1[0]); h_error = fabs(round(hkl1[0])-hkl1[0]);
k_error = fabs(round(hkl1[1])-hkl1[1]); k_error = fabs(round(hkl1[1])-hkl1[1]);
......
...@@ -157,10 +157,7 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS, ...@@ -157,10 +157,7 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
else if (tag == "Date:") else if (tag == "Date:")
date = getWord(in, false); date = getWord(in, false);
tag = getWord(in, false); tag = getWord(in, false);
if (tag == "MOD") m_isModulatedStructure = tag == "MOD";
m_ModStru = true;
else
m_ModStru = false;
readToEndOfLine(in, true); readToEndOfLine(in, true);
// Now we load the instrument using the name and date // Now we load the instrument using the name and date
...@@ -201,7 +198,7 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS, ...@@ -201,7 +198,7 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
if (s == "5") if (s == "5")
det.push_back(bank); det.push_back(bank);
if (s == "9") { if (s == "9") {
m_offset1[0] = qSign * std::stod(getWord(in, false), nullptr); /* m_offset1[0] = qSign * std::stod(getWord(in, false), nullptr);
m_offset1[1] = qSign * std::stod(getWord(in, false), nullptr); m_offset1[1] = qSign * std::stod(getWord(in, false), nullptr);
m_offset1[2] = qSign * std::stod(getWord(in, false), nullptr); m_offset1[2] = qSign * std::stod(getWord(in, false), nullptr);
m_offset2[0] = qSign * std::stod(getWord(in, false), nullptr); m_offset2[0] = qSign * std::stod(getWord(in, false), nullptr);
...@@ -215,7 +212,14 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS, ...@@ -215,7 +212,14 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
outWS->mutableRun().addProperty<std::vector<double>>("Offset2", m_offset2, outWS->mutableRun().addProperty<std::vector<double>>("Offset2", m_offset2,
true); true);
outWS->mutableRun().addProperty<std::vector<double>>("Offset3", m_offset3, outWS->mutableRun().addProperty<std::vector<double>>("Offset3", m_offset3,
true); true);*/
auto run = outWS->mutableRun();
std::string offsetName = "Offset1";
getOffsets(in, run, m_offset1, offsetName, qSign);
offsetName = "Offset1";
getOffsets(in, run, m_offset2, offsetName, qSign);
offsetName = "Offset1";
getOffsets(in, run, m_offset3, offsetName, qSign);
} }
} }
// Find bank numbers in instument that are not in header lines // Find bank numbers in instument that are not in header lines
...@@ -267,6 +271,23 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS, ...@@ -267,6 +271,23 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
return s; return s;
} }
//-----------------------------------------------------------------------------------------------
/** Read offsets and add as property
*
* @param in :: input file stream
* @param run :: mutable run of workspace
* @param m_offset :: vectors of offsets
* @param lablel :: label for property
* @param qSign :: For inelastic this is 1; for crystallography this is -1
* @return void
*/
void LoadIsawPeaks::getOffsets(std::ifstream &in, API::Run &run, std::vector<double> m_offset, std::string &label, double &qSign) {
for (int i=0; i<3; i++)
m_offset.push_back(qSign * std::stod(getWord(in, false), nullptr));
run.addProperty<std::vector<double>>(label, m_offset,
true);
}
//----------------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------------
/** Read one peak in a line of an ISAW peaks file. /** Read one peak in a line of an ISAW peaks file.
* *
...@@ -324,15 +345,15 @@ DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS, ...@@ -324,15 +345,15 @@ DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS,
l = qSign * std::stod(getWord(in, false), nullptr); l = qSign * std::stod(getWord(in, false), nullptr);
V3D mod = V3D(0, 0, 0); V3D mod = V3D(0, 0, 0);
V3D intHKL = V3D(h, k, l); V3D intHKL = V3D(h, k, l);
if (m_ModStru) { if (m_isModulatedStructure) {
mod[0] = qSign * std::stoi(getWord(in, false), nullptr); mod[0] = qSign * std::stoi(getWord(in, false), nullptr);
mod[1] = qSign * std::stoi(getWord(in, false), nullptr); mod[1] = qSign * std::stoi(getWord(in, false), nullptr);
mod[2] = qSign * std::stoi(getWord(in, false), nullptr); mod[2] = qSign * std::stoi(getWord(in, false), nullptr);
double deltaH = auto deltaH =
mod[0] * m_offset1[0] + mod[1] * m_offset2[0] + mod[2] * m_offset3[0]; mod[0] * m_offset1[0] + mod[1] * m_offset2[0] + mod[2] * m_offset3[0];
double deltaK = auto deltaK =
mod[0] * m_offset1[1] + mod[1] * m_offset2[1] + mod[2] * m_offset3[1]; mod[0] * m_offset1[1] + mod[1] * m_offset2[1] + mod[2] * m_offset3[1];
double deltaL = auto deltaL =
mod[0] * m_offset1[2] + mod[1] * m_offset2[2] + mod[2] * m_offset3[2]; mod[0] * m_offset1[2] + mod[1] * m_offset2[2] + mod[2] * m_offset3[2];
h += deltaH; h += deltaH;
...@@ -371,8 +392,8 @@ DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS, ...@@ -371,8 +392,8 @@ DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS,
Peak peak(outWS->getInstrument(), pixelID, wl); Peak peak(outWS->getInstrument(), pixelID, wl);
peak.setHKL(h, k, l); peak.setHKL(h, k, l);
peak.setIntHKL(intHKL); peak.setIntHKL(intHKL);
if (m_ModStru) { if (m_isModulatedStructure) {
peak.setModStru(mod); peak.setModulationVector(mod);
} }
peak.setIntensity(Inti); peak.setIntensity(Inti);
peak.setSigmaIntensity(SigI); peak.setSigmaIntensity(SigI);
......
/* /*
* PredictSatellitePeaks.cpp * PredictSatellitePeaks.cpp
* *
* Created on: Dec 5, 2012 * Created on: July 15, 2018
* Author: ruth * Author: Vickie Lynch
*/ */
#include "MantidCrystal/PredictSatellitePeaks.h" #include "MantidCrystal/PredictSatellitePeaks.h"
#include "MantidAPI/Sample.h" #include "MantidAPI/Sample.h"
...@@ -132,15 +132,15 @@ void PredictSatellitePeaks::exec() { ...@@ -132,15 +132,15 @@ void PredictSatellitePeaks::exec() {
return; return;
} }
API::Sample samp = Peaks->sample(); API::Sample sample = Peaks->sample();
Geometry::OrientedLattice &ol = samp.getOrientedLattice(); const auto &lattice = sample.getOrientedLattice();
Geometry::Instrument_const_sptr Instr = Peaks->getInstrument(); const auto instrument = Peaks->getInstrument();
auto OutPeaks = boost::dynamic_pointer_cast<IPeaksWorkspace>( auto OutPeaks = boost::dynamic_pointer_cast<IPeaksWorkspace>(
WorkspaceFactory::Instance().createPeaks()); WorkspaceFactory::Instance().createPeaks());
OutPeaks->setInstrument(Instr); OutPeaks->setInstrument(instrument);
OutPeaks->mutableRun().addProperty<std::vector<double>>("Offset1", offsets1, OutPeaks->mutableRun().addProperty<std::vector<double>>("Offset1", offsets1,
true); true);
OutPeaks->mutableRun().addProperty<std::vector<double>>("Offset2", offsets2, OutPeaks->mutableRun().addProperty<std::vector<double>>("Offset2", offsets2,
...@@ -151,8 +151,8 @@ void PredictSatellitePeaks::exec() { ...@@ -151,8 +151,8 @@ void PredictSatellitePeaks::exec() {
V3D hkl; V3D hkl;
int peakNum = 0; int peakNum = 0;
const auto NPeaks = Peaks->getNumberPeaks(); const auto NPeaks = Peaks->getNumberPeaks();
Kernel::Matrix<double> Gon; Kernel::Matrix<double> goniometer;
Gon.identityMatrix(); goniometer.identityMatrix();
const double lambdaMin = getProperty("WavelengthMin"); const double lambdaMin = getProperty("WavelengthMin");
const double lambdaMax = getProperty("WavelengthMax"); const double lambdaMax = getProperty("WavelengthMax");
...@@ -162,8 +162,8 @@ void PredictSatellitePeaks::exec() { ...@@ -162,8 +162,8 @@ void PredictSatellitePeaks::exec() {
if (includePeaksInRange) { if (includePeaksInRange) {
const double dMin = getProperty("MinDSpacing"); const double dMin = getProperty("MinDSpacing");
const double dMax = getProperty("MaxDSpacing"); const double dMax = getProperty("MaxDSpacing");
Geometry::HKLGenerator gen(ol, dMin); Geometry::HKLGenerator gen(lattice, dMin);
auto filter = boost::make_shared<HKLFilterDRange>(ol, dMin, dMax); auto filter = boost::make_shared<HKLFilterDRange>(lattice, dMin, dMax);
V3D hkl = *(gen.begin()); V3D hkl = *(gen.begin());
g_log.information() << "HKL range for d_min of " << dMin << " to d_max of " g_log.information() << "HKL range for d_min of " << dMin << " to d_max of "
...@@ -189,14 +189,14 @@ void PredictSatellitePeaks::exec() { ...@@ -189,14 +189,14 @@ void PredictSatellitePeaks::exec() {
N = max<size_t>(100, N); N = max<size_t>(100, N);
} }
auto RunNumber = peak0.getRunNumber(); auto RunNumber = peak0.getRunNumber();
const Kernel::DblMatrix &UB = ol.getUB(); auto &UB = lattice.getUB();
Gon = peak0.getGoniometerMatrix(); goniometer = peak0.getGoniometerMatrix();
Progress prog(this, 0.0, 1.0, N); Progress prog(this, 0.0, 1.0, N);
vector<vector<int>> AlreadyDonePeaks; vector<vector<int>> AlreadyDonePeaks;
bool done = false; bool done = false;
int ErrPos = 1; // Used to determine position in code of a throw int ErrPos = 1; // Used to determine position in code of a throw
Geometry::InstrumentRayTracer tracer(Peaks->getInstrument()); Geometry::InstrumentRayTracer tracer(Peaks->getInstrument());
DblMatrix orientedUB = Gon * UB; DblMatrix orientedUB = goniometer * UB;
HKLFilterWavelength lambdaFilter(orientedUB, lambdaMin, lambdaMax); HKLFilterWavelength lambdaFilter(orientedUB, lambdaMin, lambdaMax);
int seqNum = 0; int seqNum = 0;
size_t next = 0; size_t next = 0;
...@@ -214,18 +214,16 @@ void PredictSatellitePeaks::exec() { ...@@ -214,18 +214,16 @@ void PredictSatellitePeaks::exec() {
if (!lambdaFilter.isAllowed(hkl1) && includePeaksInRange) if (!lambdaFilter.isAllowed(hkl1) && includePeaksInRange)
continue; continue;
Kernel::V3D Qs = UB * hkl1; Kernel::V3D Qs = goniometer * UB * hkl1 * 2.0 * M_PI;
Qs *= 2.0;
Qs *= M_PI;
Qs = Gon * Qs;
if (Qs[2] <= 0) if (Qs[2] <= 0)
continue; continue;
ErrPos = 1; ErrPos = 1;
boost::shared_ptr<IPeak> peak(Peaks->createPeak(Qs, 1)); auto peak(Peaks->createPeak(Qs, 1));
peak->setGoniometerMatrix(Gon); peak->setGoniometerMatrix(goniometer);
if (Qs[2] > 0 && peak->findDetector(tracer)) { if (Qs[2] > 0 && peak->findDetector(tracer)) {
ErrPos = 2; ErrPos = 2;
...@@ -247,10 +245,10 @@ void PredictSatellitePeaks::exec() { ...@@ -247,10 +245,10 @@ void PredictSatellitePeaks::exec() {
peak->setPeakNumber(seqNum); peak->setPeakNumber(seqNum);
seqNum++; seqNum++;
peak->setRunNumber(RunNumber); peak->setRunNumber(RunNumber);
peak->setModStru(V3D(order, 0, 0)); peak->setModulationVector(V3D(order, 0, 0));
OutPeaks->addPeak(*peak); OutPeaks->addPeak(*peak);
} }
} catch (...) { } catch (std::runtime_error &) {
if (ErrPos != 1) // setQLabFrame in createPeak throws exception if (ErrPos != 1) // setQLabFrame in createPeak throws exception
throw std::invalid_argument("Invalid data at this point"); throw std::invalid_argument("Invalid data at this point");
} }
...@@ -266,10 +264,7 @@ void PredictSatellitePeaks::exec() { ...@@ -266,10 +264,7 @@ void PredictSatellitePeaks::exec() {
hkl1[1] += order * offsets2[1]; hkl1[1] += order * offsets2[1];
hkl1[2] += order * offsets2[2]; hkl1[2] += order * offsets2[2];
Kernel::V3D Qs = UB * hkl1; Kernel::V3D Qs = goniometer * UB * hkl1 * 2.0 * M_PI;
Qs *= 2.0;
Qs *= M_PI;
Qs = Gon * Qs;
if (Qs[2] <= 0) if (Qs[2] <= 0)
continue; continue;
...@@ -277,7 +272,7 @@ void PredictSatellitePeaks::exec() { ...@@ -277,7 +272,7 @@ void PredictSatellitePeaks::exec() {
boost::shared_ptr<IPeak> peak(Peaks->createPeak(Qs, 1)); boost::shared_ptr<IPeak> peak(Peaks->createPeak(Qs, 1));
peak->setGoniometerMatrix(Gon); peak->setGoniometerMatrix(goniometer);
if (Qs[2] > 0 && peak->findDetector(tracer)) { if (Qs[2] > 0 && peak->findDetector(tracer)) {
ErrPos = 2; ErrPos = 2;
...@@ -298,10 +293,10 @@ void PredictSatellitePeaks::exec() { ...@@ -298,10 +293,10 @@ void PredictSatellitePeaks::exec() {
peak->setPeakNumber(seqNum); peak->setPeakNumber(seqNum);
seqNum++; seqNum++;
peak->setRunNumber(RunNumber); peak->setRunNumber(RunNumber);
peak->setModStru(V3D(0, order, 0)); peak->setModulationVector(V3D(0, order, 0));
OutPeaks->addPeak(*peak); OutPeaks->addPeak(*peak);
} }
} catch (...) { } catch (std::runtime_error &) {
if (ErrPos != 1) // setQLabFrame in createPeak throws exception if (ErrPos != 1) // setQLabFrame in createPeak throws exception
throw std::invalid_argument("Invalid data at this point"); throw std::invalid_argument("Invalid data at this point");
} }
...@@ -317,10 +312,7 @@ void PredictSatellitePeaks::exec() { ...@@ -317,10 +312,7 @@ void PredictSatellitePeaks::exec() {
hkl1[1] += order * offsets3[1]; hkl1[1] += order * offsets3[1];
hkl1[2] += order * offsets3[2]; hkl1[2] += order * offsets3[2];
Kernel::V3D Qs = UB * hkl1; Kernel::V3D Qs = goniometer * UB * hkl1 * 2.0 * M_PI;
Qs *= 2.0;
Qs *= M_PI;
Qs = Gon * Qs;
if (Qs[2] <= 0) if (Qs[2] <= 0)
continue; continue;
...@@ -328,7 +320,7 @@ void PredictSatellitePeaks::exec() { ...@@ -328,7 +320,7 @@ void PredictSatellitePeaks::exec() {
boost::shared_ptr<IPeak> peak(Peaks->createPeak(Qs, 1)); boost::shared_ptr<IPeak> peak(Peaks->createPeak(Qs, 1));
peak->setGoniometerMatrix(Gon); peak->setGoniometerMatrix(goniometer);
if (Qs[2] > 0 && peak->findDetector(tracer)) { if (Qs[2] > 0 && peak->findDetector(tracer)) {
ErrPos = 2; ErrPos = 2;
...@@ -349,10 +341,10 @@ void PredictSatellitePeaks::exec() { ...@@ -349,10 +341,10 @@ void PredictSatellitePeaks::exec() {
peak->setPeakNumber(seqNum); peak->setPeakNumber(seqNum);
seqNum++; seqNum++;
peak->setRunNumber(RunNumber); peak->setRunNumber(RunNumber);
peak->setModStru(V3D(0, 0, order)); peak->setModulationVector(V3D(0, 0, order));
OutPeaks->addPeak(*peak); OutPeaks->addPeak(*peak);
} }
} catch (...) { } catch (std::runtime_error &) {
if (ErrPos != 1) // setQLabFrame in createPeak throws exception if (ErrPos != 1) // setQLabFrame in createPeak throws exception
throw std::invalid_argument("Invalid data at this point"); throw std::invalid_argument("Invalid data at this point");
} }
...@@ -373,7 +365,7 @@ void PredictSatellitePeaks::exec() { ...@@ -373,7 +365,7 @@ void PredictSatellitePeaks::exec() {
hkl[0] = peak1.getH(); hkl[0] = peak1.getH();
hkl[1] = peak1.getK(); hkl[1] = peak1.getK();
hkl[2] = peak1.getL(); hkl[2] = peak1.getL();
Gon = peak1.getGoniometerMatrix(); goniometer = peak1.getGoniometerMatrix();
RunNumber = peak1.getRunNumber(); RunNumber = peak1.getRunNumber();
} }
} }
......
...@@ -94,8 +94,8 @@ void SaveIsawPeaks::exec() { ...@@ -94,8 +94,8 @@ void SaveIsawPeaks::exec() {
runMap_t runMap; runMap_t runMap;
for (size_t i = 0; i < peaks.size(); ++i) { for (size_t i = 0; i < peaks.size(); ++i) {
Peak &p = peaks[i]; Peak &p = peaks[i];
if (p.getModStru() != V3D(0, 0, 0)) if (p.getModulationVector() != V3D(0, 0, 0))
m_ModStru = true; m_isModulatedStructure = true;
int run = p.getRunNumber(); int run = p.getRunNumber();
int bank = 0; int bank = 0;
std::string bankName = p.getBankName(); std::string bankName = p.getBankName();
...@@ -117,7 +117,7 @@ void SaveIsawPeaks::exec() { ...@@ -117,7 +117,7 @@ void SaveIsawPeaks::exec() {
// Save in the map // Save in the map
runMap[run][bank].push_back(i); runMap[run][bank].push_back(i);
} }
if (m_ModStru) if (m_isModulatedStructure)
header = header =
"2 SEQN H K L M N P COL ROW CHAN " "2 SEQN H K L M N P COL ROW CHAN "
" L2 2_THETA AZ WL D IPK " " L2 2_THETA AZ WL D IPK "
...@@ -160,7 +160,7 @@ void SaveIsawPeaks::exec() { ...@@ -160,7 +160,7 @@ void SaveIsawPeaks::exec() {
// saving. // saving.
Types::Core::DateAndTime expDate = inst->getValidFromDate() + 1.0; Types::Core::DateAndTime expDate = inst->getValidFromDate() + 1.0;
out << expDate.toISO8601String(); out << expDate.toISO8601String();
if (m_ModStru) if (m_isModulatedStructure)
out << " MOD"; out << " MOD";
out << '\n'; out << '\n';
...@@ -272,7 +272,7 @@ void SaveIsawPeaks::exec() { ...@@ -272,7 +272,7 @@ void SaveIsawPeaks::exec() {
// Go in order of run numbers // Go in order of run numbers
std::vector<double> offset1, offset2, offset3; std::vector<double> offset1, offset2, offset3;
if (m_ModStru) { if (m_isModulatedStructure) {
auto run = ws->mutableRun(); auto run = ws->mutableRun();
offset1 = run.getPropertyValueAsType<std::vector<double>>("Offset1"); offset1 = run.getPropertyValueAsType<std::vector<double>>("Offset1");
offset2 = run.getPropertyValueAsType<std::vector<double>>("Offset2"); offset2 = run.getPropertyValueAsType<std::vector<double>>("Offset2");
...@@ -352,8 +352,8 @@ void SaveIsawPeaks::exec() { ...@@ -352,8 +352,8 @@ void SaveIsawPeaks::exec() {
// HKL's are flipped by -1 because of the internal Q convention // HKL's are flipped by -1 because of the internal Q convention
// unless Crystallography convention // unless Crystallography convention
if (m_ModStru) { if (m_isModulatedStructure) {
V3D mod = p.getModStru(); V3D mod = p.getModulationVector();
auto intHKL = p.getIntHKL(); auto intHKL = p.getIntHKL();
out << std::setw(5) << Utils::round(qSign * intHKL.X()) out << std::setw(5) << Utils::round(qSign * intHKL.X())
<< std::setw(5) << Utils::round(qSign * intHKL.Y()) << std::setw(5) << Utils::round(qSign * intHKL.Y())
......
...@@ -80,23 +80,20 @@ public: ...@@ -80,23 +80,20 @@ public:
TS_ASSERT_EQUALS(SatellitePeaks->getNumberPeaks(), 122); TS_ASSERT_EQUALS(SatellitePeaks->getNumberPeaks(), 122);
Peak &peakx = dynamic_cast<Peak &>(SatellitePeaks->getPeak(0)); auto &peak0 = SatellitePeaks->getPeak(0);
Peak peak = peakx; TS_ASSERT_DELTA(peak0.getH(), -5.5, .0001);
TS_ASSERT_DELTA(peak.getH(), -5.5, .0001); TS_ASSERT_DELTA(peak0.getK(), 7.0, .0001);
TS_ASSERT_DELTA(peak.getK(), 7.0, .0001);</