def test_transmission_normalisation_intensities(scan: Scan2D, transmission): """ Make sure that we can correct for the attenuation of the beam. The transmission values have been manually read from the .nxs file using a GUI. """ intensity_0 = np.copy(scan.intensity) scan.transmission_normalisation() for i, intensity in enumerate(scan.intensity): assert intensity == intensity_0[i] / transmission
def test_transmission_normalisation_errors(scan: Scan2D, transmission): """ Make sure that we can correct for the attenuation of the beam. The transmission values have been manually read from the .nxs file using a GUI. This function checks the intensity_e values have been dealt with properly. """ intensity_e_0 = np.copy(scan.intensity_e) scan.transmission_normalisation() for i, intensity_e in enumerate(scan.intensity_e): assert intensity_e == intensity_e_0[i] / transmission
def test_profile_transmission_normalisation(profile_01: Profile, scan2d_from_nxs_01: Scan2D): """ Assert that carrying out a transmission normalisation on an instance of Profile is the same thing as doing it on each of its constituent scans. """ profile_01.transmission_normalisation() scan2d_from_nxs_01.transmission_normalisation() assert_allclose(profile_01.intensity, scan2d_from_nxs_01.intensity) assert_allclose(profile_01.intensity_e, profile_01.intensity_e)