def test_mass_density(self):
        """
        Tests a transmission calculation using mass density
        """
        instrument = "IRIS"
        analyser = "graphite"
        reflection = "002"

        formula = "H2-O"
        density = 1.0
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
                                  ChemicalFormula=formula, DensityType='Mass Density', Density=density, Thickness=thickness)

        ref_result = [6.65800, 0.82122, 2.58186, 53.50693, 56.08880, 0.03342, 0.1, 0.82676, 0.17096]
        mass_values = ws.column(1)
        np.testing.assert_array_almost_equal(mass_values, ref_result, decimal=4)

        # mass density 1.0 = number density 0.033424 for water
        density = 0.033424
        ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
                                  ChemicalFormula=formula, DensityType='Number Density', Density=density, Thickness=thickness)
        num_values = ws.column(1)
        np.testing.assert_array_almost_equal(mass_values, num_values, decimal=4)
Beispiel #2
0
    def test_indirect_transmission_iris_graphite_002(self):
        """
        Test a transmission calculation using IRIS, graphite, 002.
        """

        instrument = "IRIS"
        analyser = "graphite"
        reflection = "002"

        # Using water sample
        formula = "H2-O"
        density = 0.1
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument,
                                  Analyser=analyser,
                                  Reflection=reflection,
                                  ChemicalFormula=formula,
                                  DensityType='Number Density',
                                  Density=density,
                                  Thickness=thickness)

        # Expected values from table
        ref_result = [
            6.658, 0.821223, 2.58187, 53.5069, 56.0888, 0.1, 0.1, 0.566035,
            0.429298
        ]
        values = ws.column(1)
        np.testing.assert_array_almost_equal(values, ref_result, decimal=4)
Beispiel #3
0
    def test_indirect_transmission_basis_silicon_111(self):
        """
        Test a transmission calculation using BASIS, silicon 111.
        """

        instrument = "BASIS"
        analyser = "silicon"
        reflection = "111"

        # Using water sample
        formula = "H2-O"
        density = 0.1
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument,
                                  Analyser=analyser,
                                  Reflection=reflection,
                                  ChemicalFormula=formula,
                                  DensityType='Number Density',
                                  Density=density,
                                  Thickness=thickness)

        # Expected values from table
        ref_result = [
            6.26761, 0.77307, 2.58187, 53.5069, 56.0888, 0.1, 0.1, 0.566307,
            0.429298
        ]
        values = ws.column(1)
        np.testing.assert_array_almost_equal(values, ref_result, decimal=4)
Beispiel #4
0
    def test_indirect_transmission_tosca_graphite_002(self):
        """
        Test a transmission calculation using TOSCA, graphite, 002.
        """

        instrument = "TOSCA"
        analyser = "graphite"
        reflection = "002"

        # Using water sample
        formula = "H2-O"
        density = 0.1
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument,
                                  Analyser=analyser,
                                  Reflection=reflection,
                                  ChemicalFormula=formula,
                                  DensityType='Number Density',
                                  Density=density,
                                  Thickness=thickness)

        # Expected values from table
        ref_result = [
            5.5137, 0.680081, 0.039174, 56.05149, 56.09067, 0.1, 0.1, 0.56682,
            0.42931
        ]
        values = ws.column(1)
        np.testing.assert_array_almost_equal(values, ref_result, decimal=4)
Beispiel #5
0
    def test_mass_density(self):
        """
        Tests a transmission calculation using mass density
        """
        instrument = "IRIS"
        analyser = "graphite"
        reflection = "002"

        formula = "H2-O"
        density = 1.0
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument,
                                  Analyser=analyser,
                                  Reflection=reflection,
                                  ChemicalFormula=formula,
                                  DensityType='Mass Density',
                                  Density=density,
                                  Thickness=thickness)

        ref_result = [
            6.65800, 0.82122, 2.58186, 53.50693, 56.08880, 0.03342, 0.1,
            0.82676, 0.17096
        ]
        mass_values = ws.column(1)
        np.testing.assert_array_almost_equal(mass_values,
                                             ref_result,
                                             decimal=4)

        # mass density 1.0 = number density 0.033424 for water
        density = 0.033424
        ws = IndirectTransmission(Instrument=instrument,
                                  Analyser=analyser,
                                  Reflection=reflection,
                                  ChemicalFormula=formula,
                                  DensityType='Number Density',
                                  Density=density,
                                  Thickness=thickness)
        num_values = ws.column(1)
        np.testing.assert_array_almost_equal(mass_values,
                                             num_values,
                                             decimal=4)
