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

Function _curve_data_extractor_time_dB

pytta/_plot.py:298–339  ·  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 li

(sigObjs)

Source from the content-addressed store, hash-verified

296
297
298def _curve_data_extractor_time_dB(sigObjs):
299 """
300 Extracts data from all curves from each SignalObj.
301
302 Parameter (default), (type):
303 -----------------------------
304
305 * sigObj (), (list):
306 a list with SignalObjs for curve data extraction
307
308 Return (type):
309 --------------
310
311 * curveData (), (list):
312 A list with dictionaries containing the information about each
313 curve. Needed keys for time plot:
314
315 - 'x', (), (ndarray): time axis;
316 - 'y', (), (ndarray): linear amplitude axis;
317 - 'label', (), (str): curve label;
318 - 'dBRef', (), (float): decibel scale reference.
319
320 >>> curveData = [{'x':x, 'y':y, 'label':'my beautiful curve',
321 'dBRef':2e-5}]
322 """
323 curveData = []
324 for sigObj in sigObjs:
325 for chIndex in range(sigObj.numChannels):
326 chNum = sigObj.channels.mapping[chIndex]
327 dBRef = sigObj.channels[chNum].dBRef
328 label = '{} [dB ref.: {} {}]'.format(sigObj.channels[chNum].name,
329 dBRef,
330 sigObj.channels[chNum].unit)
331 x = sigObj.timeVector
332 y = sigObj.timeSignal[:, chIndex]
333 curveData.append({
334 'label':label,
335 'x':x,
336 'y':y,
337 'dBRef':dBRef
338 })
339 return curveData
340
341
342def freq(sigObjs, smooth, xLabel, yLabel, yLim, xLim, title, decimalSep):

Callers 1

time_dBFunction · 0.85

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected