Skip to content

Commit

Permalink
Time shift when trimming fast output data
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Feb 27, 2020
1 parent f96f19a commit d757540
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ROSCO_toolbox/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,18 @@ def trim_output(self, info, data, tmin=0, tmax=100000):
data : ndarray
input data ndarray with values trimed to times tmin and tmax
'''
# initial time array and associated index
time_init = np.ndarray.flatten(data[:, info['channels'].index('Time')])
Tinds = np.where(time_init<=tmin)
Tinds = np.append(Tinds, np.where(time_init>=tmax))
tvals = [time.tolist() for time in time_init[Tinds]]

# Delete all vales in data where time is not in desired range
data = np.delete(data, Tinds, 0)

# Reset time vector to zero
data[:, info['channels'].index('Time')] = np.ndarray.flatten(
data[:, info['channels'].index('Time')]) - 50
return data
class FileProcessing():
"""
Expand Down

0 comments on commit d757540

Please sign in to comment.