@@ -26,7 +26,7 @@ def update_stimulus(is_enabled: bool, signal_output: int = 1, signal_input: Opti
26
26
Args:
27
27
is_enabled: True to enable and False to disable.
28
28
signal_output: One of the two outputs on the device.
29
- signal_intput : One of the two inputs on the device.
29
+ signal_input : One of the two inputs on the device.
30
30
amplitude: Amplitude in volts, allowed values are 0.0 - 1.5 V.
31
31
demodulator: Which demodulator used to connect to the signal output to.
32
32
"""
@@ -56,7 +56,7 @@ def set_stimulus_oscillator_frequency(frequency: float, oscillator: int = 1) ->
56
56
57
57
58
58
def update_scope (period : Optional [float ] = None , sample_rate : Optional [float ] = 27e3 ,
59
- input_channels : Optional [Dict [int , str ]] = { 'Demod 1 R' : 1 } ,
59
+ input_channels : Optional [Dict [str , int ]] = None ,
60
60
input_ranges : Optional [Tuple [float , float ]] = (1.0 , 1.0 ),
61
61
limits : Optional [Tuple [float , float ]] = (0.0 , 1.0 ),
62
62
trigger_enabled : Optional [bool ] = False , trigger_level : Optional [float ] = 0.5 ):
@@ -71,6 +71,12 @@ def update_scope(period: Optional[float] = None, sample_rate: Optional[float] =
71
71
trigger_enabled: Will enable the external triggering on 'Trigger input 1' if True.
72
72
trigger_level: The level of the trigger in Volt.
73
73
"""
74
+ if period is not None :
75
+ scope_reader .period = period
76
+
77
+ if input_channels is None :
78
+ input_channels = {'Demod 1 R' : 1 }
79
+
74
80
nearest_sample_rate = scope_reader .get_nearest_sample_rate (sample_rate )
75
81
scope_reader .sample_rate = nearest_sample_rate
76
82
@@ -80,8 +86,6 @@ def update_scope(period: Optional[float] = None, sample_rate: Optional[float] =
80
86
81
87
[scope_reader .set_channel_limits (channel , * limits ) for channel in unique_channels ]
82
88
[scope_reader .set_input_signal (channel , attribute ) for (attribute , channel ) in input_channels .items ()]
83
- if period :
84
- scope_reader .period = period
85
89
86
90
scope_reader .trigger_enabled = trigger_enabled
87
91
scope_reader .trigger_channel = 'Trig Input 1'
@@ -90,7 +94,7 @@ def update_scope(period: Optional[float] = None, sample_rate: Optional[float] =
90
94
scope_reader .trigger_delay = 0
91
95
92
96
93
- ## Settings
97
+ # Settings
94
98
95
99
class HardwareSettings (Instrument ):
96
100
@@ -109,25 +113,25 @@ def __init__(self, name='settings'):
109
113
110
114
working_directory = "D:\\ Workspace\\ TNO\\ git\\ DEM-943\\ qtt\\ docs\\ notebooks\\ unfinished"
111
115
112
- ## Lock-in Amplifier
116
+ # Lock-in Amplifier
113
117
114
- UHFLI_id = 'dev2338'
115
- file_path_UHFLI = os .path .join (working_directory , f'UHFLI_{ UHFLI_id } .dat' )
116
- UHFLI_configuration = load_configuration (file_path_UHFLI )
118
+ uhfli_id = 'dev2338'
119
+ file_path_UHFLI = os .path .join (working_directory , f'UHFLI_{ uhfli_id } .dat' )
120
+ uhfli_configuration = load_configuration (file_path_UHFLI )
117
121
118
- stimulus = UHFLIStimulus (UHFLI_id )
119
- stimulus .initialize (UHFLI_configuration )
120
- scope_reader = UHFLIScopeReader (UHFLI_id )
122
+ stimulus = UHFLIStimulus (uhfli_id )
123
+ stimulus .initialize (uhfli_configuration )
124
+ scope_reader = UHFLIScopeReader (uhfli_id )
121
125
122
126
123
- ## AWG
127
+ # AWG
124
128
125
- HDAWG8_id = 'dev8048'
126
- file_path_HDAWG8 = os .path .join (working_directory , f'HDAWG8_{ HDAWG8_id } .dat' )
127
- HDAWG8_configuration = load_configuration (file_path_HDAWG8 )
129
+ hdawg8_id = 'dev8048'
130
+ file_path_HDAWG8 = os .path .join (working_directory , f'HDAWG8_{ hdawg8_id } .dat' )
131
+ hdawg8_configuration = load_configuration (file_path_HDAWG8 )
128
132
129
- awg_adapter = InstrumentAdapterFactory .get_instrument_adapter ('ZIHDAWG8InstrumentAdapter' , HDAWG8_id )
130
- awg_adapter .apply (HDAWG8_configuration )
133
+ awg_adapter = InstrumentAdapterFactory .get_instrument_adapter ('ZIHDAWG8InstrumentAdapter' , hdawg8_id )
134
+ awg_adapter .apply (hdawg8_configuration )
131
135
132
136
awg_adapter .instrument .warnings_as_errors .append (WARNING_ANY )
133
137
@@ -144,7 +148,7 @@ def __init__(self, name='settings'):
144
148
awg_adapter .instrument .awgs_0_time (awg_sampling_rate_586KHz )
145
149
146
150
147
- ## Virtual AWG
151
+ # Virtual AWG
148
152
149
153
settings = HardwareSettings ()
150
154
virtual_awg = VirtualAwg ([awg_adapter .instrument ], settings )
@@ -156,7 +160,7 @@ def __init__(self, name='settings'):
156
160
virtual_awg .digitizer_marker_uptime (marker_uptime )
157
161
158
162
159
- ## Station
163
+ # Station
160
164
161
165
gates = VirtualIVVI ('gates' , gates = ['P1' , 'P2' ], model = None )
162
166
station = Station (virtual_awg , scope_reader .adapter .instrument , awg_adapter .instrument , gates )
0 commit comments