allow non int indexes as simulation time may not be a multiple of the sampling time (TODO fix the simulation time?)

This commit is contained in:
AlexanderOtt 2020-04-02 10:03:48 +02:00
parent 42ee462016
commit 6ae9781cec

View File

@ -63,7 +63,8 @@ def convert_to_array(frequency, amplitude, contrast, start_time, duration, time_
idx_end = (am_end - time_start) / step_size_s idx_end = (am_end - time_start) / step_size_s
if idx_start != round(idx_start) or idx_end != round(idx_end): 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) pass
# 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)) # print("am_start: {:.0f}, am_end: {:.0f}, length: {:.0f}".format(am_start, am_end, am_end-am_start))
idx_start = int(idx_start) idx_start = int(idx_start)