Changes load to resistance mode and sets resistance value.
        Rounds to nearest 0.01 Ohms

        :param resistance: Load Resistance in Ohms (0-500 ohms)
        :return: None
340458
def set_load_resistance(self, resistance):
        
        new_val = int(round(resistance * 100))
        if not 0 <= new_val <= 50000:
            raise ValueError("Load Resistance should be between 0-500 ohms")
        self._load_mode = self.SET_TYPE_RESISTANCE
        self._load_value = new_val
        self.__set_parameters()
394372
def q_sign(self):
        
        if self.reactive_power_mode.lower() == 'inductive':
            return -1
        elif self.reactive_power_mode.lower() == 'capacitive':
            return 1
        else:
            raise ValueError("Unknown value {} in reactive_power_mode".format(
                self.reactive_power_mode))
324043
def set_operation_voltage_level(self):
        

        mv_station_v_level_operation = float(cfg_ding0.get('mv_routing_tech_constraints',
                                                           'mv_station_v_level_operation'))

        self.v_level_operation = mv_station_v_level_operation * self.grid.v_level
975650
def set_defaults(self):
        
        self['mswitch'] = 1
        self['elem'] = '../grid/elem.dat'
        self['elec'] = '../grid/elec.dat'
        self['volt'] = '../mod/volt.dat'
        self['inv_dir'] = '../inv'
        self['diff_inv'] = 'F ! difference inversion?'
        self['iseed_var'] = 'iseed variance'
        self['cells_x'] = '0    ! # cells in x-direction'
        self['cells_z'] = '-1    ! # cells in z-direction'
        self['ani_x'] = '1.000  ! smoothing parameter in x-direction'
        self['ani_z'] = '1.000  ! smoothing parameter in z-direction'
        self['max_it'] = '20    ! max. nr of iterations'
        self['dc_inv'] = 'F     ! DC inversion?'
        self['robust_inv'] = 'T     ! robust inversion?'
        self['fpi_inv'] = 'F     ! final phase improvement?'
        self['mag_rel'] = '5'
        self['mag_abs'] = '1e-3'
        self['pha_a1'] = 0
        self['pha_b'] = 0
        self['pha_rel'] = 0
        self['pha_abs'] = 0
        self['hom_bg'] = 'F'
        self['hom_mag'] = '10.00'
        self['hom_pha'] = '0.00'
        self['another_ds'] = 'F'
        self['d2_5'] = '1'
        self['fic_sink'] = 'F'
        self['fic_sink_node'] = '10000'
        self['boundaries'] = 'F'
        self['boundaries_file'] = 'boundary.dat'
        self['mswitch2'] = '1'
        self['lambda'] = 'lambda'
685668
def setParameter(self, parameterName, index, parameterValue):
    
    spec = self.getSpec()
    if parameterName not in spec['parameters']:
      raise Exception("Unknown parameter: " + parameterName)

    setattr(self, parameterName, parameterValue)
307861
def set_current_limit(self, value, channel=1):
        
        cmd = "I%d %f" % (channel, value)
        self.write(cmd)
1119510
def __set_parameters(self):
        
        self.__set_buffer_start(self.CMD_SET_PARAMETERS)
        # Can I send 0xFF as address to not change it each time?
        # Worry about writing to EEPROM or Flash with each address change.
        # Would then implement a separate address only change function.
        self.STRUCT_SET_PARAMETERS.pack_into(self.__out_buffer, self.OFFSET_PAYLOAD,
                                             self._max_current, self._max_power, self.address,
                                             self._load_mode, self._load_value)
        self.__set_checksum()
        self.__send_buffer()
        self.update_status()
1331317
def set_current(self, channel, value, unit='A'):
        '''
        '''
        dac_offset = self._ch_cal[channel]['DAC']['offset']
        dac_gain = self._ch_cal[channel]['DAC']['gain']
        if unit == 'raw':
            value = value
        elif unit == 'A':
            value = int((-value * 1000000 - dac_offset) / dac_gain)  # fix sign of output
        elif unit == 'mA':
            value = int((-value * 1000 - dac_offset) / dac_gain)  # fix sign of output
        elif unit == 'uA':
            value = int((-value - dac_offset) / dac_gain)  # fix sign of output
        else:
            raise TypeError("Invalid unit type.")

        self._set_dac_value(channel=channel, value=value)
19763
def _setload(l: Loader, value, type_) -> Set:
    
    t = type_.__args__[0]
    return {l.load(i, t) for i in value}
1131663
def set_voltage(self, volt, ramp=False):
        
        if ramp:
            self.mon.RampVoltage(self.mon.start_voltage, volt)
        else:
            self.mon.SetVoltage(volt)
881585
def set_heater(self, heater):
        
        if type(heater) != int and heater not in range(0, 101):
            raise InvalidInput("Heater value must be int between 0-100")
        self._config['heater'] = heater
        self._q.put(self._config)
230337
def power(n)
      raise ArgumentError, 'Cannot raise a temperature to a power' if temperature?
      raise ArgumentError, 'Exponent must an Integer' unless n.is_a?(Integer)
      return inverse if n == -1
      return 1 if n.zero?
      return self if n == 1
      return (1..(n - 1).to_i).inject(self) { |acc, _elem| acc * self } if n >= 0
      (1..-(n - 1).to_i).inject(self) { |acc, _elem| acc / self }
    end
685273
def set_solenoid(self, solenoid):
        
        if type(solenoid) != bool:
            raise InvalidInput("Solenoid value must be bool")
        self._config['solenoid'] = bool2int(solenoid)
        self._q.put(self._config)
1342434
def SetMaxPowerUpCurrent(self, i):
        
        if i < 0 or i > 8:
            raise MonsoonError(("Target max current %sA, is out of acceptable "
                                "range [0, 8].") % i)
        val = 1023 - int((i / 8) * 1023)
        self._SendStruct("BBB", 0x01, 0x08, val & 0xff)
        self._SendStruct("BBB", 0x01, 0x09, val >> 8)
288451
def setParameter(self, objID, param, value):
        
        self._connection._beginMessage(self._cmdSetID, tc.VAR_PARAMETER, objID,
                                       1 + 4 + 1 + 4 + len(param) + 1 + 4 + len(value))
        self._connection._string += struct.pack("!Bi", tc.TYPE_COMPOUND, 2)
        self._connection._packString(param)
        self._connection._packString(value)
        self._connection._sendExact()
467889
def set_voltage(self, value, channel=1):
        
        cmd = "V%d %f" % (channel, value)
        self.write(cmd)
1266003
def update_control_board_calibration(control_board, fitted_params):
    '''
    
    '''
    # Update the control board with the new fitted capacitor and resistor
    # values for the reference load analog input (channel 0).
    control_board.a0_series_resistance = fitted_params['fitted R'].values
    control_board.a0_series_capacitance = fitted_params['fitted C'].values