diff --git a/Framework/DataHandling/test/LoadEventNexusTest.h b/Framework/DataHandling/test/LoadEventNexusTest.h index ef109ffe10853a65fc67ba24ce1a7ea57c669377..7846e39142a30604a64c172d6bfba045e14e5df0 100644 --- a/Framework/DataHandling/test/LoadEventNexusTest.h +++ b/Framework/DataHandling/test/LoadEventNexusTest.h @@ -149,8 +149,9 @@ private: public: void test_load_event_nexus() { - const std::string file = "SANS2D_ESS_example.nxs"; + const std::string file = "/Users/spu92482/Downloads/V20_example_5.nxs"; LoadEventNexus alg; + alg.setRethrows(true); alg.setChild(true); alg.initialize(); alg.setProperty("Filename", file); diff --git a/Framework/NexusGeometry/src/NexusGeometryParser.cpp b/Framework/NexusGeometry/src/NexusGeometryParser.cpp index 7288af47fcd6320388aae5425c2fe24255dae614..b67fea3601bb8217dbf909e68cbe23f89c5873c8 100644 --- a/Framework/NexusGeometry/src/NexusGeometryParser.cpp +++ b/Framework/NexusGeometry/src/NexusGeometryParser.cpp @@ -416,7 +416,10 @@ getTransformations(const H5File &file, const Group &detectorGroup) { std::vector<Mantid::detid_t> getDetectorIds(const Group &detectorGroup) { std::vector<Mantid::detid_t> detIds; - + if (!detectorGroup.exists(DETECTOR_IDS)) + throw std::invalid_argument("Mantid requires the following named dataset " + "to be present in NXDetectors: " + + DETECTOR_IDS); for (unsigned int i = 0; i < detectorGroup.getNumObjs(); ++i) { H5std_string objName = detectorGroup.getObjnameByIdx(i); if (objName == DETECTOR_IDS) { @@ -661,7 +664,10 @@ extractInstrument(const H5File &file, const Group &root) { Eigen::Vector3d bankPos = transforms * Eigen::Vector3d{0, 0, 0}; // Absolute bank rotation auto bankRotation = Eigen::Quaterniond(transforms.rotation()); - auto bankName = get1DStringDataset(BANK_NAME, detectorGroup); + std::string bankName; + if (detectorGroup.exists(BANK_NAME)) + bankName = get1DStringDataset(BANK_NAME, + detectorGroup); // local_name is optional builder.addBank(bankName, bankPos, bankRotation); // Get the pixel detIds auto detectorIds = getDetectorIds(detectorGroup);