Beispiel #6
0
    def test_mass_density(self):
        """
        Tests a transmission calculation using mass density
        """
        instrument = "IRIS"
        analyser = "graphite"
        reflection = "002"

        formula = "H2-O"
        density = 1.0
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument,
                                  Analyser=analyser,
                                  Reflection=reflection,
                                  ChemicalFormula=formula,
                                  DensityType='Mass Density',
                                  Density=density,
                                  Thickness=thickness)

        ref_result = [
            6.65800, 0.82122, 0.0391739, 56.051493, 56.09067, 0.100283900, 0.1,
            0.56511, 0.43022
        ]
        mass_values = ws.column(1)
        np.testing.assert_array_almost_equal(mass_values,
                                             ref_result,
                                             decimal=4)

        density = 0.100272
        ws = IndirectTransmission(Instrument=instrument,
                                  Analyser=analyser,
                                  Reflection=reflection,
                                  ChemicalFormula=formula,
                                  DensityType='Number Density',
                                  Density=density,
                                  Thickness=thickness)
        num_values = ws.column(1)
        np.testing.assert_array_almost_equal(mass_values,
                                             num_values,
                                             decimal=4)
    def test_mass_density(self):
        """
        Tests a transmission calculation using mass density
        """
        instrument = "IRIS"
        analyser = "graphite"
        reflection = "002"

        formula = "H2-O"
        density = 1.0
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
                                  ChemicalFormula=formula, DensityType='Mass Density', Density=density, Thickness=thickness)

        ref_result = [6.65800, 0.82122, 0.0391739, 56.051493, 56.09067, 0.100283900, 0.1, 0.56511, 0.43022]
        mass_values = ws.column(1)
        np.testing.assert_array_almost_equal(mass_values, ref_result, decimal=4)

        density = 0.100272
        ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
                                  ChemicalFormula=formula, DensityType='Number Density', Density=density, Thickness=thickness)
        num_values = ws.column(1)
        np.testing.assert_array_almost_equal(mass_values, num_values, decimal=4)
    def test_indirect_transmission(self):
        instrument = "IRIS"
        analyser = "graphite"
        reflection = "002"

        #using water sample
        formula = "H2-O"
        density = 0.1
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
                                  ChemicalFormula=formula, NumberDensity=density, Thickness=thickness)

        #expected values from table
        ref_result = [6.658, 0.821223, 2.58187, 53.5069, 56.0888, 0.1, 0.1, 0.566035, 0.429298]
        values = ws.column(1)
        np.testing.assert_array_almost_equal(values, ref_result, decimal=4)
    def test_indirect_transmission_basis_silicon_111(self):
        """
        Test a transmission calculation using BASIS, silicon 111.
        """

        instrument = "BASIS"
        analyser = "silicon"
        reflection = "111"

        # Using water sample
        formula = "H2-O"
        density = 0.1
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
                                  ChemicalFormula=formula, NumberDensity=density, Thickness=thickness)

        # Expected values from table
        ref_result = [6.26761, 0.77307, 2.58187, 53.5069, 56.0888, 0.1, 0.1, 0.566307, 0.429298]
        values = ws.column(1)
        np.testing.assert_array_almost_equal(values, ref_result, decimal=4)
    def test_indirect_transmission_tosca_graphite_002(self):
        """
        Test a transmission calculation using TOSCA, graphite, 002.
        """

        instrument = "TOSCA"
        analyser = "graphite"
        reflection = "002"

        # Using water sample
        formula = "H2-O"
        density = 0.1
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
                                  ChemicalFormula=formula, NumberDensity=density, Thickness=thickness)

        # Expected values from table
        ref_result = [5.5137, 0.680081, 2.58187, 53.5069, 56.0888, 0.1, 0.1, 0.566834, 0.429298]
        values = ws.column(1)
        np.testing.assert_array_almost_equal(values, ref_result, decimal=4)
    def test_indirect_transmission_iris_graphite_002(self):
        """
        Test a transmission calculation using IRIS, graphite, 002.
        """

        instrument = "IRIS"
        analyser = "graphite"
        reflection = "002"

        # Using water sample
        formula = "H2-O"
        density = 0.1
        thickness = 0.1

        ws = IndirectTransmission(Instrument=instrument, Analyser=analyser, Reflection=reflection,
                                  ChemicalFormula=formula, DensityType='Number Density', Density=density, Thickness=thickness)

        # Expected values from table
        ref_result = [6.65800, 0.82122, 0.039174, 56.05149, 56.09067, 0.1, 0.1, 0.56602, 0.42931]
        values = ws.column(1)
        np.testing.assert_array_almost_equal(values, ref_result, decimal=4)