Skip to content

Commit

Permalink
Merge pull request #278 from BBN-Q/fix/mixer-correct
Browse files Browse the repository at this point in the history
Set amp factor and phase skew
  • Loading branch information
Diego Ristè authored Sep 7, 2018
2 parents 0500eea + 7d73d08 commit f6a2c7e
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/auspex/instruments/bbn.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ class APS2(Instrument, metaclass=MakeSettersGetters):
seq_file: test.h5 # optional sequence file
tx_channels: # All transmit channels
'12': # Quadrature channel name (string)
phase_skew: 0.0 # (deg) - Used by QGL
amp_factor: 1.0 # Used by QGL
phase_skew: 0.0 # (deg) - directly set in the instrument
amp_factor: 1.0 # directly set in the instrument
delay: 0.0 # (s) - Used by QGL
'1':
enabled: true
Expand Down Expand Up @@ -511,6 +511,14 @@ def set_all(self, settings_dict, prefix=""):
main_quad_dict = quad_channels.pop('12', None)
if not main_quad_dict:
raise ValueError("APS2 {} expected to receive quad channel '12'".format(self))
# Set properties of the channel pair
if 'delay' in main_quad_dict: # this is set in QGL
main_quad_dict.pop('delay')
for attr, value in main_quad_dict.items():
try:
getattr(self, 'set_' + attr)(value)
except AttributeError:
pass

# Set the properties of individual hardware channels (offset, amplitude)
for chan_num, chan_name in enumerate(['1', '2']):
Expand Down Expand Up @@ -606,6 +614,20 @@ def sampling_rate(self, value):
def fpga_temperature(self):
return self.wrapper.get_fpga_temperature()

@property
def amp_factor(self):
return self.wrapper.get_mixer_amplitude_imbalance()
@amp_factor.setter
def amp_factor(self, amp):
self.wrapper.set_mixer_amplitude_imbalance(amp)

@property
def phase_skew(self):
return self.wrapper.get_mixer_phase_skew()
@phase_skew.setter
def phase_skew(self, skew):
self.wrapper.set_mixer_phase_skew(skew)

class TDM(APS2):
"""BBN TDM"""
instrument_type = "AWG"
Expand Down

0 comments on commit f6a2c7e

Please sign in to comment.