Skip to content

Commit

Permalink
Refs #11362 clang-format it.
Browse files Browse the repository at this point in the history
  • Loading branch information
rosswhitfield committed Apr 23, 2015
1 parent 769d3ad commit a30558c
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions Code/Mantid/Framework/MDAlgorithms/src/SaveMD2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,20 @@ void SaveMD2::doSaveHisto(Mantid::DataObjects::MDHistoWorkspace_sptr ws) {

// Save each axis dimension as an array
std::string axes_label;
for (size_t d=0; d < numDims; d++) {
for (size_t d = 0; d < numDims; d++) {
std::vector<double> axis;
IMDDimension_const_sptr dim = ws->getDimension(d);
for (size_t n=0; n <= dim->getNBins(); n++)
for (size_t n = 0; n <= dim->getNBins(); n++)
axis.push_back(dim->getX(n));
file->makeData(dim->getDimensionId(), ::NeXus::FLOAT64, static_cast<int>(dim->getNBins()), true);
file->makeData(dim->getDimensionId(), ::NeXus::FLOAT64,
static_cast<int>(dim->getNBins()), true);
file->putData(axis);
file->putAttr("units", std::string(dim->getUnits()));
file->putAttr("long_name", std::string(dim->getName()));
file->closeData();
if (d !=0)
axes_label.insert(0,":");
axes_label.insert(0,dim->getDimensionId());
if (d != 0)
axes_label.insert(0, ":");
axes_label.insert(0, dim->getDimensionId());
}

// Write out the affine matrices
Expand All @@ -171,8 +172,8 @@ void SaveMD2::doSaveHisto(Mantid::DataObjects::MDHistoWorkspace_sptr ws) {

file->makeData("signal", ::NeXus::FLOAT64, size, true);
file->putData(ws->getSignalArray());
file->putAttr("signal",1);
file->putAttr("axes",axes_label);
file->putAttr("signal", 1);
file->putAttr("axes", axes_label);
file->closeData();

file->makeData("errors_squared", ::NeXus::FLOAT64, size, true);
Expand Down Expand Up @@ -205,11 +206,13 @@ void SaveMD2::exec() {

if (eventWS) {
// If event workspace use SaveMD version 1.
IAlgorithm_sptr saveMDv1 = createChildAlgorithm("SaveMD",-1,-1,true,1);
saveMDv1->setProperty<IMDWorkspace_sptr>("InputWorkspace",ws);
saveMDv1->setProperty<std::string>("Filename",getProperty("Filename"));
saveMDv1->setProperty<bool>("UpdateFileBackEnd",getProperty("UpdateFileBackEnd"));
saveMDv1->setProperty<bool>("MakeFileBacked",getProperty("MakeFileBacked"));
IAlgorithm_sptr saveMDv1 = createChildAlgorithm("SaveMD", -1, -1, true, 1);
saveMDv1->setProperty<IMDWorkspace_sptr>("InputWorkspace", ws);
saveMDv1->setProperty<std::string>("Filename", getProperty("Filename"));
saveMDv1->setProperty<bool>("UpdateFileBackEnd",
getProperty("UpdateFileBackEnd"));
saveMDv1->setProperty<bool>("MakeFileBacked",
getProperty("MakeFileBacked"));
saveMDv1->execute();
} else if (histoWS) {
this->doSaveHisto(histoWS);
Expand Down

0 comments on commit a30558c

Please sign in to comment.