Skip to content

Commit

Permalink
Refs #4814. Fix system tests.
Browse files Browse the repository at this point in the history
Extract shouldn't clear the parameter map flags (broke SANS tests) and
ExtractMask/MaskDetectors doesn't seem to give the right answer when
used with detector IDs. Switched to using MaskWorkspace directly
  • Loading branch information
martyngigg committed Feb 24, 2012
1 parent d2bedf2 commit 1002d53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion Code/Mantid/Framework/Algorithms/src/ExtractMask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ namespace Mantid
MatrixWorkspace_sptr outputWS(maskWS);
WorkspaceFactory::Instance().initializeFromParent(inputWS, outputWS, false);
outputWS->setTitle(inputWS->getTitle());
outputWS->getInstrument()->getParameterMap()->clearParametersByName("masked"); // turn off the mask bit

bool inputWSIsSpecial(false);
{
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/DataHandling/src/MaskDetectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void MaskDetectors::appendToIndexListFromMaskWS(std::vector<size_t>& indexList,
for (int64_t i = startIndex; i <= endIndex; ++i)
{

if( maskedWorkspace->dataY(i)[0] > 0.5 && existingIndices.count(i) == 0 )
if( maskedWorkspace->dataY(i-startIndex)[0] > 0.5 && existingIndices.count(i) == 0 )
{
indexList.push_back(i);
}
Expand Down
7 changes: 2 additions & 5 deletions Code/Mantid/scripts/Inelastic/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,9 @@ def diagnose(white_int, **kwargs):
def add_masking(input_ws, mask_ws, start_index=None, end_index=None):
"""
Mask the Detectors on the input workspace that are masked
on the mask_ws. Avoids a current bug in using MaskDetectors with a MaskedWorkspace in a loop
on the mask_ws.
"""
#MaskDetectors(input_ws, MaskedWorkspace=mask_ws, StartWorkspaceIndex=start_index, EndWorkspaceIndex=end_index)
masked = ExtractMasking(mask_ws, '__tmp')
MaskDetectors(input_ws, DetectorList=masked.getPropertyValue("DetectorList"))
DeleteWorkspace(masked.workspace())
MaskDetectors(input_ws, MaskedWorkspace=mask_ws, StartWorkspaceIndex=start_index, EndWorkspaceIndex=end_index)

#-------------------------------------------------------------------------------

Expand Down

0 comments on commit 1002d53

Please sign in to comment.