def to_pg_scheme(self, container=None, positions=None):
        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
        data = pybert.DataContainerERT()
        for nr, (x, y, z) in enumerate(elec_positions):
            data.createSensor((x, y, z))
        data.resize(self.configs.shape[0])
        for index, token in enumerate("abmn"):
            data.set(token, self.configs[:, index].tolist())
        for token in "abmn":
            data.set(token, data(token) - 1)
        return data