Skip to content
Snippets Groups Projects
Commit 22c97ce8 authored by Owen Arnold's avatar Owen Arnold
Browse files

refs #13517. Working serial algorithm.

parent 7a2e8c7d
No related branches found
No related tags found
No related merge requests found
......@@ -371,6 +371,8 @@ public:
/// Apply masking.
void setMDMasking(Mantid::Geometry::MDImplicitFunction *maskingRegion);
/// Apply masking.
void setMDMaskAt(const size_t& index, bool mask);
/// Clear masking.
void clearMDMasking();
......
......@@ -1165,6 +1165,15 @@ void MDHistoWorkspace::setMDMasking(
}
}
/**
* Set the masking
* @param index : linear index to mask
* @param mask : True to mask. False to clear.
*/
void MDHistoWorkspace::setMDMaskAt(const size_t& index, bool mask){
m_masks[index] = mask;
}
/// Clear any existing masking.
void MDHistoWorkspace::clearMDMasking() {
for (size_t i = 0; i < this->getNPoints(); ++i) {
......
......@@ -106,15 +106,13 @@ void TransposeMD::exec() {
}
std::vector<coord_t> origin;
std::vector<coord_t> origin(nDimsOutput, 0.0);
std::vector<Geometry::IMDDimension_sptr> targetGeometry;
for (size_t i = 0; i < nDimsOutput; ++i) {
// Clone the dimension corresponding to the axis requested.
auto cloneDim = Geometry::IMDDimension_sptr(
new Geometry::MDHistoDimension(inWS->getDimension(axes[i]).get()));
targetGeometry.push_back(cloneDim);
// Set the same origin as we have on the input workspace
origin.push_back(coord_t(cloneDim->getMinimum()));
}
// Make the output workspace in the right shape.
......@@ -134,8 +132,10 @@ void TransposeMD::exec() {
size_t index = outWS->getLinearIndexAtCoord(&outcoords[0]);
outWS->setSignalAt(index, inIterator->getSignal());
outWS->setErrorSquaredAt(index, inIterator->getError()*inIterator->getError());
// TODO more otherwise
const double error = inIterator->getError();
outWS->setErrorSquaredAt(index, error*error);
outWS->setNumEventsAt(index, inIterator->getNumEvents());
outWS->setMDMaskAt(index, inIterator->getIsMasked());
}while(inIterator->next());
......
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