11static constexpr std::size_t RUN_TIME_STRING_LENGTH = 19;
38 spectrum_index.
load();
39 return spectrum_index.
dim0();
57 return std::make_tuple(udet, spec);
61 spectrum_index.
load();
67 NXInt udet = spectrum_index;
68 NXInt spec = spectrum_index;
69 return std::make_tuple(udet, spec);
94 double thick(rspb[0]);
96 double width(rspb[2]);
103 std::string
id = sampleEntry.
getString(
"id");
106 geom_id = std::stoi(
id);
110 double thick = sampleEntry.
getFloat(
"thickness");
112 double width = sampleEntry.
getFloat(
"width");
127 double proton_charge =
static_cast<double>(entry.
getFloat(
"proton_charge"));
138 std::string end_time_iso = std::string(char_data(), RUN_TIME_STRING_LENGTH);
144 std::string start_time_iso = std::string(char_data(), RUN_TIME_STRING_LENGTH);
162 static_cast<double>(rpb_dbl[7]));
164 static_cast<double>(rpb_dbl[8]));
177 run.
addProperty(
"gd_prtn_chrg",
static_cast<double>(floatData[0]), floatData.
attributes(
"units"),
true);
179 floatData = entry.
openNXFloat(
"proton_charge_raw");
181 run.
addProperty(
"tot_prtn_chrg",
static_cast<double>(floatData[0]), floatData.
attributes(
"units"),
true);
183 auto sourceEntry = entry.
openNXGroup(
"instrument/source");
184 if (sourceEntry.containsDataSet(
"frequency")) {
194 entry.
getString(
"experiment_identifier"));
205 auto detectorEntry = entry.
openNXGroup(
"detector_1");
206 if (detectorEntry.containsDataSet(
"time_of_flight")) {
207 auto timeBins = entry.
openNXFloat(
"detector_1/time_of_flight");
208 auto x_length = timeBins.
dim0();
210 auto timeData = std::make_shared<HistogramData::HistogramX>(timeBins(), timeBins() + x_length);
213 auto timeBins = entry.
openNXFloat(
"detector_1/raw_time");
214 auto x_length = timeBins.
dim0();
216 auto timeData = std::make_shared<HistogramData::HistogramX>(timeBins(), timeBins() + x_length);
void addProperty(Kernel::Property *prop, bool overwrite=false)
Add data to the object in the form of a property.
This class stores information regarding an experimental run as a series of log entries.
void setProtonCharge(const double charge)
Set the proton charge.
This class stores information about the sample used in particular run.
void setGeometryFlag(int geom_id)
Sets the geometry flag.
void setWidth(double width)
Sets the width.
void setHeight(double height)
Sets the height.
void setThickness(double thick)
Sets the thickness.
The base class for a Nexus class (group).
int getInt(const std::string &name) const
Returns a int.
NXInt openNXInt(const std::string &name) const
Creates and opens an integer dataset.
void close()
Close this class.
NXClass openNXGroup(const std::string &name) const
Creates and opens an arbitrary (non-standard) class (group).
float getFloat(const std::string &name) const
Returns a float.
NXFloat openNXFloat(const std::string &name) const
Creates and opens a float dataset.
NXChar openNXChar(const std::string &name) const
Creates and opens a char dataset.
std::string getString(const std::string &name) const
Returns a string.
Templated class implementation of NXDataSet.
void load(const int blocksize=1, int i=-1, int j=-1, int k=-1, int l=-1) override
Implementation of the virtual NXDataSet::load(...) method.
int dim0() const
Returns the number of elements along the first dimension.
Implements NXentry Nexus class.
NXAttributes attributes
Attributes.
void loadSampleGeometry(API::Sample &sample, const NeXus::NXEntry &entry, const bool hasVMSBlock)
Load geometrical data about the sample from the nexus entry into a workspace.
std::tuple< NeXus::NXInt, NeXus::NXInt > findDetectorIDsAndSpectrumNumber(const NeXus::NXEntry &entry, const bool hasVMSBlock)
find detector ids and spectrum numbers
int64_t findNumberOfSpectra(const NeXus::NXEntry &entry, const bool hasVMSBlock)
find the number of spectra in the nexus file
std::shared_ptr< HistogramData::HistogramX > loadTimeData(const NeXus::NXEntry &entry)
Load the time data from nexus entry.
void loadRunDetails(API::Run &runDetails, const NeXus::NXEntry &entry, const bool hasVMSBlock)
Load data about the run.
std::string to_string(const wide_integer< Bits, Signed > &n)