diff --git a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp index 13d63ddfeb3bff15355b47ffe43303c7df21bf62..fd89856f300a0964a14e713ae1949fca1621347e 100644 --- a/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp +++ b/Code/Mantid/Framework/API/src/MatrixWorkspace.cpp @@ -151,8 +151,14 @@ namespace Mantid m_spectraMap.reset(spectraMap); // The neighbour map needs to be rebuilt m_nearestNeighbours.reset(); - - this->updateSpectraUsingMap(); + try + { + this->updateSpectraUsingMap(); + } + catch (std::exception &e) + { + g_log.error() << "Error in MatrixWorkspace::replaceSpectraMap(): " << e.what() << std::endl; + } } /** Using the current spectraDetectorMap, diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRaw.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRaw.cpp index bcdcbe39ff5ee1591ed6f691a946cef18d7c761d..b9b2760d41a98cdd648f0d0fda25bfebe3631534 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadRaw.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadRaw.cpp @@ -189,11 +189,11 @@ namespace Mantid runLoadInstrument(localWorkspace ); runLoadMappingTable(localWorkspace ); runLoadLog(localWorkspace ); - Property* log=createPeriodLog(1); - if(log)localWorkspace->mutableRun().addLogData(log); + Property* log=createPeriodLog(1); + if(log)localWorkspace->mutableRun().addLogData(log); // Set the total proton charge for this run // (not sure how this works for multi_period files) - localWorkspace->mutableRun().setProtonCharge(iraw.rpb.r_gd_prtn_chrg); + localWorkspace->mutableRun().setProtonCharge(iraw.rpb.r_gd_prtn_chrg); } else // We are working on a higher period of a multiperiod raw file { @@ -208,6 +208,9 @@ namespace Mantid g_log.information() << "Workspace " << WSName << " created. \n"; } + if (localWorkspace) + localWorkspace->updateSpectraUsingMap(); + // Assign the result to the output workspace property setProperty(outputWorkspace,localWorkspace); diff --git a/Code/Mantid/Framework/MDEvents/test/IMDBoxTest.h b/Code/Mantid/Framework/MDEvents/test/IMDBoxTest.h index fab7276f6b85ed80a571142b0f30521481af86de..2262e3d6d60b8f57a6a998e6e14e41be4fb7948b 100644 --- a/Code/Mantid/Framework/MDEvents/test/IMDBoxTest.h +++ b/Code/Mantid/Framework/MDEvents/test/IMDBoxTest.h @@ -182,18 +182,20 @@ public: /** Open a nexus file for this and save it */ void test_saveNexus_loadNexus() { - // Clean up if it exists - std::string filename(ConfigService::Instance().getString("defaultsave.directory") + "IMDBoxTest.nxs"); - + std::string filename; try { + // Clean up if it exists + filename = (ConfigService::Instance().getString("defaultsave.directory") + "IMDBoxTest.nxs"); + Poco::File(filename).createFile(); if (Poco::File(filename).exists()) Poco::File(filename).remove(); } - catch (...) + catch (std::exception &e) { std::cout << "Error! Could not write to " + filename << std::endl; + std::cout << e.what() << std::endl; std::cout << "Skipping test.\n"; return; }