File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,10 @@ def state(self):
230
230
return self .get_state ()
231
231
232
232
def get_state (self ,include_registers = False ):
233
+ if self .phase0 is None :
234
+ reference_sequence_number = - 1
235
+ else :
236
+ reference_sequence_number = int (self .phase0 )
233
237
roach_state = StateDict (boffile = self .boffile ,
234
238
heterodyne = self .heterodyne ,
235
239
adc_sample_rate = self .fs * 1e6 , # roach still uses MHz, so convert to Hz
@@ -246,7 +250,7 @@ def get_state(self,include_registers=False):
246
250
debug_register = self .debug_register ,
247
251
fft_shift_register = self .fft_shift_register ,
248
252
hardware_delay_samples = self .hardware_delay_samples ,
249
- reference_sequence_number = int ( self . phase0 )
253
+ reference_sequence_number = reference_sequence_number
250
254
)
251
255
if include_registers :
252
256
for register in self .initial_values_for_writeable_registers :
Original file line number Diff line number Diff line change @@ -40,8 +40,11 @@ def test_precomputed_wavenorm(self):
40
40
assert self .ri .wavenorm >= 0.99 * actual_wavenorm # guarantees the wave won't overflow
41
41
42
42
def test_calculate_modulation_period (self ):
43
- roach_state = core .StateDict (modulation_rate = 7 , modulation_output = 2 )
43
+ roach_state = core .StateDict (modulation_rate = 7 , modulation_output = 2 , heterodyne = True )
44
44
assert calculate .modulation_period_samples (roach_state ) == 256
45
+ roach_state = core .StateDict (modulation_rate = 7 , modulation_output = 2 , heterodyne = False )
46
+ assert calculate .modulation_period_samples (roach_state ) == 128
47
+
45
48
46
49
def test_get_measurement_blocks (self ):
47
50
num_tones = 32
You can’t perform that action at this time.
0 commit comments