MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / noiseContribs

Method noiseContribs

SLiCAP/SLiCAPrst.py:292–338  ·  view source on GitHub ↗

Creates a table with results of noise analysis stored in *resultObject*. If no label AND no caption are given this method returns a LaTeX tabular snippet. Else it returns a table snippet. :param resultObject: SLiCAP circuit object that comprises the circuit data to

(self, resultObject, label="", caption="")

Source from the content-addressed store, hash-verified

290 return Snippet(RST, self.format)
291
292 def noiseContribs(self, resultObject, label="", caption=""):
293 """
294 Creates a table with results of noise analysis stored in *resultObject*.
295 If no label AND no caption are given this method returns a LaTeX
296 tabular snippet. Else it returns a table snippet.
297
298 :param resultObject: SLiCAP circuit object that comprises the circuit data to be listed.
299 :type resultObject: SLiCAP.SLiCAPinstruction.instruction
300
301 :param label: Reference label for the table. Defaults to an empty string.
302 :type label: str
303
304 :param caption: Text that will used as table caption(s).
305 :type caption: str
306
307 :return: SLiCAP Snippet object
308 :rtype: SLiCAP.SLiCAPprotos.Snippet
309 """
310 if resultObject.dataType == 'noise' and resultObject.step == False:
311 detunits = resultObject.detUnits + '**2/Hz'
312 if resultObject.srcUnits != None:
313 srcunits = resultObject.srcUnits + '**2/Hz'
314 # Add a table with noise contributions
315 linesList = []
316 headerList = ['', 'Value' , 'Units']
317 for src in resultObject.onoiseTerms.keys():
318 if src[0].upper() == 'I':
319 units = 'A**2/Hz'
320 elif src[0].upper() == 'V':
321 units = 'V**2/Hz'
322 #units = sp.sympify(units)
323 line = [src + ': Source value', resultObject.snoiseTerms[src],
324 units]
325 linesList.append(line)
326 if resultObject.srcUnits != None:
327 line = [src + ': Source-referred',
328 resultObject.inoiseTerms[src], srcunits]
329 linesList.append(line)
330 line = [src + ': Detector-referred',
331 resultObject.onoiseTerms[src], detunits]
332 linesList.append(line)
333 RST = _RSTcreateCSVtable(caption, headerList, linesList, unitpos=2,
334 label=label)
335 else:
336 RST = ''
337 print('noise2RST: Error: wrong data type, or stepped analysis.')
338 return Snippet(RST, self.format)
339
340 def dcvarContribs(self, resultObject, label="", caption=""):
341 """

Callers 2

noise.pyFile · 0.45
sphinx_report.pyFile · 0.45

Calls 2

SnippetClass · 0.90
_RSTcreateCSVtableFunction · 0.85

Tested by

no test coverage detected