Mantid
Loading...
Searching...
No Matches
LoadBBY.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//---------------------------------------------------
10// Includes
11//---------------------------------------------------
12
13#include "LoadANSTOHelper.h"
15#include "MantidDataHandling/DllConfig.h"
20
21namespace Mantid {
22namespace DataHandling {
23/*
24Loads a Bilby data file. Implements API::IFileLoader and its file check methods
25to recognise a file as the one containing Bilby data.
26
27@author David Mannicke (ANSTO), Anders Markvardsen (ISIS), Roman Tolchenov
28(Tessella plc)
29@date 11/07/2014
30*/
31
32class MANTID_DATAHANDLING_DLL LoadBBY : public API::IFileLoader<Kernel::FileDescriptor> {
33
35 // core values or non standard conversion
36 std::string sample_name;
37 std::string sample_description;
38 std::string start_time;
39 int32_t bm_counts;
40 int32_t att_pos;
43 bool is_tof; // tof or wavelength data
44 double wavelength; // -> /nvs067/lambda
48 };
49
50public:
51 // description
52 int version() const override { return 1; }
53 const std::vector<std::string> seeAlso() const override { return {"Load", "LoadQKK"}; }
54 const std::string name() const override { return "LoadBBY"; }
55 const std::string category() const override { return "DataHandling\\ANSTO"; }
56 const std::string summary() const override { return "Loads a Bilby data file into a workspace."; }
57
58 // returns a confidence value that this algorithm can load a specified file
59 int confidence(Kernel::FileDescriptor &descriptor) const override;
60
61protected:
62 // initialisation
63 void init() override;
64 // execution
65 void exec() override;
66
67private:
68 // region of intreset
69 static std::vector<bool> createRoiVector(const std::string &maskfile);
70
71 // instrument creation
72 void createInstrument(ANSTO::Tar::File &tarFile, InstrumentInfo &instrumentInfo,
73 std::map<std::string, double> &logParams, std::map<std::string, std::string> &logStrings,
74 std::map<std::string, std::string> &allParams);
75 void loadInstrumentParameters(const NeXus::NXEntry &entry, std::map<std::string, double> &logParams,
76 std::map<std::string, std::string> &logStrings,
77 std::map<std::string, std::string> &allParams);
78
79 // load nx dataset
80 template <class T> static bool loadNXDataSet(const NeXus::NXEntry &entry, const std::string &path, T &value);
81 bool loadNXString(const NeXus::NXEntry &entry, const std::string &path, std::string &value);
82
83 // binary file access
84 template <class EventProcessor>
85 void loadEvents(API::Progress &prog, const char *progMsg, ANSTO::Tar::File &tarFile, EventProcessor &eventProcessor);
86};
87
88} // namespace DataHandling
89} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition: IFileLoader.h:19
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: LoadBBY.h:53
const std::string name() const override
function to return a name of the algorithm, must be overridden in all algorithms
Definition: LoadBBY.h:54
const std::string category() const override
function to return a category of the algorithm.
Definition: LoadBBY.h:55
const std::string summary() const override
function returns a summary message that will be displayed in the default GUI, and in the help.
Definition: LoadBBY.h:56
int version() const override
function to return a version of the algorithm, must be overridden in all algorithms
Definition: LoadBBY.h:52
Defines a wrapper around an open file.
A class that holds information about an instrument.
Implements NXentry Nexus class.
Definition: NexusClasses.h:898
bool loadNXString(const NeXus::NXEntry &entry, const std::string &path, std::string &value)
Definition: PatchBBY.cpp:74
bool loadNXDataSet(NeXus::NXEntry &entry, const std::string &path, T &value)
Definition: PatchBBY.cpp:63
Helper class which provides the Collimation Length for SANS instruments.