SLiCAPlatex.py¶
Created on Sat Jun 10 17:24:17 2023
@author: anton
- TEXcreateCSVtable(headerList, linesList, alignstring, unitpos=None, caption='', label='')¶
Creates and returns a LaTeX table snippet that can be included in a LaTeX document.
A label can be given as reference and a caption can be added.
- Parameters
headerList (list with strings) – List with column headers.
linesList (list) – List with lists of table data for each table row
alignstring (str) – LaTeX table align string
unitpos (int, str) – Position of column with units (will be typesetted with mathrm)
caption (str) – Table caption, defauls to ‘’
label (str) – Table reference label
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- coeffsTransfer2TEX(transferCoeffs, label='', append2caption='')¶
Creates and returns a LaTeX table snippet that can be included in a LaTeX document.
The table comprises the normalized coefficients of the numerator and the denominator as listed in transferCoeffs.
The normalization factor (Gain) is added to the caption.
A label can be given as reference.
- Parameters
transferCoeffs (list) –
List with:
gain
list with numerator coefficients
list with denominator coefficients
Can be obtained with coeffsTransfer()
label (str) – Reference lable for this table
append2caption (str) – String that will be appended to the caption.
- Returns
RST snippet to be included in a ReStructuredText document.
- Return type
str
- dcvarContribs2TEX(resultObject, append2caption='', label='')¶
Creates and returns a LaTeX table snippet that can be included in a LaTeX document.
The table comprises the values of the dcvar sources and their contributions to the detector-referred dc variance and the source-referred dc variance. The latter only if a signal source has been specified.
The caption reads ‘DC variance contributions ‘<append2caption>.
A label can be given as reference.
- Parameters
resultObject (SLiCAP.SLiCAPprotos.allResults) – SLiCAP execution result object.
label (str) – Reference to this table, defaults to ‘’
append2caption (str) – Test string that will be appended to the caption, Defaults to ‘’
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- elementData2TEX(circuitObject, label='', append2caption='')¶
Creates and returns a LaTeX table snippet that can be included in a LaTeX document. The table comprises the data of all elements of the expanded nelist of <circuitObject>.
The caption reads ‘Expanded netlist of: <circuitObject.title>. <append2caption>.
A label can be given as reference.
- Parameters
circuitObject (SLiCAP.SLiCAPprotos.circuit) – SLiCAP circuit object.
label (str) – Reference to this table, defaults to ‘’
append2caption (str) – Test string that will be appended to the caption, Defaults to ‘’
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- eqn2TEX(LHS, RHS, units='', label='', multiline=0)¶
Returns a LaTeX snippet of a displayed equation with dimension and reference label.
- Parameters
RHS (str, sympy.Expression, or sympy.Symbol) – Right hand side of the equation.
LHS (str, sympy.Expression, or sympy.Symbol) – Left hand side of the equation.
units (str) – Dimension
label (int) – Reference label
multiline – Number of sub-expressions per line, defaults to 0 (single-line equation)
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- eqn2TEXinline(LHS, RHS, units='')¶
Returns a LaTeX snippet for inline subsitution of an equation in a LaTeX document.
- Parameters
LHS (sympy.Expression, str) – Left hand side of the equation.
RHS (sympy.Expression, str) – Right hand side of the equation.
units (str) – units or dimension, defaults to ‘’
- Returns
LaTeX snippet for inline substitution
- Return type
str
- expr2TEX(expr, units='')¶
Returns a LaTeX snippet for inline subsitution of an expression in a LaTeX document.
- Parameters
expr (sympy.Expression) – sympy expression for inline substitution.
units (str) – units or dimension, defaults to ‘’
- Returns
LaTeX snippet for inline substitution
- Return type
str
- matrices2TEX(Iv, M, Dv, label='')¶
Returns a LaTeX snippet of the matrix equation Iv = M.Dv,
A label can be given for reference.
- Parameters
Iv (sympy.Matrix) – (n x 1) matrix with independent variables.
M (sympy.Matrix) – (n x n) matrix.
Dv (sympy.Matrix) – (n x 1) matrix with dependent variables.
- Returns
LaTeX snippet of the matrix equation.
- Return type
str
- netlist2TEX(netlistFile, lineRange=None, firstNumber=None)¶
Converts a SLiCAP netlist into a LaTeX string that can be included in a LaTeX document and returns this string.
- Parameters
netlistFile – Name of the netlist file that resides in the ini.circuitPath directory
lineRange (str) – Range of lines to be displayed; e.g. ‘1-7,10,12’. Defaults to None (display all lines)
firstNumber (int, float, str) – Number of the first line to be displayed
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- noiseContribs2TEX(resultObject, label='', append2caption='')¶
Creates and returns a LaTeX table snippet that can be included in a LaTeX document.
The table comprises the values of the noise sources and their contributions to the detector-referred noise and the source-referred noise. The latter only if a signal source has been specified.
The caption reads ‘Noise contributions. ‘<append2caption>.
A label can be given as reference.
- Parameters
resultObject (SLiCAP.SLiCAPprotos.allResults) – SLiCAP execution result object.
label (str) – Reference to this table, defaults to ‘’
append2caption (str) – Test string that will be appended to the caption, Defaults to ‘’
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- numRoots2TEX(roots, Hz, pz)¶
Returns a list of lists with row data for the creation of a LaTeX table with numeric poles or zeros.
- Parameters
roots (List with (complex) numbers) – List with numeric roots
Hz (Bool) – True if frequencies must be displayed in Hz, False for rad/s.
pz (str) – Identifier prefix: ‘p’ ofr poles ‘z’ for zeros.
- Returns
List of lists with data of poles or zeros
- Return type
list
- parDefs2TEX(circuitObject, label='', append2caption='')¶
Creates and returns a LaTeX table snippet that can be included in a LaTeX document. The table comprises the parameter definitions of <circuitObject>.
The caption reads ‘Parameter defnitions in: : <circuitObject.title>. <append2caption>.
A label can be given as reference.
- Parameters
circuitObject (SLiCAP.SLiCAPprotos.circuit) – SLiCAP circuit object.
label – Reference to this table, defaults to ‘’
append2caption (str) – Test string that will be appended to the caption, Defaults to ‘’
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- params2TEX(circuitObject, label='', append2caption='')¶
Creates and returns a LaTeX table snippet that can be included in a LaTeX document. The table comprises a column with names of undefined parameters of <circuitObject>.
The caption reads ‘Undefined parameters in: : <circuitObject.title>. <append2caption>.
A label can be given as reference.
- Parameters
circuitObject (SLiCAP.SLiCAPprotos.circuit) – SLiCAP circuit object.
label – Reference to this table, defaults to ‘’
append2caption (str) – Test string that will be appended to the caption, Defaults to ‘’
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- pz2TEX(resultObject, label='', append2caption='')¶
Creates and return a LaTeX table with poles, zeros, or poles and zeros that can be included in a LaTeX document. If the data type is ‘pz’ the zero- frequency value of the gain will be displayed in the caption of the table.
The caption reads as follows:
data type = ‘poles’: ‘Poles of: <resultObject.gainType>. <append2caption>’
data type = ‘zeros’: ‘Zeros of: <resultObject.gainType>. <append2caption>’
data type = ‘pz’: ‘Poles and zeros of: <resultObject.gainType>; DC value = <resultObject,DCvalue>. <append2caption>.’
A label can be given as reference.
- Parameters
label (str) – Reference to this table, defaults to ‘’
append2caption (str) – Test string that will be appended to the caption, Defaults to ‘’
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- save2TEXinline(vardict)¶
Saves the key-value pairs of ‘vardict’ in the CSV file:
<ini.latexPath>SLiCAPdata/TEXsubstitutions.tex
- Parameters
vardict (dict) – Dictionary with inline LaTeX subsitutions
- Returns
None
- Return type
NoneType
- saveTEX(TEX, fileName)¶
Saves a LaTeX snippet for inclusion in a LaTeX file into:
<ini.latexPath>SLiCAdata/<fileName>.tex :param TEX: LaTeX snippet. :type TEX: str
- Parameters
fileName (str) – File name
- Returns
None
- Return type
NoneType
- slicap2TEX(scriptFile, firstLine=None, lineRange=None)¶
Converts a SLiCAP script file into a LaTeX string that can be included in a LaTeX document and returns this string.
- Parameters
scriptFile (str) – Name of the script file that resides in the ini.projectPath directory
lineRange (str) – Range of lines to be displayed; e.g. ‘1-7,10,12’. Defaults to None (display all lines)
firstNumber (int, float, str) – Number of the first line to be displayed
- Returns
LaTeX snippet to be included in a LaTeX document
- Return type
str
- specs2TEX(specs, specType, label='', caption='')¶
Creates and returns a LaTeX table with specifications that can be included in a LaTeX document.
If a list with specification types is provided, it creates tables for specified types only. By default, tables for all types will be created.
- Parameters
specs (list) – List with spec items.
specType (str) – Type of specification.
label (str) – Reference to this table, defaults to ‘’.
caption (str) – Caption of the table, defaults to ‘’.
- Returns
LaTeX snippet to be included in a LaTeX document.
- Return type
str
- stepArray2TEX(stepVars, stepArray, label='', caption='')¶
Creates and returns a LaTeX table snippet that can be included in a LaTeX document.
The table shows the step variables and their values as defined for array-type stepping of instructions.
- Parameters
stepVars (List) – List with step variables for array type stepping (SLiCAPinstruction.instruction.stepVars)
stepArray (list) – List of lists: (SLiCAPinstruction.instruction.stepArray)
label (str) – Reference lable for this table
caption (str) – Table caption
- Returns
TEX: LaTeX table snippet.
- Return type
str
- symRoots2TEX(roots, Hz, pz)¶
Returns a list of lists with row data for the creation of a LaTeX table with symbolic poles or zeros.
- Parameters
roots (List with sympy expressions) – List with symbolic roots
Hz (Bool) – True if frequencies must be displayed in Hz, False for rad/s.
pz (str) – Identifier prefix: ‘p’ ofr poles ‘z’ for zeros.
- Returns
List of lists with data of poles or zeros
- Return type
list