Commit 9e488389 authored by Ian Bush's avatar Ian Bush
Browse files

Refs #17065 Renamed LoadILL to LoadILLINX

parent 9cd07a21
...@@ -51,7 +51,7 @@ set ( SRC_FILES ...@@ -51,7 +51,7 @@ set ( SRC_FILES
src/LoadGSS.cpp src/LoadGSS.cpp
src/LoadHelper.cpp src/LoadHelper.cpp
src/LoadIDFFromNexus.cpp src/LoadIDFFromNexus.cpp
src/LoadILL.cpp src/LoadILLINX.cpp
src/LoadILLIndirect.cpp src/LoadILLIndirect.cpp
src/LoadILLReflectometry.cpp src/LoadILLReflectometry.cpp
src/LoadILLSANS.cpp src/LoadILLSANS.cpp
...@@ -225,7 +225,7 @@ set ( INC_FILES ...@@ -225,7 +225,7 @@ set ( INC_FILES
inc/MantidDataHandling/LoadGSS.h inc/MantidDataHandling/LoadGSS.h
inc/MantidDataHandling/LoadHelper.h inc/MantidDataHandling/LoadHelper.h
inc/MantidDataHandling/LoadIDFFromNexus.h inc/MantidDataHandling/LoadIDFFromNexus.h
inc/MantidDataHandling/LoadILL.h inc/MantidDataHandling/LoadILLINX.h
inc/MantidDataHandling/LoadILLIndirect.h inc/MantidDataHandling/LoadILLIndirect.h
inc/MantidDataHandling/LoadILLReflectometry.h inc/MantidDataHandling/LoadILLReflectometry.h
inc/MantidDataHandling/LoadILLSANS.h inc/MantidDataHandling/LoadILLSANS.h
...@@ -398,7 +398,7 @@ set ( TEST_FILES ...@@ -398,7 +398,7 @@ set ( TEST_FILES
LoadILLIndirectTest.h LoadILLIndirectTest.h
LoadILLReflectometryTest.h LoadILLReflectometryTest.h
LoadILLSANSTest.h LoadILLSANSTest.h
LoadILLTest.h LoadILLINXTest.h
LoadISISNexusTest.h LoadISISNexusTest.h
LoadInstrumentFromRawTest.h LoadInstrumentFromRawTest.h
LoadInstrumentTest.h LoadInstrumentTest.h
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
namespace Mantid { namespace Mantid {
namespace DataHandling { namespace DataHandling {
/** /**
Loads an ILL nexus file into a Mantid workspace. Loads an ILL IN4/5/6 nexus file into a Mantid workspace.
Copyright © 2010 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge Copyright © 2010 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source National Laboratory & European Spallation Source
...@@ -34,12 +34,12 @@ namespace DataHandling { ...@@ -34,12 +34,12 @@ namespace DataHandling {
File change history is stored at: <https://github.com/mantidproject/mantid> File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org> Code Documentation is available at: <http://doxygen.mantidproject.org>
*/ */
class DLLExport LoadILL : public API::IFileLoader<Kernel::NexusDescriptor> { class DLLExport LoadILLINX : public API::IFileLoader<Kernel::NexusDescriptor> {
public: public:
/// Constructor /// Constructor
LoadILL(); LoadILLINX();
/// Algorithm's name /// Algorithm's name
const std::string name() const override { return "LoadILL"; } const std::string name() const override { return "LoadILLINX"; }
/// Summary of algorithms purpose /// Summary of algorithms purpose
const std::string summary() const override { const std::string summary() const override {
return "Loads a ILL nexus file."; return "Loads a ILL nexus file.";
......
//--------------------------------------------------- //---------------------------------------------------
// Includes // Includes
//--------------------------------------------------- //---------------------------------------------------
#include "MantidDataHandling/LoadILL.h" #include "MantidDataHandling/LoadILLINX.h"
#include "MantidDataHandling/LoadHelper.h" #include "MantidDataHandling/LoadHelper.h"
#include "MantidAPI/Axis.h" #include "MantidAPI/Axis.h"
...@@ -28,7 +28,7 @@ using namespace Kernel; ...@@ -28,7 +28,7 @@ using namespace Kernel;
using namespace API; using namespace API;
using namespace NeXus; using namespace NeXus;
DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILL) DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILLINX)
//--------------------------------------------------- //---------------------------------------------------
// Private member functions // Private member functions
...@@ -40,7 +40,7 @@ DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILL) ...@@ -40,7 +40,7 @@ DECLARE_NEXUS_FILELOADER_ALGORITHM(LoadILL)
* @returns An integer specifying the confidence level. 0 indicates it will not * @returns An integer specifying the confidence level. 0 indicates it will not
* be used * be used
*/ */
int LoadILL::confidence(Kernel::NexusDescriptor &descriptor) const { int LoadILLINX::confidence(Kernel::NexusDescriptor &descriptor) const {
// fields existent only at the ILL // fields existent only at the ILL
if (descriptor.pathExists("/entry0/wavelength") && if (descriptor.pathExists("/entry0/wavelength") &&
...@@ -59,7 +59,7 @@ int LoadILL::confidence(Kernel::NexusDescriptor &descriptor) const { ...@@ -59,7 +59,7 @@ int LoadILL::confidence(Kernel::NexusDescriptor &descriptor) const {
} }
} }
LoadILL::LoadILL() : API::IFileLoader<Kernel::NexusDescriptor>() { LoadILLINX::LoadILLINX() : API::IFileLoader<Kernel::NexusDescriptor>() {
m_instrumentName = ""; m_instrumentName = "";
m_wavelength = 0; m_wavelength = 0;
m_channelWidth = 0; m_channelWidth = 0;
...@@ -78,7 +78,7 @@ LoadILL::LoadILL() : API::IFileLoader<Kernel::NexusDescriptor>() { ...@@ -78,7 +78,7 @@ LoadILL::LoadILL() : API::IFileLoader<Kernel::NexusDescriptor>() {
/** /**
* Initialise the algorithm * Initialise the algorithm
*/ */
void LoadILL::init() { void LoadILLINX::init() {
declareProperty( declareProperty(
make_unique<FileProperty>("Filename", "", FileProperty::Load, ".nxs"), make_unique<FileProperty>("Filename", "", FileProperty::Load, ".nxs"),
"File path of the Data file to load"); "File path of the Data file to load");
...@@ -100,7 +100,7 @@ void LoadILL::init() { ...@@ -100,7 +100,7 @@ void LoadILL::init() {
/** /**
* Execute the algorithm * Execute the algorithm
*/ */
void LoadILL::exec() { void LoadILLINX::exec() {
// Retrieve filename // Retrieve filename
std::string filenameData = getPropertyValue("Filename"); std::string filenameData = getPropertyValue("Filename");
std::string filenameVanadium = getPropertyValue("FilenameVanadium"); std::string filenameVanadium = getPropertyValue("FilenameVanadium");
...@@ -147,7 +147,7 @@ void LoadILL::exec() { ...@@ -147,7 +147,7 @@ void LoadILL::exec() {
* @return : list of monitor data * @return : list of monitor data
*/ */
std::vector<std::vector<int>> std::vector<std::vector<int>>
LoadILL::getMonitorInfo(NeXus::NXEntry &firstEntry) { LoadILLINX::getMonitorInfo(NeXus::NXEntry &firstEntry) {
std::vector<std::vector<int>> monitorList; std::vector<std::vector<int>> monitorList;
...@@ -177,7 +177,7 @@ LoadILL::getMonitorInfo(NeXus::NXEntry &firstEntry) { ...@@ -177,7 +177,7 @@ LoadILL::getMonitorInfo(NeXus::NXEntry &firstEntry) {
* or filename. * or filename.
* @return the EPP * @return the EPP
*/ */
int LoadILL::getEPPFromVanadium(const std::string &filenameVanadium, int LoadILLINX::getEPPFromVanadium(const std::string &filenameVanadium,
MatrixWorkspace_sptr vanaWS) { MatrixWorkspace_sptr vanaWS) {
int calculatedDetectorElasticPeakPosition = -1; int calculatedDetectorElasticPeakPosition = -1;
...@@ -206,7 +206,7 @@ int LoadILL::getEPPFromVanadium(const std::string &filenameVanadium, ...@@ -206,7 +206,7 @@ int LoadILL::getEPPFromVanadium(const std::string &filenameVanadium,
/** /**
* Set the instrument name along with its path on the nexus file * Set the instrument name along with its path on the nexus file
*/ */
void LoadILL::loadInstrumentDetails(NeXus::NXEntry &firstEntry) { void LoadILLINX::loadInstrumentDetails(NeXus::NXEntry &firstEntry) {
m_instrumentPath = m_loader.findInstrumentNexusPath(firstEntry); m_instrumentPath = m_loader.findInstrumentNexusPath(firstEntry);
...@@ -236,7 +236,7 @@ void LoadILL::loadInstrumentDetails(NeXus::NXEntry &firstEntry) { ...@@ -236,7 +236,7 @@ void LoadILL::loadInstrumentDetails(NeXus::NXEntry &firstEntry) {
* @param monitors :: list of monitors content * @param monitors :: list of monitors content
* *
*/ */
void LoadILL::initWorkSpace(NeXus::NXEntry &entry, void LoadILLINX::initWorkSpace(NeXus::NXEntry &entry,
const std::vector<std::vector<int>> &monitors) { const std::vector<std::vector<int>> &monitors) {
// read in the data // read in the data
...@@ -285,7 +285,7 @@ void LoadILL::initWorkSpace(NeXus::NXEntry &entry, ...@@ -285,7 +285,7 @@ void LoadILL::initWorkSpace(NeXus::NXEntry &entry,
* Function to do specific instrument stuff * Function to do specific instrument stuff
* *
*/ */
void LoadILL::initInstrumentSpecific() { void LoadILLINX::initInstrumentSpecific() {
m_l1 = m_loader.getL1(m_localWorkspace); m_l1 = m_loader.getL1(m_localWorkspace);
// this will be mainly for IN5 (flat PSD detector) // this will be mainly for IN5 (flat PSD detector)
m_l2 = m_loader.getInstrumentProperty(m_localWorkspace, "l2"); m_l2 = m_loader.getInstrumentProperty(m_localWorkspace, "l2");
...@@ -299,7 +299,7 @@ void LoadILL::initInstrumentSpecific() { ...@@ -299,7 +299,7 @@ void LoadILL::initInstrumentSpecific() {
* Load the time details from the nexus file. * Load the time details from the nexus file.
* @param entry :: The Nexus entry * @param entry :: The Nexus entry
*/ */
void LoadILL::loadTimeDetails(NeXus::NXEntry &entry) { void LoadILLINX::loadTimeDetails(NeXus::NXEntry &entry) {
m_wavelength = entry.getFloat("wavelength"); m_wavelength = entry.getFloat("wavelength");
...@@ -338,7 +338,7 @@ void LoadILL::loadTimeDetails(NeXus::NXEntry &entry) { ...@@ -338,7 +338,7 @@ void LoadILL::loadTimeDetails(NeXus::NXEntry &entry) {
* as parameters in the workspace * as parameters in the workspace
* @param filename :: NeXus file * @param filename :: NeXus file
*/ */
void LoadILL::addAllNexusFieldsAsProperties(std::string filename) { void LoadILLINX::addAllNexusFieldsAsProperties(std::string filename) {
API::Run &runDetails = m_localWorkspace->mutableRun(); API::Run &runDetails = m_localWorkspace->mutableRun();
...@@ -365,7 +365,7 @@ void LoadILL::addAllNexusFieldsAsProperties(std::string filename) { ...@@ -365,7 +365,7 @@ void LoadILL::addAllNexusFieldsAsProperties(std::string filename) {
* Calculates the Energy from the wavelength and adds * Calculates the Energy from the wavelength and adds
* it at property Ei * it at property Ei
*/ */
void LoadILL::addEnergyToRun() { void LoadILLINX::addEnergyToRun() {
API::Run &runDetails = m_localWorkspace->mutableRun(); API::Run &runDetails = m_localWorkspace->mutableRun();
double ei = m_loader.calculateEnergy(m_wavelength); double ei = m_loader.calculateEnergy(m_wavelength);
...@@ -382,7 +382,7 @@ void LoadILL::addEnergyToRun() { ...@@ -382,7 +382,7 @@ void LoadILL::addEnergyToRun() {
* @param data :: spectra data * @param data :: spectra data
* @return detector Elastic Peak Position * @return detector Elastic Peak Position
*/ */
int LoadILL::getDetectorElasticPeakPosition(const NeXus::NXInt &data) { int LoadILLINX::getDetectorElasticPeakPosition(const NeXus::NXInt &data) {
// j = index in the equatorial line (256/2=128) // j = index in the equatorial line (256/2=128)
// both index 127 and 128 are in the equatorial line // both index 127 and 128 are in the equatorial line
...@@ -440,7 +440,7 @@ int LoadILL::getDetectorElasticPeakPosition(const NeXus::NXInt &data) { ...@@ -440,7 +440,7 @@ int LoadILL::getDetectorElasticPeakPosition(const NeXus::NXInt &data) {
* @param filenameVanadium :: The path for the vanadium nexus file. * @param filenameVanadium :: The path for the vanadium nexus file.
* @return The elastic peak position inside the tof channels. * @return The elastic peak position inside the tof channels.
*/ */
int LoadILL::validateVanadium(const std::string &filenameVanadium) { int LoadILLINX::validateVanadium(const std::string &filenameVanadium) {
NeXus::NXRoot vanaRoot(filenameVanadium); NeXus::NXRoot vanaRoot(filenameVanadium);
NXEntry vanaFirstEntry = vanaRoot.openFirstEntry(); NXEntry vanaFirstEntry = vanaRoot.openFirstEntry();
...@@ -476,7 +476,7 @@ int LoadILL::validateVanadium(const std::string &filenameVanadium) { ...@@ -476,7 +476,7 @@ int LoadILL::validateVanadium(const std::string &filenameVanadium) {
*the elastic peak position at the detector. *the elastic peak position at the detector.
* *
*/ */
void LoadILL::loadDataIntoTheWorkSpace( void LoadILLINX::loadDataIntoTheWorkSpace(
NeXus::NXEntry &entry, const std::vector<std::vector<int>> &monitors, NeXus::NXEntry &entry, const std::vector<std::vector<int>> &monitors,
int vanaCalculatedDetectorElasticPeakPosition) { int vanaCalculatedDetectorElasticPeakPosition) {
...@@ -537,7 +537,7 @@ void LoadILL::loadDataIntoTheWorkSpace( ...@@ -537,7 +537,7 @@ void LoadILL::loadDataIntoTheWorkSpace(
// Assign Error // Assign Error
MantidVec &E = m_monitorWorkspace->dataE(spec); MantidVec &E = m_monitorWorkspace->dataE(spec);
std::transform(monitor.begin(), monitor.end(), E.begin(), std::transform(monitor.begin(), monitor.end(), E.begin(),
LoadILL::calculateError); LoadILLINX::calculateError);
m_monitorWorkspace->getSpectrum(spec).setDetectorID(monitorIDs[spec]); m_monitorWorkspace->getSpectrum(spec).setDetectorID(monitorIDs[spec]);
++spec; ++spec;
} }
...@@ -565,7 +565,7 @@ void LoadILL::loadDataIntoTheWorkSpace( ...@@ -565,7 +565,7 @@ void LoadILL::loadDataIntoTheWorkSpace(
// Assign Error // Assign Error
MantidVec &E = m_localWorkspace->dataE(spec); MantidVec &E = m_localWorkspace->dataE(spec);
std::transform(data_p, data_p + m_numberOfChannels, E.begin(), std::transform(data_p, data_p + m_numberOfChannels, E.begin(),
LoadILL::calculateError); LoadILLINX::calculateError);
m_localWorkspace->getSpectrum(spec).setDetectorID(detectorIDs[spec]); m_localWorkspace->getSpectrum(spec).setDetectorID(detectorIDs[spec]);
++spec; ++spec;
progress.report(); progress.report();
...@@ -600,7 +600,7 @@ void LoadILL::loadDataIntoTheWorkSpace( ...@@ -600,7 +600,7 @@ void LoadILL::loadDataIntoTheWorkSpace(
// Assign Error // Assign Error
MantidVec &E = m_localWorkspace->dataE(spec); MantidVec &E = m_localWorkspace->dataE(spec);
std::transform(data_p, data_p + m_numberOfChannels, E.begin(), std::transform(data_p, data_p + m_numberOfChannels, E.begin(),
LoadILL::calculateError); LoadILLINX::calculateError);
++spec; ++spec;
progress.report(); progress.report();
...@@ -612,7 +612,7 @@ void LoadILL::loadDataIntoTheWorkSpace( ...@@ -612,7 +612,7 @@ void LoadILL::loadDataIntoTheWorkSpace(
/** /**
* Run the Child Algorithm LoadInstrument. * Run the Child Algorithm LoadInstrument.
*/ */
void LoadILL::runLoadInstrument() { void LoadILLINX::runLoadInstrument() {
IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument"); IAlgorithm_sptr loadInst = createChildAlgorithm("LoadInstrument");
......
#ifndef LOADILLTEST_H_ #ifndef LOADILLINXTEST_H_
#define LOADILLTEST_H_ #define LOADILLINXTEST_H_
#include <cxxtest/TestSuite.h> #include <cxxtest/TestSuite.h>
#include "MantidDataHandling/LoadILL.h" #include "MantidDataHandling/LoadILLINX.h"
#include "MantidAPI/AnalysisDataService.h" #include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/MatrixWorkspace.h" #include "MantidAPI/MatrixWorkspace.h"
using namespace Mantid::API; using namespace Mantid::API;
using Mantid::DataHandling::LoadILL; using Mantid::DataHandling::LoadILLINX;
class LoadILLTest : public CxxTest::TestSuite { class LoadILLINXTest : public CxxTest::TestSuite {
public: public:
// This pair of boilerplate methods prevent the suite being created statically // This pair of boilerplate methods prevent the suite being created statically
// This means the constructor isn't called when running other tests // This means the constructor isn't called when running other tests
static LoadILLTest *createSuite() { return new LoadILLTest(); } static LoadILLINXTest *createSuite() { return new LoadILLINXTest(); }
static void destroySuite(LoadILLTest *suite) { delete suite; } static void destroySuite(LoadILLINXTest *suite) { delete suite; }
LoadILLTest() : m_dataFile("ILLIN5_104007.nxs") {} LoadILLINXTest() : m_dataFile("ILLIN5_104007.nxs") {}
void testName() { void testName() {
LoadILL loader; LoadILLINX loader;
TS_ASSERT_EQUALS(loader.name(), "LoadILL"); TS_ASSERT_EQUALS(loader.name(), "LoadILLINX");
} }
void testVersion() { void testVersion() {
LoadILL loader; LoadILLINX loader;
TS_ASSERT_EQUALS(loader.version(), 1); TS_ASSERT_EQUALS(loader.version(), 1);
} }
void testInit() { void testInit() {
LoadILL loader; LoadILLINX loader;
TS_ASSERT_THROWS_NOTHING(loader.initialize()); TS_ASSERT_THROWS_NOTHING(loader.initialize());
TS_ASSERT(loader.isInitialized()); TS_ASSERT(loader.isInitialized());
} }
...@@ -39,11 +39,11 @@ public: ...@@ -39,11 +39,11 @@ public:
* The elastic peak is obtained on the fly from the sample data. * The elastic peak is obtained on the fly from the sample data.
*/ */
void testExecJustSample() { void testExecJustSample() {
LoadILL loader; LoadILLINX loader;
loader.initialize(); loader.initialize();
loader.setPropertyValue("Filename", m_dataFile); loader.setPropertyValue("Filename", m_dataFile);
std::string outputSpace = "LoadILLTest_out"; std::string outputSpace = "LoadILLINXTest_out";
loader.setPropertyValue("OutputWorkspace", outputSpace); loader.setPropertyValue("OutputWorkspace", outputSpace);
TS_ASSERT_THROWS_NOTHING(loader.execute()); TS_ASSERT_THROWS_NOTHING(loader.execute());
...@@ -66,12 +66,12 @@ private: ...@@ -66,12 +66,12 @@ private:
// Performance test // Performance test
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
class LoadILLTestPerformance : public CxxTest::TestSuite { class LoadILLINXTestPerformance : public CxxTest::TestSuite {
public: public:
LoadILLTestPerformance() : m_dataFile("ILLIN5_104007.nxs") {} LoadILLINXTestPerformance() : m_dataFile("ILLIN5_104007.nxs") {}
void testDefaultLoad() { void testDefaultLoad() {
Mantid::DataHandling::LoadILL loader; Mantid::DataHandling::LoadILLINX loader;
loader.initialize(); loader.initialize();
loader.setPropertyValue("Filename", m_dataFile); loader.setPropertyValue("Filename", m_dataFile);
loader.setPropertyValue("OutputWorkspace", "ws"); loader.setPropertyValue("OutputWorkspace", "ws");
...@@ -82,4 +82,4 @@ private: ...@@ -82,4 +82,4 @@ private:
std::string m_dataFile; std::string m_dataFile;
}; };
#endif /*LoadILLTEST_H_*/ #endif /*LoadILLINXTEST_H_*/
...@@ -258,7 +258,7 @@ public: ...@@ -258,7 +258,7 @@ public:
* This test loads and sums 2 IN4 runs from ILL * This test loads and sums 2 IN4 runs from ILL
* without instrument prefix in the file names. * without instrument prefix in the file names.
*/ */
void test_ILLLoadMultipleFilesNoPrefix() { void test_ILLINXLoadMultipleFilesNoPrefix() {
ConfigService::Instance().setString("default.instrument", "IN4"); ConfigService::Instance().setString("default.instrument", "IN4");
ConfigService::Instance().appendDataSearchSubDir("ILL/IN4/"); ConfigService::Instance().appendDataSearchSubDir("ILL/IN4/");
......
Supports Markdown
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