Skip to content

Commit

Permalink
Unit test for horizontal line mask. re #5044
Browse files Browse the repository at this point in the history
  • Loading branch information
Anders-Markvardsen committed Apr 3, 2012
1 parent dfb143d commit 00ecddb
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Code/Mantid/Framework/PythonAPI/test/SANSMaskCommandsTest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest
from mantidsimple import *
import MantidFramework
import ISISCommandInterface as ISIS

class SANSMaskCommandsTest(unittest.TestCase):
Expand Down Expand Up @@ -43,7 +44,25 @@ def test_single_spectrum(self):
self.assertEqual(self.test_ws.readY(spec_nums1-1)[0], 0)
# This pixel has not been masked because it is on the HAB detector
self.assertEqual(self.test_ws.readY(spec_nums2-1)[0], 1.0)


def test_horizontal_line(self):
"""
Checks the ISIS specfic mask command for spectra numbers
"""

# flags some whole spectra for masking
ISIS.Mask('MASK H0')

# this will apply the masking on the detector bank setup for
# reduction, which in this case is the Main detector bank
ISIS.ReductionSingleton().mask.execute(ISIS.ReductionSingleton(), self.test_ws_name)

# Spectrum number is one more than workspace index
self.assertEqual(self.test_ws.readY(2)[0], 0)
self.assertEqual(self.test_ws.readY(3)[0], 0)
self.assertEqual(self.test_ws.readY(127)[0], 0)
self.assertEqual(self.test_ws.readY(1)[0], 2.0)

def test_masking_timebins(self):
"""
Time bin masking uses the MaskBins algorithm
Expand Down

0 comments on commit 00ecddb

Please sign in to comment.