diff --git a/python/pysmurf/client/command/smurf_command.py b/python/pysmurf/client/command/smurf_command.py index d8f4a1e65..1610222a1 100644 --- a/python/pysmurf/client/command/smurf_command.py +++ b/python/pysmurf/client/command/smurf_command.py @@ -4328,7 +4328,7 @@ def get_amp_gate_voltage(self, amp): volts = bit_to_volt * bits return volts - def set_amp_gate_voltage(self, amp, voltage, override = False): + def set_amp_gate_voltage(self, amp, voltage, override = False, **kwargs): """ Set the voltage out one of the RTM DACs, into the cryocard, such that the voltage out the cryocard is the given voltage. @@ -4368,13 +4368,13 @@ def set_amp_gate_voltage(self, amp, voltage, override = False): bits = -2**(nbits-1) self.log(f'Setting hemt or hemt1 gate to {bits} bits given {voltage} volts.') - self._caput(self.rtm_spi_max_root + self._rtm_33_data_reg, bits) + self._caput(self.rtm_spi_max_root + self._rtm_33_data_reg, bits, **kwargs) elif amp == '50k': dac_num = self.config.config['amplifier']['dac_num_50k'] bit_to_volt = self.config.config['amplifier']['bit_to_V_50k'] bits = voltage / bit_to_volt - self.set_rtm_slow_dac_data(dac_num, bits) + self.set_rtm_slow_dac_data(dac_num, bits, **kwargs) else: min = self.config.get('amplifier')[amp]['gate_volt_min'] @@ -4387,7 +4387,7 @@ def set_amp_gate_voltage(self, amp, voltage, override = False): bit_to_volt = self.config.get('amplifier')[amp]['gate_bit_to_volt'] bits = voltage / bit_to_volt self.log(f'Setting {amp} gate to {bits} via DAC {dac_num}, given {voltage} Volts') - self.set_rtm_slow_dac_data(dac_num, bits) + self.set_rtm_slow_dac_data(dac_num, bits, **kwargs) def get_amp_drain_voltage(self, amp): """ @@ -4657,13 +4657,13 @@ def get_hemt_bias(self): self.log('get_hemt_bias: Deprecated. Calling get_amp_gate_voltage("hemt")') return self.get_amp_gate_voltage('hemt') - def set_amplifier_bias(self, bias_hemt = None, bias_50k = None): + def set_amplifier_bias(self, bias_hemt = None, bias_50k = None, **kwargs): self.log('set_amplifier_bias: Deprecated. Calling set_amp_gate_voltage') if bias_hemt is not None: - self.set_amp_gate_voltage('hemt', bias_hemt) + self.set_amp_gate_voltage('hemt', bias_hemt, **kwargs) if bias_50k is not None: - self.set_amp_gate_voltage('50k', bias_50k) + self.set_amp_gate_voltage('50k', bias_50k, **kwargs) def get_amplifier_bias(self): self.log('get_amplifier_bias: Deprecated. Calling get_amplifier_biases') diff --git a/python/pysmurf/client/util/smurf_util.py b/python/pysmurf/client/util/smurf_util.py index b2f57b8be..b0117f22c 100644 --- a/python/pysmurf/client/util/smurf_util.py +++ b/python/pysmurf/client/util/smurf_util.py @@ -3091,10 +3091,8 @@ def why(self): Why not? """ util_dir = os.path.dirname(__file__) - aphorisms = np.loadtxt(os.path.join(util_dir, 'aphorism.txt'), - dtype='str', delimiter='\n') - - aph = np.random.choice(aphorisms) + aphorisms = open(os.path.join(util_dir, 'aphorism.txt'),'r').readlines() + aph = np.random.choice(aphorisms).rstrip() self.log(aph) return (aph) diff --git a/scratch/eyy/test_scripts/profile_slot.py b/scratch/eyy/test_scripts/profile_slot.py index 460dcea42..abf569bcf 100644 --- a/scratch/eyy/test_scripts/profile_slot.py +++ b/scratch/eyy/test_scripts/profile_slot.py @@ -171,10 +171,10 @@ def replace_str(filename, search_str, replace_str): return html_path -def run(epics_root, config_file, shelf_manager, setup, - no_find_freq=False, bands=np.arange(8), subband_low=13, subband_high=115, - no_setup_notches=False, reset_rate_khz=4, n_phi0=4, threading_test=False, - loopback=False): +def run(epics_root, config_file, shelf_manager, setup, no_band_off=False, + no_find_freq=False, bands=np.arange(8), subband_low=52, subband_high=46, + no_setup_notches=False, reset_rate_khz=4, n_phi0=4, threading_test=False, + loopback=False): """ """ # Storage dictionary @@ -245,7 +245,6 @@ def execute(status_dict, func, label, save_dict=True): if setup: status = execute(status, lambda: S.setup(), 'setup') - # amplifier biases status = execute(status, lambda: S.set_amplifier_bias(write_log=True), 'set_amplifier_bias') @@ -268,7 +267,7 @@ def execute(status_dict, func, label, save_dict=True): # find_freq if not no_find_freq: - subband = np.arange(13, 115) + subband = np.arange(subband_low, subband_high) if subband_low is not None and subband_high is not None: subband = np.arange(subband_low, subband_high) status['subband'] = subband