def test_sample_and_can_correction(self):
        """
        Tests corrections for the sample and container.
        """

        corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
                                                      SampleChemicalFormula='H2-O',
                                                      CanWorkspace=self._can_ws,
                                                      CanChemicalFormula='V',
                                                      UseCanCorrections=True,
                                                      Events=200)

        self.assertEqual(fact.size(), 2)
        self._test_workspaces(corrected, fact)
    def test_sample_and_can_subtraction(self):
        """
        Tests corrections for the sample and simple container subtraction.
        """

        corrected, fact = IndirectFlatPlateAbsorption(
            SampleWorkspace=self._red_ws,
            SampleChemicalFormula='H2-O',
            CanWorkspace=self._can_ws,
            ElementSize=1,
            UseCanCorrections=False,
            Version=1)

        self.assertEqual(fact.size(), 1)
        self._test_workspaces(corrected, fact)
    def test_beam_dimensions(self):
        """
        Tests beam dimensions
        """

        corrected, fact = IndirectFlatPlateAbsorption(
            SampleWorkspace=self._red_ws,
            SampleChemicalFormula='H2-O',
            NumberWavelengths=10,
            Events=200,
            BeamHeight=2,
            BeamWidth=3)

        self.assertEqual(fact.size(), 1)
        self._test_workspaces(corrected, fact)
    def test_sample_and_can_subtraction_with_scale(self):
        """
        Tests corrections for the sample and simple container subtraction
        with can scale.
        """

        corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
                                                      SampleChemicalFormula='H2-O',
                                                      CanWorkspace=self._can_ws,
                                                      CanScaleFactor=0.8,
                                                      UseCanCorrections=False,
                                                      Events=200)

        self.assertEqual(fact.size(), 1)
        self._test_workspaces(corrected, fact)
    def test_number_density_for_sample_can(self):
        """
        Test simple run with sample and can workspace and number density for both
        """

        corrected, fact = IndirectFlatPlateAbsorption(SampleWorkspace=self._red_ws,
                                                      SampleChemicalFormula='H2-O',
                                                      SampleDensityType='Mass Density',
                                                      SampleDensity=0.5,
                                                      CanWorkspace=self._can_ws,
                                                      CanChemicalFormula='V',
                                                      CanDensityType='Mass Density',
                                                      CanDensity=0.5,
                                                      UseCanCorrections=True,
                                                      Events=200)

        self.assertEqual(fact.size(), 2)
        self._test_workspaces(corrected, fact)