Open fschlueter opened 1 month ago
we should loop in @christophwelling . We added more security due to unintended changes by reference that could occur otherwise.
I see, but I think the copy calls in the getter functions should prevent this. We could also add unit tests to catch this
When looking at the
base_trace.py
class it seems to me that we unnecessarily "resetting" either the time domain trace or frequency spectrum with the goal of "to much security".In the getter functions
get_trace()
andget_frequency_spectrum()
we set the other representation to None. This of course avoids to store "the same data twice" but unless we perform any operation on either of them we have to perform unnecessary FFTs if we back and forth request both representations. Since we only can change the data with the setter function (we only return copies of the arrays in the getter functions) it would be sufficient to only set the other representation to None in the setter functions.However, as I said this will increase memory consumption. Is that a limiting factor and the reason for the current implementation or did I miss something? Maybe @cg-laser, @shallmann or @sjoerd-bouma