Skip to content

Commit

Permalink
Update _coerce_num_samples_if_fifo.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ascnave authored Feb 22, 2024
1 parent cca32a7 commit f299945
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/spectrumdevice/devices/digitiser/digitiser_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ def set_post_trigger_length_in_samples(self, length_in_samples: int) -> None:
self.write_to_spectrum_device_register(SPC_POSTTRIGGER, length_in_samples)

def _coerce_num_samples_if_fifo(self, value: int) -> int:
if self.acquisition_mode == AcquisitionMode.SPC_REC_FIFO_MULTI:
if value != mod(value, get_memsize_step_size(self._model_number)):
logger.warning(
f"FIFO mode: coercing length to nearest {get_memsize_step_size(self._model_number)}" f" samples"
)
value = int(value - mod(value, get_memsize_step_size(self._model_number)))
return value
if self.acquisition_mode == AcquisitionMode.SPC_REC_FIFO_MULTI:
if mod(value, get_memsize_step_size(self._model_number)) != 0:
logger.warning(
f"FIFO mode: coercing length to nearest {get_memsize_step_size(self._model_number)}" f" samples"
)
value = int(value - mod(value, get_memsize_step_size(self._model_number)))
return value

@property
def number_of_averages(self) -> int:
Expand Down

0 comments on commit f299945

Please sign in to comment.