Creates a table or tables with results of pole/zero 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 ci
(self, resultObject, label="", caption="")
| 228 | return Snippet(RST, self.format) |
| 229 | |
| 230 | def pz(self, resultObject, label="", caption=""): |
| 231 | """ |
| 232 | Creates a table or tables with results of pole/zero analysis stored in *resultObject*. |
| 233 | If no label AND no caption are given this method returns a LaTeX |
| 234 | tabular snippet. Else it returns a table snippet. |
| 235 | |
| 236 | :param resultObject: SLiCAP circuit object that comprises the circuit data to be listed. |
| 237 | :type resultObject: SLiCAP.SLiCAPinstruction.instruction |
| 238 | |
| 239 | :param label: Reference label for the table. Defaults to an empty string. |
| 240 | :type label: str |
| 241 | |
| 242 | :param caption: Text that will used as table caption(s). |
| 243 | :type caption: str |
| 244 | |
| 245 | :return: SLiCAP Snippet object |
| 246 | :rtype: SLiCAP.SLiCAPprotos.Snippet |
| 247 | """ |
| 248 | if resultObject.dataType == "pz": |
| 249 | RST = 'DC value of ' + resultObject.gainType + ': :math:`' + sp.latex(roundN(resultObject.DCvalue)) +'`\n\n' |
| 250 | else: |
| 251 | RST = "" |
| 252 | if resultObject.errors != 0: |
| 253 | print("pz2RST: Errors found in instruction.") |
| 254 | elif resultObject.dataType != 'poles' and resultObject.dataType != 'zeros' and resultObject.dataType != 'pz': |
| 255 | print("pz2RST: Error: 'pz2RST()' expected dataType: 'poles', 'zeros', or 'pz', got: '{0}'.".format(resultObject.dataType)) |
| 256 | elif resultObject.step == True : |
| 257 | print("pz2RST: Error: parameter stepping not implemented for 'pz2RST()'.") |
| 258 | else: |
| 259 | if resultObject.dataType == 'poles': |
| 260 | numeric = _checkNumeric(resultObject.poles) |
| 261 | elif resultObject.dataType == 'zeros': |
| 262 | numeric = _checkNumeric(resultObject.zeros) |
| 263 | elif resultObject.dataType == 'pz': |
| 264 | numeric = _checkNumeric(resultObject.poles) and _checkNumeric(resultObject.zeros) |
| 265 | if numeric: |
| 266 | if ini.hz == True: |
| 267 | headerList = ['#', 'Re [Hz]', 'Im [Hz]', ':math:`f` [Hz]', 'Q'] |
| 268 | else: |
| 269 | headerList = ['#', 'Re [rad/s]', 'Im [rad/s]', 'w [rad/s]', 'Q'] |
| 270 | else: |
| 271 | if ini.hz == True: |
| 272 | headerList = ['#', ':math:`f` [Hz]'] |
| 273 | else: |
| 274 | headerList = ['#', ':math:`\\omega` [rad/s]'] |
| 275 | linesList = [] |
| 276 | if resultObject.dataType == 'poles' or resultObject.dataType == 'pz': |
| 277 | if numeric: |
| 278 | linesList += _numRoots2RST(resultObject.poles, ini.hz, 'p') |
| 279 | else: |
| 280 | linesList += _symRoots2RST(resultObject.poles, ini.hz, 'p') |
| 281 | |
| 282 | if resultObject.dataType == 'zeros' or resultObject.dataType == 'pz': |
| 283 | if numeric: |
| 284 | linesList += _numRoots2RST(resultObject.zeros, ini.hz, 'z') |
| 285 | else: |
| 286 | linesList += _symRoots2RST(resultObject.zeros, ini.hz, 'z') |
| 287 |
no test coverage detected