def test_set_pc_from_tsl_oxford(self, pc, convention, desired_pc):
     """PC TSL -> Bruker -> TSL."""
     det = EBSDDetector(pc=pc, convention=convention)
     assert np.allclose(det.pc, desired_pc)
     assert np.allclose(det.pc_tsl(), pc)
     assert np.allclose(
         EBSDDetector(pc=det.pc_tsl(), convention="tsl").pc_tsl(), pc)
    def test_set_pc_from_emsoft(self, shape, pc, px_size, binning, version,
                                desired_pc):
        """PC EMsoft -> Bruker -> EMsoft, also checking to_tsl() and
        to_bruker().
        """
        det = EBSDDetector(
            shape=shape,
            pc=pc,
            px_size=px_size,
            binning=binning,
            convention=f"emsoft{version}",
        )

        assert np.allclose(det.pc, desired_pc, atol=1e-2)
        assert np.allclose(det.pc_emsoft(version=version), pc, atol=1e-2)
        assert np.allclose(det.pc_bruker(), desired_pc, atol=1e-2)

        pc_tsl = deepcopy(det.pc)
        pc_tsl[..., 1] = 1 - pc_tsl[..., 1]
        assert np.allclose(det.pc_tsl(), pc_tsl, atol=1e-2)
        assert np.allclose(det.pc_oxford(), pc_tsl, atol=1e-2)