Skip to content

Commit

Permalink
Make necessary change to code algorithm re #6107
Browse files Browse the repository at this point in the history
Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Nov 28, 2012
1 parent 612179f commit f9cca0a
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Code/Mantid/Framework/DataHandling/src/SaveAscii.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ namespace Mantid
"If present, will overide any specified choice given to Separator.");

setPropertySettings("CustomSeparator", new VisibleWhenProperty("Separator", IS_EQUAL_TO, "UserDefined") );

declareProperty("ColumnHeader", true, "If true, write the column headers.");

}

/**
Expand All @@ -105,6 +108,7 @@ namespace Mantid
std::vector<int> spec_list = getProperty("SpectrumList");
int spec_min = getProperty("WorkspaceIndexMin");
int spec_max = getProperty("WorkspaceIndexMax");
bool writeHeader = getProperty("ColumnHeader");

// Check whether we need to write the fourth column
bool write_dx = getProperty("WriteXError");
Expand Down Expand Up @@ -163,20 +167,22 @@ namespace Mantid
}

// Write the column captions
file << comment << "X";
if (idx.empty())
if( writeHeader) {
file << comment << "X";
if (idx.empty())
for(int spec=0;spec<nSpectra;spec++)
{
file << " , Y" << spec << " , E" << spec;
if (write_dx) file << " , DX" << spec;
file << " , Y" << spec << " , E" << spec;
if (write_dx) file << " , DX" << spec;
}
else
else
for(std::set<int>::const_iterator spec=idx.begin();spec!=idx.end();++spec)
{
file << " , Y" << *spec << " , E" << *spec;
if (write_dx) file << " , DX" << *spec;
file << " , Y" << *spec << " , E" << *spec;
if (write_dx) file << " , DX" << *spec;
}
file << std::endl;
file << std::endl;
}

bool isHistogram = ws->isHistogramData();

Expand Down

0 comments on commit f9cca0a

Please sign in to comment.