12static constexpr std::size_t RUN_TIME_STRING_LENGTH = 19;
39 spectrum_index.
load();
40 return spectrum_index.
dim0();
58 return std::make_tuple(udet, spec);
62 spectrum_index.
load();
68 NXInt udet = spectrum_index;
69 NXInt spec = std::move(spectrum_index);
70 return std::make_tuple(udet, spec);
95 double thick(rspb[0]);
97 double width(rspb[2]);
104 std::string
id = sampleEntry.
getString(
"id");
107 geom_id = std::stoi(
id);
111 double thick = sampleEntry.
getFloat(
"thickness");
113 double width = sampleEntry.
getFloat(
"width");
128 double proton_charge =
static_cast<double>(entry.
getFloat(
"proton_charge"));
139 std::string end_time_iso = std::string(char_data(), RUN_TIME_STRING_LENGTH);
145 std::string start_time_iso = std::string(char_data(), RUN_TIME_STRING_LENGTH);
163 static_cast<double>(rpb_dbl[7]));
165 static_cast<double>(rpb_dbl[8]));
178 run.
addProperty(
"gd_prtn_chrg",
static_cast<double>(floatData[0]), floatData.
attributes(
"units"),
true);
180 floatData = entry.
openNXFloat(
"proton_charge_raw");
182 run.
addProperty(
"tot_prtn_chrg",
static_cast<double>(floatData[0]), floatData.
attributes(
"units"),
true);
184 auto sourceEntry = entry.
openNXGroup(
"instrument/source");
185 if (sourceEntry.containsDataSet(
"frequency")) {
195 entry.
getString(
"experiment_identifier"));
206 auto detectorEntry = entry.
openNXGroup(
"detector_1");
207 if (detectorEntry.containsDataSet(
"time_of_flight")) {
208 auto timeBins = entry.
openNXFloat(
"detector_1/time_of_flight");
209 auto x_length = timeBins.
dim0();
211 auto timeData = std::make_shared<HistogramData::HistogramX>(timeBins(), timeBins() + x_length);
214 auto timeBins = entry.
openNXFloat(
"detector_1/raw_time");
215 auto x_length = timeBins.
dim0();
217 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).
float getFloat(const std::string &name) const
Returns a float.
std::string getString(const std::string &name) const
Returns a string.
NXFloat openNXFloat(const std::string &name) const
Creates and opens a float dataset.
NXClass openNXGroup(const std::string &name) const
Creates and opens an arbitrary (non-standard) class (group).
void close()
Close this class.
NXChar openNXChar(const std::string &name) const
Creates and opens a char dataset.
NXInt openNXInt(const std::string &name) const
Creates and opens an integer dataset.
int32_t getInt(const std::string &name) const
Returns a int.
Templated class implementation of NXDataSet.
void load()
Read all of the datablock in.
dimsize_t dim0() const
Returns the number of elements along the first dimension.
NXAttributes attributes
Attributes.
Implements NXentry Nexus class.
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.
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.
std::tuple< Nexus::NXInt, Nexus::NXInt > findDetectorIDsAndSpectrumNumber(const Nexus::NXEntry &entry, const bool hasVMSBlock)
find detector ids and spectrum numbers
void loadRunDetails(API::Run &runDetails, const Nexus::NXEntry &entry, const bool hasVMSBlock)
Load data about the run.
NXDataSetTyped< char > NXChar
The char dataset type.
std::string to_string(const wide_integer< Bits, Signed > &n)