def METHOD_NAME(self, field_component, real, imag, invert):
    """Set Field component Real and imaginary parts."""
    if field_component in self.re:
        if invert:
            self.re[field_component] = [str(-float(i)) for i in real]
            self.im[field_component] = [str(-float(i)) for i in imag]
        else:
            self.re[field_component] = real
            self.im[field_component] = imag
    else:
        print("Error in set_field_component function.")