Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update _coerce_num_samples_if_fifo.py #55

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading