Skip to content

Commit

Permalink
Refs #6940 only output Qvectors in memory if no file requested
Browse files Browse the repository at this point in the history
  • Loading branch information
Vickie Lynch committed Jun 26, 2013
1 parent ee9732d commit 13d9353
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions Code/Mantid/Framework/MDEvents/src/SaveIsawQvector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ namespace MDEvents
exts.push_back(".bin");

declareProperty(new FileProperty("Filename", "", FileProperty::OptionalSave, exts),
"Optional path to an hkl file to save.");
"Optional path to an hkl file to save. Vectors returned if no file requested.");
declareProperty("RightHanded", true, "Save the Q-vector as k_f - k_i");
declareProperty("ISAWcoords", true, "Save the Q-vector with y gravitationally up and x pointing downstream");
std::vector<double>Qx_save,Qy_save,Qz_save;
Expand Down Expand Up @@ -189,21 +189,25 @@ namespace MDEvents
{
buffer[dim] = static_cast<float>(coord_signs[dim] * locCoord[coord_map[dim]]);
}
Qx_save.push_back(static_cast<double>(buffer[0]));
Qy_save.push_back(static_cast<double>(buffer[1]));
Qz_save.push_back(static_cast<double>(buffer[2]));
if (!filename.empty()) handle.write(reinterpret_cast<char*>(buffer), BUFF_SIZE);
if (filename.empty())
{
Qx_save.push_back(static_cast<double>(buffer[0]));
Qy_save.push_back(static_cast<double>(buffer[1]));
Qz_save.push_back(static_cast<double>(buffer[2]));
}
else handle.write(reinterpret_cast<char*>(buffer), BUFF_SIZE);
} // end of loop over events in list

prog.report();
} // end of loop over spectra
setProperty("Qx_vector", Qx_save);
setProperty("Qy_vector", Qy_save);
setProperty("Qz_vector", Qz_save);

if (filename.empty())
{
setProperty("Qx_vector", Qx_save);
setProperty("Qy_vector", Qy_save);
setProperty("Qz_vector", Qz_save);
}
else handle.close(); // cleanup

// cleanup
if (!filename.empty())handle.close();
}

/**
Expand Down

0 comments on commit 13d9353

Please sign in to comment.