MCPcopy Create free account
hub / github.com/PyTTaMaster/PyTTa / _curve_data_extrator_time

Function _curve_data_extrator_time

pytta/_plot.py:144–180  ·  view source on GitHub ↗

Extracts data from all curves from each SignalObj. Parameter (default), (type): ----------------------------- * sigObj (), (list): a list with SignalObjs for curve data extraction Return (type): -------------- * curveData (list): A lis

(sigObjs)

Source from the content-addressed store, hash-verified

142
143
144def _curve_data_extrator_time(sigObjs):
145 """
146 Extracts data from all curves from each SignalObj.
147
148 Parameter (default), (type):
149 -----------------------------
150
151 * sigObj (), (list):
152 a list with SignalObjs for curve data extraction
153
154 Return (type):
155 --------------
156
157 * curveData (list):
158 A list with dictionaries containing the information about each
159 curve. Kys for time plot:
160
161 - 'x', (), (ndarray): time axis;
162 - 'y', (), (ndarray): amplitude axis;
163 - 'label', (), (str): curve label.
164
165 >>> curveData = [{'x':x, 'y':y, 'label':'my beautiful curve'}]
166 """
167 curveData = []
168 for sigObj in sigObjs:
169 for chIndex in range(sigObj.numChannels):
170 chNum = sigObj.channels.mapping[chIndex]
171 label = '{} [{}]'.format(sigObj.channels[chNum].name,
172 sigObj.channels[chNum].unit)
173 x = sigObj.timeVector
174 y = sigObj.timeSignal[:, chIndex]
175 curveData.append({
176 'label':label,
177 'x':x,
178 'y':y
179 })
180 return curveData
181
182
183def time_dB(sigObjs, xLabel, yLabel, yLim, xLim, title, decimalSep, timeUnit):

Callers 1

timeFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected