one with everything

This commit is contained in:
a.ott
2020-07-04 11:28:33 +02:00
parent 189293ff0e
commit ce03ab68c5
34 changed files with 2103 additions and 261 deletions

View File

@@ -1,6 +1,7 @@
from stimuli.AbstractStimulus import AbstractStimulus
import numpy as np
from numba import jit, njit
from warnings import warn
class SinusAmplitudeModulationStimulus(AbstractStimulus):
@@ -67,8 +68,9 @@ def convert_to_array(carrier_freq, amplitude, modulation_freq, contrast, start_t
idx_end = (am_end - time_start) / step_size_s
if idx_start != round(idx_start) or idx_end != round(idx_end):
raise ValueError("Didn't calculate integers when searching the start and end index. start:", idx_start, "end:", idx_end)
# print("am_start: {:.0f}, am_end: {:.0f}, length: {:.0f}".format(am_start, am_end, am_end-am_start))
warn("Didn't calculate integers when searching the start and end index. start: {} end: {}".format(idx_start, idx_end))
# raise ValueError("Didn't calculate integers when searching the start and end index. start:", idx_start, "end:", idx_end)
# print("am_start: {:.0f}, am_end: {:.0f}, length: {:.0f}".format(am_start, am_end, am_end-am_start))
idx_start = int(idx_start)
idx_end = int(idx_end)