diff --git a/Code/Mantid/Framework/DataHandling/src/SaveNISTDAT.cpp b/Code/Mantid/Framework/DataHandling/src/SaveNISTDAT.cpp index 7d85c0ff599f0ae54b790ba735645406370ad944..894dda81af4059aaefaedc0a1185670de0240581 100644 --- a/Code/Mantid/Framework/DataHandling/src/SaveNISTDAT.cpp +++ b/Code/Mantid/Framework/DataHandling/src/SaveNISTDAT.cpp @@ -48,7 +48,7 @@ void SaveNISTDAT::exec() g_log.error("Failed to open file:" + filename); throw Exception::FileError("Failed to open file:" , filename); } - out_File << "Qx - Qy - I(Qx,Qy)\r\n"; + out_File << "Qx - Qy - I(Qx,Qy) - dI(Qx,Qy)\r\n"; out_File << "ASCII data\r\n"; // Set up the progress reporting object @@ -63,6 +63,7 @@ void SaveNISTDAT::exec() const double qy = (axis(i)+axis(i+1))/2.0; const MantidVec& XIn = inputWS->readX(i); const MantidVec& YIn = inputWS->readY(i); + const MantidVec& EIn = inputWS->readE(i); for ( unsigned int j = 0; j < XIn.size()-1; j++) { @@ -71,7 +72,8 @@ void SaveNISTDAT::exec() { out_File << (XIn[j]+XIn[j+1])/2.0; out_File << " " << qy; - out_File << " " << YIn[j] << "\r\n"; + out_File << " " << YIn[j]; + out_File << " " << EIn[j] << "\r\n"; } } } diff --git a/Code/Mantid/Framework/DataHandling/test/SaveNISTDATTest.h b/Code/Mantid/Framework/DataHandling/test/SaveNISTDATTest.h index af860ecb25dbacf89cf0fa405055f1e12f3b012a..da15353acb81266ee411e0f17989bdc945996ae1 100644 --- a/Code/Mantid/Framework/DataHandling/test/SaveNISTDATTest.h +++ b/Code/Mantid/Framework/DataHandling/test/SaveNISTDATTest.h @@ -37,11 +37,11 @@ public: std::string fileLine; std::getline( testFile, fileLine ); - TS_ASSERT_EQUALS ( fileLine, "Qx - Qy - I(Qx,Qy)\r" ); + TS_ASSERT_EQUALS ( fileLine, "Qx - Qy - I(Qx,Qy) - dI(Qx,Qy)\r" ); std::getline( testFile, fileLine ); TS_ASSERT_EQUALS ( fileLine, "ASCII data\r" ); std::getline( testFile, fileLine ); - TS_ASSERT_EQUALS ( fileLine, "-0.0105 -0.0735 6.13876e+08\r" ); + TS_ASSERT_EQUALS ( fileLine, "-0.0105 -0.0735 6.13876e+08 6.1697e+07\r" ); // remove file created by this algorithm Poco::File(outputFile).remove();