5 from tools
.generic_utils
.time_formats
import *
10 ##################################################
11 def get_dataPortion(data
, timeInterval_sec
):
13 if timeInterval_sec
[0] < data
[0][0] or timeInterval_sec
[1] > data
[len(data
)-1][0]:
14 print "Invalid parameters in data_portionnig.get_dataPortion"
18 while(data
[i
][0] < timeInterval_sec
[0]):
22 while(data
[i
][0] <= timeInterval_sec
[1]):
26 return data
[start_inx
:end_inx
]
29 #################################################
30 def split_paramData(param_data
, periods_str
):
34 periods_sec
= periodsStr2periodsSec(periods_str
)
38 for period
in periods_sec
:
41 ## if period[0] < param_data[0][0] or period[1] > param_data[len(param_data)-1][0]:
42 ## print "Invalid parameters in data_portionnig.split_paramData"
45 if period
[0] < param_data
[0][0] or period
[1] > param_data
[len(param_data
)-1][0]:
48 while(param_data
[i
][0] < period
[0]):
52 while(param_data
[i
][0] <= period
[1]):
56 data_piecewise
.append(param_data
[start_inx
:end_inx
])