lib/transient.py
def crop_time_scale(self):  # todo: fix the overwriting issue
        """chops time scale to the monotonous central behaviour, deleting the wierd ends.
        ATTENTION: overwrites self.time and self.trace, deleting any previous changes"""

        # clear previous time and trace, and the analysis log since it goes lost
        self.analysis_log = {}  # reset log
        self.time = []  # reset time and trace
        self.trace = []
        # print('crop time scale, len: ' + str(len(self.raw_time)))
        maxT = max(self.raw_time)
        minT = min(self.raw_time)

        # pick the type of behaviour. redred scans will always be false in this statement
        if self.raw_time[0] < self.raw_time[1]:
            start = 0
            while self.raw_time[start] < maxT:
                start += 1
            end = start
            while self.raw_time[end] > minT:
                end += 1
            i = 0
            while i in range(end - start):
                self.time.append(self.raw_time[i + start])
                self.trace.append(self.raw_trace[i + start])
                i += 1
        elif self.raw_time[0] > self.raw_time[1]:
            start = 0
            while self.raw_time[start] > minT:
                start += 1
            end = start
            while self.raw_time[end] < maxT:
                end += 1
            i = 0
            while i in range(end - start):
                self.time.append(self.raw_time[i + start])
                self.trace.append(self.raw_trace[i + start])
                i += 1
        self.log_it('Crop Time Scale', maxtime=maxT, mintime=minT)
chops time scale to the monotonous central behaviour, deleting the wierd ends.
        ATTENTION: overwrites self.time and self.trace, deleting any previous changes
chops time scale to the monotonous central behaviour, deleting the wierd ends.
chops time scale to the monotonous central behaviour deleting the wierd ends .
def crop_time_scale(self):  
        self.analysis_log = {}  
        self.time = []  
        self.trace = []
        maxT = max(self.raw_time)
        minT = min(self.raw_time)
        if self.raw_time[0] < self.raw_time[1]:
            start = 0
            while self.raw_time[start] < maxT:
                start += 1
            end = start
            while self.raw_time[end] > minT:
                end += 1
            i = 0
            while i in range(end - start):
                self.time.append(self.raw_time[i + start])
                self.trace.append(self.raw_trace[i + start])
                i += 1
        elif self.raw_time[0] > self.raw_time[1]:
            start = 0
            while self.raw_time[start] > minT:
                start += 1
            end = start
            while self.raw_time[end] < maxT:
                end += 1
            i = 0
            while i in range(end - start):
                self.time.append(self.raw_time[i + start])
                self.trace.append(self.raw_trace[i + start])
                i += 1
        self.log_it('Crop Time Scale', maxtime=maxT, mintime=minT)
def crop_time_scale ( self ) : self . analysis_log = { } self . time = [ ] self . trace = [ ] maxT = max ( self . raw_time ) minT = min ( self . raw_time ) if self . raw_time [ 0 ] < self . raw_time [ 1 ] : start = 0 while self . raw_time [ start ] < maxT : start += 1 end = start while self . raw_time [ end ] > minT : end += 1 i = 0 while i in range ( end - start ) : self . time . append ( self . raw_time [ i + start ] ) self . trace . append ( self . raw_trace [ i + start ] ) i += 1 elif self . raw_time [ 0 ] > self . raw_time [ 1 ] : start = 0 while self . raw_time [ start ] > minT : start += 1 end = start while self . raw_time [ end ] < maxT : end += 1 i = 0 while i in range ( end - start ) : self . time . append ( self . raw_time [ i + start ] ) self . trace . append ( self . raw_trace [ i + start ] ) i += 1 self . log_it ( 'Crop Time Scale' , maxtime = maxT , mintime = minT )
chops time scale to the monotonous central behaviour, deleting the wierd ends.
chops time scale to the monotonous central behaviour deleting the wierd ends .
# todo: fix the overwriting issue """chops time scale to the monotonous central behaviour, deleting the wierd ends.
        ATTENTION: overwrites self.time and self.trace, deleting any previous changes""" # clear previous time and trace, and the analysis log since it goes lost # reset log # reset time and trace # print('crop time scale, len: ' + str(len(self.raw_time))) # pick the type of behaviour. redred scans will always be false in this statement
self