Commit 27e5bd91 authored by Ian Bush's avatar Ian Bush
Browse files

Refs #17065 Renamed LoadILLINX to LoadILLTOF

parent ee119a2e
......@@ -55,7 +55,7 @@ set ( SRC_FILES
src/LoadIDFFromNexus.cpp
src/LoadILL.cpp
src/LoadILLIndirect.cpp
src/LoadILLINX.cpp
src/LoadILLTOF.cpp
src/LoadILLReflectometry.cpp
src/LoadILLSANS.cpp
src/LoadISISNexus2.cpp
......@@ -233,7 +233,7 @@ set ( INC_FILES
inc/MantidDataHandling/LoadIDFFromNexus.h
inc/MantidDataHandling/LoadILL.h
inc/MantidDataHandling/LoadILLIndirect.h
inc/MantidDataHandling/LoadILLINX.h
inc/MantidDataHandling/LoadILLTOF.h
inc/MantidDataHandling/LoadILLReflectometry.h
inc/MantidDataHandling/LoadILLSANS.h
inc/MantidDataHandling/LoadISISNexus2.h
......@@ -404,7 +404,7 @@ set ( TEST_FILES
LoadGSSTest.h
LoadIDFFromNexusTest.h
LoadILLIndirectTest.h
LoadILLINXTest.h
LoadILLTOFTest.h
LoadILLReflectometryTest.h
LoadILLSANSTest.h
LoadISISNexusTest.h
......
......@@ -5,7 +5,7 @@
#include "MantidNexus/NexusClasses.h"
#include "MantidDataHandling/LoadHelper.h"
#include "MantidAPI/DeprecatedAlgorithm.h"
#include "MantidDataHandling/LoadILLINX.h"
#include "MantidDataHandling/LoadILLTOF.h"
namespace Mantid {
namespace DataHandling {
......@@ -33,7 +33,7 @@ namespace DataHandling {
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport LoadILL : public LoadILLINX, public API::DeprecatedAlgorithm {
class DLLExport LoadILL : public LoadILLTOF, public API::DeprecatedAlgorithm {
public:
/// Constructor
LoadILL();
......
#ifndef MANTID_DATAHANDLING_LOADILLINX_H_
#define MANTID_DATAHANDLING_LOADILLINX_H_
#ifndef MANTID_DATAHANDLING_LOADILLTOF_H_
#define MANTID_DATAHANDLING_LOADILLTOF_H_
//---------------------------------------------------
// Includes
......@@ -34,12 +34,12 @@ namespace DataHandling {
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport LoadILLINX : public API::IFileLoader<Kernel::NexusDescriptor> {
class DLLExport LoadILLTOF : public API::IFileLoader<Kernel::NexusDescriptor> {
public:
/// Constructor
LoadILLINX();
LoadILLTOF();
/// Algorithm's name
const std::string name() const override { return "LoadILLINX"; }
const std::string name() const override { return "LoadILLTOF"; }
/// Summary of algorithms purpose
const std::string summary() const override {
return "Loads an ILL ToF NeXus file.";
......@@ -111,4 +111,4 @@ private:
} // namespace DataHandling
} // namespace Mantid
#endif /*MANTID_DATAHANDLING_LoadILLINX_H_*/
#endif /*MANTID_DATAHANDLING_LOADILLTOF_H_*/
......@@ -10,7 +10,7 @@ namespace DataHandling {
DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILL)
/// Constructor
LoadILL::LoadILL() : LoadILLINX() { this->useAlgorithm("LoadILLINX", 1); }
LoadILL::LoadILL() : LoadILLTOF() { this->useAlgorithm("LoadILLTOF", 1); }
/**
* Return the confidence with with this algorithm can load the file
......
//---------------------------------------------------
// Includes
//---------------------------------------------------
#include "MantidDataHandling/LoadILLINX.h"
#include "MantidDataHandling/LoadILLTOF.h"
#include "MantidAPI/Axis.h"
#include "MantidAPI/FileProperty.h"
......@@ -18,7 +18,7 @@ using namespace Kernel;
using namespace API;
using namespace NeXus;
DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLINX)
DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLTOF)
//---------------------------------------------------
// Private member functions
......@@ -30,7 +30,7 @@ DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLINX)
* @returns An integer specifying the confidence level. 0 indicates it will not
* be used
*/
int LoadILLINX::confidence(Kernel::NexusDescriptor &descriptor) const {
int LoadILLTOF::confidence(Kernel::NexusDescriptor &descriptor) const {
// fields existent only at the ILL
if (descriptor.pathExists("/entry0/wavelength") &&
......@@ -49,7 +49,7 @@ int LoadILLINX::confidence(Kernel::NexusDescriptor &descriptor) const {
}
}
LoadILLINX::LoadILLINX() : API::IFileLoader<Kernel::NexusDescriptor>() {
LoadILLTOF::LoadILLTOF() : API::IFileLoader<Kernel::NexusDescriptor>() {
m_instrumentName = "";
m_wavelength = 0;
m_channelWidth = 0;
......@@ -68,7 +68,7 @@ LoadILLINX::LoadILLINX() : API::IFileLoader<Kernel::NexusDescriptor>() {
/**
* Initialise the algorithm
*/
void LoadILLINX::init() {
void LoadILLTOF::init() {
declareProperty(
make_unique<FileProperty>("Filename", "", FileProperty::Load, ".nxs"),
"File path of the Data file to load");
......@@ -90,7 +90,7 @@ void LoadILLINX::init() {
/**
* Execute the algorithm
*/
void LoadILLINX::exec() {
void LoadILLTOF::exec() {
// Retrieve filename
std::string filenameData = getPropertyValue("Filename");
std::string filenameVanadium = getPropertyValue("FilenameVanadium");
......@@ -132,7 +132,7 @@ void LoadILLINX::exec() {
* @return : list of monitor data
*/
std::vector<std::vector<int>>
LoadILLINX::getMonitorInfo(NeXus::NXEntry &firstEntry) {
LoadILLTOF::getMonitorInfo(NeXus::NXEntry &firstEntry) {
std::vector<std::vector<int>> monitorList;
......@@ -162,7 +162,7 @@ LoadILLINX::getMonitorInfo(NeXus::NXEntry &firstEntry) {
* or filename.
* @return the EPP
*/
int LoadILLINX::getEPPFromVanadium(const std::string &filenameVanadium,
int LoadILLTOF::getEPPFromVanadium(const std::string &filenameVanadium,
MatrixWorkspace_sptr vanaWS) {
int calculatedDetectorElasticPeakPosition = -1;
......@@ -191,7 +191,7 @@ int LoadILLINX::getEPPFromVanadium(const std::string &filenameVanadium,
/**
* Set the instrument name along with its path on the nexus file
*/
void LoadILLINX::loadInstrumentDetails(NeXus::NXEntry &firstEntry) {
void LoadILLTOF::loadInstrumentDetails(NeXus::NXEntry &firstEntry) {
m_instrumentPath = m_loader.findInstrumentNexusPath(firstEntry);
......@@ -221,7 +221,7 @@ void LoadILLINX::loadInstrumentDetails(NeXus::NXEntry &firstEntry) {
* @param monitors :: list of monitors content
*
*/
void LoadILLINX::initWorkSpace(NeXus::NXEntry &entry,
void LoadILLTOF::initWorkSpace(NeXus::NXEntry &entry,
const std::vector<std::vector<int>> &monitors) {
// read in the data
......@@ -267,7 +267,7 @@ void LoadILLINX::initWorkSpace(NeXus::NXEntry &entry,
* Function to do specific instrument stuff
*
*/
void LoadILLINX::initInstrumentSpecific() {
void LoadILLTOF::initInstrumentSpecific() {
m_l1 = m_loader.getL1(m_localWorkspace);
// this will be mainly for IN5 (flat PSD detector)
m_l2 = m_loader.getInstrumentProperty(m_localWorkspace, "l2");
......@@ -281,7 +281,7 @@ void LoadILLINX::initInstrumentSpecific() {
* Load the time details from the nexus file.
* @param entry :: The Nexus entry
*/
void LoadILLINX::loadTimeDetails(NeXus::NXEntry &entry) {
void LoadILLTOF::loadTimeDetails(NeXus::NXEntry &entry) {
m_wavelength = entry.getFloat("wavelength");
......@@ -320,7 +320,7 @@ void LoadILLINX::loadTimeDetails(NeXus::NXEntry &entry) {
* as parameters in the workspace
* @param filename :: NeXus file
*/
void LoadILLINX::addAllNexusFieldsAsProperties(std::string filename) {
void LoadILLTOF::addAllNexusFieldsAsProperties(std::string filename) {
API::Run &runDetails = m_localWorkspace->mutableRun();
......@@ -345,7 +345,7 @@ void LoadILLINX::addAllNexusFieldsAsProperties(std::string filename) {
* Calculates the Energy from the wavelength and adds
* it at property Ei
*/
void LoadILLINX::addEnergyToRun() {
void LoadILLTOF::addEnergyToRun() {
API::Run &runDetails = m_localWorkspace->mutableRun();
double ei = m_loader.calculateEnergy(m_wavelength);
......@@ -362,7 +362,7 @@ void LoadILLINX::addEnergyToRun() {
* @param data :: spectra data
* @return detector Elastic Peak Position
*/
int LoadILLINX::getDetectorElasticPeakPosition(const NeXus::NXInt &data) {
int LoadILLTOF::getDetectorElasticPeakPosition(const NeXus::NXInt &data) {
// j = index in the equatorial line (256/2=128)
// both index 127 and 128 are in the equatorial line
......@@ -420,7 +420,7 @@ int LoadILLINX::getDetectorElasticPeakPosition(const NeXus::NXInt &data) {
* @param filenameVanadium :: The path for the vanadium nexus file.
* @return The elastic peak position inside the tof channels.
*/
int LoadILLINX::validateVanadium(const std::string &filenameVanadium) {
int LoadILLTOF::validateVanadium(const std::string &filenameVanadium) {
NeXus::NXRoot vanaRoot(filenameVanadium);
NXEntry vanaFirstEntry = vanaRoot.openFirstEntry();
......@@ -456,7 +456,7 @@ int LoadILLINX::validateVanadium(const std::string &filenameVanadium) {
*the elastic peak position at the detector.
*
*/
void LoadILLINX::loadDataIntoTheWorkSpace(
void LoadILLTOF::loadDataIntoTheWorkSpace(
NeXus::NXEntry &entry, const std::vector<std::vector<int>> &monitors,
int vanaCalculatedDetectorElasticPeakPosition) {
......@@ -517,7 +517,7 @@ void LoadILLINX::loadDataIntoTheWorkSpace(
// Assign Error
MantidVec &E = m_localWorkspace->dataE(spec);
std::transform(monitor.begin(), monitor.end(), E.begin(),
LoadILLINX::calculateError);
LoadILLTOF::calculateError);
m_localWorkspace->getSpectrum(spec).setDetectorID(monitorIDs[spec]);
++spec;
}
......@@ -544,7 +544,7 @@ void LoadILLINX::loadDataIntoTheWorkSpace(
// Assign Error
MantidVec &E = m_localWorkspace->dataE(spec);
std::transform(data_p, data_p + m_numberOfChannels, E.begin(),
LoadILLINX::calculateError);
LoadILLTOF::calculateError);
m_localWorkspace->getSpectrum(spec)
.setDetectorID(detectorIDs[spec - numberOfMonitors]);
++spec;
......@@ -582,7 +582,7 @@ void LoadILLINX::loadDataIntoTheWorkSpace(
// Assign Error
MantidVec &E = m_localWorkspace->dataE(spec);
std::transform(data_p, data_p + m_numberOfChannels, E.begin(),
LoadILLINX::calculateError);
LoadILLTOF::calculateError);
++spec;
progressRosace.report();
......@@ -594,7 +594,7 @@ void LoadILLINX::loadDataIntoTheWorkSpace(
/**
* Run the Child Algorithm LoadInstrument.
*/
void LoadILLINX::runLoadInstrument() {
void LoadILLTOF::runLoadInstrument() {
IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument");
......
#ifndef LOADILLINXTEST_H_
#define LOADILLINXTEST_H_
#ifndef LOADILLTOFTEST_H_
#define LOADILLTOFTEST_H_
#include <cxxtest/TestSuite.h>
#include "MantidDataHandling/LoadILLINX.h"
#include "MantidDataHandling/LoadILLTOF.h"
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/MatrixWorkspace.h"
using namespace Mantid::API;
using Mantid::DataHandling::LoadILLINX;
using Mantid::DataHandling::LoadILLTOF;
class LoadILLINXTest : public CxxTest::TestSuite {
class LoadILLTOFTest : public CxxTest::TestSuite {
public:
// This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests
static LoadILLINXTest *createSuite() { return new LoadILLINXTest(); }
static void destroySuite(LoadILLINXTest *suite) { delete suite; }
static LoadILLTOFTest *createSuite() { return new LoadILLTOFTest(); }
static void destroySuite(LoadILLTOFTest *suite) { delete suite; }
void testName() {
LoadILLINX loader;
TS_ASSERT_EQUALS(loader.name(), "LoadILLINX");
LoadILLTOF loader;
TS_ASSERT_EQUALS(loader.name(), "LoadILLTOF");
}
void testVersion() {
LoadILLINX loader;
LoadILLTOF loader;
TS_ASSERT_EQUALS(loader.version(), 1);
}
void testInit() {
LoadILLINX loader;
LoadILLTOF loader;
TS_ASSERT_THROWS_NOTHING(loader.initialize());
TS_ASSERT(loader.isInitialized());
}
......@@ -37,11 +37,11 @@ public:
* The elastic peak is obtained on the fly from the sample data.
*/
void loadDataFile(const std::string dataFile, const int numberOfHistograms) {
LoadILLINX loader;
LoadILLTOF loader;
loader.initialize();
loader.setPropertyValue("Filename", dataFile);
std::string outputSpace = "LoadILLINXTest_out";
std::string outputSpace = "LoadILLTOFTest_out";
loader.setPropertyValue("OutputWorkspace", outputSpace);
TS_ASSERT_THROWS_NOTHING(loader.execute());
......@@ -65,12 +65,12 @@ public:
// Performance test
//------------------------------------------------------------------------------
class LoadILLINXTestPerformance : public CxxTest::TestSuite {
class LoadILLTOFTestPerformance : public CxxTest::TestSuite {
public:
LoadILLINXTestPerformance() : m_dataFile("ILL/IN5/104007.nxs") {}
LoadILLTOFTestPerformance() : m_dataFile("ILL/IN5/104007.nxs") {}
void testDefaultLoad() {
Mantid::DataHandling::LoadILLINX loader;
Mantid::DataHandling::LoadILLTOF loader;
loader.initialize();
loader.setPropertyValue("Filename", m_dataFile);
loader.setPropertyValue("OutputWorkspace", "ws");
......@@ -81,4 +81,4 @@ private:
std::string m_dataFile;
};
#endif /*LoadILLINXTEST_H_*/
#endif /*LOADILLTOFTEST_H_*/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment