Skip to content
Snippets Groups Projects
Commit 3a32cf1f authored by Peter Parker's avatar Peter Parker
Browse files

Refs #9245 - Output correct unit string in CanSAS format.

Also, the CanSAS format expects "A" rather than "Angstrom".
parent 48f29b06
No related branches found
No related tags found
No related merge requests found
......@@ -221,10 +221,10 @@ void SaveCanSAS1D2::createSASTransElement(std::string& sasTrans, const std::stri
<< name
<< "\">";
std::string t_unit = m_ws->YUnitLabel();
std::string lambda_unit = m_ws->getAxis(0)->unit()->caption();
std::string lambda_unit = m_ws->getAxis(0)->unit()->label();
if (t_unit.empty())
t_unit = "none";
if (lambda_unit.empty())
if (lambda_unit.empty() || lambda_unit == "Angstrom")
lambda_unit = "A";
const MantidVec& xdata = m_ws->readX(0);
......
......@@ -178,7 +178,7 @@ public:
std::getline(testFile, fileLine);// transmission spectrum start
TS_ASSERT_EQUALS(fileLine, "\t\t<SAStransmission_spectrum name=\"sample\">");
idataline="\t\t\t<Tdata><Lambda unit=\"Wavelength\">3543.75</Lambda><T unit=\"Counts\">111430</T><Tdev unit=\"none\">333.811</Tdev></Tdata>";
idataline="\t\t\t<Tdata><Lambda unit=\"A\">3543.75</Lambda><T unit=\"Counts\">111430</T><Tdev unit=\"none\">333.811</Tdev></Tdata>";
std::getline(testFile, fileLine);// transmission spectrum data
TS_ASSERT_EQUALS(fileLine, idataline);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment