Convert the configuration to a pygimli measurement scheme

        Parameters
        ----------
        container: reda.containers.ERT.ERT
            an ERT data container (we take the electrode positions from here)
        positions = None

        Returns
        -------
        data: pybert.DataContainerERT

        Examples
        --------

            import numpy as np
            from reda.configs.configManager import ConfigManager
            configs = ConfigManager(nr_of_electrodes=48)
            new_configs = configs.gen_dipole_dipole(skipc=2)
            x = np.arange(0, 48, 1)
            z = np.ones(48) * -1
            y = np.zeros(48)
            xyz = np.vstack((x, y, z)).T
            scheme = configs.to_pg_scheme(positions=xyz)
            print(scheme)

def to_pg_scheme(self, container=None, positions=None):
        """Convert the configuration to a pygimli measurement scheme

        Parameters
        ----------
        container: reda.containers.ERT.ERT
            an ERT data container (we take the electrode positions from here)
        positions = None

        Returns
        -------
        data: pybert.DataContainerERT

        Examples
        --------

            import numpy as np
            from reda.configs.configManager import ConfigManager
            configs = ConfigManager(nr_of_electrodes=48)
            new_configs = configs.gen_dipole_dipole(skipc=2)
            x = np.arange(0, 48, 1)
            z = np.ones(48) * -1
            y = np.zeros(48)
            xyz = np.vstack((x, y, z)).T
            scheme = configs.to_pg_scheme(positions=xyz)
            print(scheme)


        """
        if container is None and positions is None:
            raise Exception('electrode positions are required for BERT export')

        if container is not None and container.electrodes is None:
            raise Exception('container does not contain electrode positions')

        if container is not None and positions is not None:
            raise Exception(
                'only one of container OR positions must be provided')

        if container is not None:
            elec_positions = container.electrodes.values
        elif positions is not None:
            elec_positions = positions

        opt_import("pybert", requiredFor="")
        import pybert

        # Initialize BERT DataContainer
        data = pybert.DataContainerERT()

        # Define electrodes (48 electrodes spaced by 0.5 m)
        for nr, (x, y, z) in enumerate(elec_positions):
            data.createSensor((x, y, z))

        # Define number of measurements
        data.resize(self.configs.shape[0])

        for index, token in enumerate("abmn"):
            data.set(token, self.configs[:, index].tolist())

        # account for zero indexing
        for token in "abmn":
            data.set(token, data(token) - 1)

        # np.vstack([data.get(x).array() for x in ("abmn")]).T
        return data