Skip to content

Commit

Permalink
Merge branch 'main' into issue773
Browse files Browse the repository at this point in the history
  • Loading branch information
swh76 authored May 30, 2023
2 parents ea652c6 + 4144146 commit 11d8cd1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
14 changes: 7 additions & 7 deletions python/pysmurf/client/command/smurf_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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']
Expand All @@ -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):
"""
Expand Down Expand Up @@ -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')
Expand Down
6 changes: 2 additions & 4 deletions python/pysmurf/client/util/smurf_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
11 changes: 5 additions & 6 deletions scratch/eyy/test_scripts/profile_slot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand All @@ -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
Expand Down

0 comments on commit 11d8cd1

Please sign in to comment.