3 #include "NeXusFile.hpp"
22 uint64_t number_of_detectors = 0, number_of_monitors = 0;
25 m_file =
new NeXus::File(filename);
27 catch(
const std::exception& ex)
29 LOGSTR_ERROR(
"error opening \"" << filename <<
"\": " << ex.what());
36 getItem(
"/mantid_workspace_1/instrument/physical_detectors/distance",
m_distance);
38 getItem(
"/mantid_workspace_1/instrument/physical_detectors/number_of_detectors", number_of_detectors);
41 throw std::runtime_error(
"number of detectors");
43 std::vector<double> dbl_vec;
44 std::vector<int32_t> int32_vec;
45 getItem(
"/mantid_workspace_1/instrument/physical_monitors/azimuthal_angle", dbl_vec);
47 getItem(
"/mantid_workspace_1/instrument/physical_monitors/polar_angle", dbl_vec);
49 getItem(
"/mantid_workspace_1/instrument/physical_monitors/distance", dbl_vec);
51 getItem(
"/mantid_workspace_1/instrument/physical_monitors/detector_number", int32_vec);
53 getItem(
"/mantid_workspace_1/instrument/physical_monitors/number_of_monitors", number_of_monitors);
54 if ( number_of_monitors != int32_vec.size() )
56 throw std::runtime_error(
"number of monitors");
63 m_nlines = number_of_detectors + number_of_monitors;
66 catch(
const std::exception& ex)
68 LOGSTR_ERROR(
"error loading from \"" << filename <<
"\": " << ex.what());
95 value =
m_file->getStrData();
114 memset(&det, 0,
sizeof(det));
std::string m_instrument_xml_file_name
std::vector< double > m_distance
void getItem(const std::string &name, std::vector< T > &value)
void readLine(int &det_no, DETECTOR &det)
float ut[ISISCRPT_MAX_USER]
#define LOGSTR_ERROR(__arg)
std::string m_instrument_name
std::string m_instrument_xml
std::vector< double > m_azimuthal_angle
void setLoggerName(const std::string &logger_name)
std::vector< double > m_polar_angle
std::vector< int32_t > m_detector_number
DetectorFileMantid(const char *filename)
std::string m_instrument_parameter_map