Esempio n. 1
0
    def test_scale(self):
        wks = SimulatedDensityOfStates(PHONONFile=self._phonon_file,
                                       Scale=10)
        ref = SimulatedDensityOfStates(PHONONFile=self._phonon_file)
        ref = Scale(ref, Factor=10)

        self.assertEqual(CheckWorkspacesMatch(wks, ref), 'Success!')
Esempio n. 2
0
    def test_sum_partial_contributions_cross_section_scale(self):
        spec_type = 'DOS'
        tolerance = 1e-10

        summed = DensityOfStates(File=self._file_name, SpectrumType=spec_type, Ions='H,C,O', SumContributions=True, ScaleByCrossSection='Incoherent')
        total = DensityOfStates(File=self._file_name,  SpectrumType=spec_type, ScaleByCrossSection='Incoherent')

        self.assertEquals(CheckWorkspacesMatch(summed, total, tolerance), 'Success!')
Esempio n. 3
0
    def test_sum_partial_contributions(self):
        spec_type = 'DOS'
        tolerance = 1e-10

        summed = DensityOfStates(File=self._file_name, SpectrumType=spec_type, Ions='H,C,O', SumContributions=True)
        total = DensityOfStates(File=self._file_name,  SpectrumType=spec_type)

        self.assertEquals(CheckWorkspacesMatch(summed, total, tolerance), 'Success!')
 def test_input_not_modified(self):
     backup = CloneWorkspace(self._input_ws)
     outputWorkspaceName = "output_ws"
     alg_test = run_algorithm("ComputeCalibrationCoefVan", VanadiumWorkspace=self._input_ws,
                              EPPTable=self._table, OutputWorkspace=outputWorkspaceName)
     self.assertTrue(alg_test.isExecuted())
     self.assertEqual("Success!", CheckWorkspacesMatch(backup, self._input_ws))
     DeleteWorkspace(backup)
Esempio n. 5
0
    def test_ion_table(self):
        ws = DensityOfStates(File=self._file_name, SpectrumType='IonTable')

        # Build the expected output
        expected = CreateEmptyTableWorkspace()
        expected.addColumn('str', 'Ion')
        expected.addColumn('int', 'Count')
        expected.addRow(['H', 4])
        expected.addRow(['C', 8])
        expected.addRow(['O', 8])

        self.assertEquals(CheckWorkspacesMatch(ws, expected), 'Success!')
Esempio n. 6
0
    def test_scale(self):
        ws = DensityOfStates(File=self._file_name, Scale=10)
        ref = DensityOfStates(File=self._file_name)
        ref = Scale(ref, Factor=10)

        self.assertEqual(CheckWorkspacesMatch(ws, ref), 'Success!')