mirror of
https://gitlab.science.ru.nl/mthesis-edeboone/m-thesis-introduction.git
synced 2024-12-22 03:23:34 +01:00
Simu: add raw_time func to DigiSignal
This commit is contained in:
parent
73b7fcb601
commit
d0817560ae
1 changed files with 5 additions and 2 deletions
|
@ -82,11 +82,14 @@ class DigitisedSignal(Signal):
|
|||
def __len__(self):
|
||||
return self.sample_length
|
||||
|
||||
def raw_time(self):
|
||||
return np.arange(0, self.time_length, 1/self.sample_rate)
|
||||
|
||||
def _translate(self, t_f = None, x_f = None, t_0 = None, x_0 = None, velocity = None):
|
||||
"""
|
||||
Translate the signal from (t_0, x_0) to (t_f, x_f) with optional velocity.
|
||||
|
||||
Returns the signal at (t_f, x_f)
|
||||
Returns the signal at (t_f, x_f) and the total time offset
|
||||
"""
|
||||
|
||||
total_time_offset = self.total_time_offset(t_f=t_f, x_f=x_f, t_0=t_0, x_0=x_0, velocity=velocity)
|
||||
|
@ -137,7 +140,7 @@ class DigitisedSignal(Signal):
|
|||
amplitude = self.raw[n_offset_int]
|
||||
|
||||
if not self.periodic:
|
||||
if hasattr(amplitude, 'ndim'):
|
||||
if hasattr(amplitude, 'ndim') and amplitude.ndim > 0:
|
||||
amplitude[mask_idx] = 0
|
||||
|
||||
return amplitude, total_time_offset
|
||||
|
|
Loading…
Reference in a new issue