<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_bfield(self, B_G):
 """Set the strength of the local magnetic field. **Call signature** *B_G* The magnetic field strength, in Gauss Returns *self* for convenience in chaining. """

        if not (B_G > 0):
            raise ValueError('must have B_G > 0; got %r' % (B_G,))

        self.in_vals[IN_VAL_B] = B_G
        return self