MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / _doNumer

Function _doNumer

SLiCAP/SLiCAPexecute.py:129–175  ·  view source on GitHub ↗

Returns the numerator of a transfer function, or of the Laplace Transform of a detector voltage or current. The instr will be stored in the **.numer** attribute of the return object. In cases of parameter stepping, this attribute is a list with numerators. :param instr: SLiCAP

(instr)

Source from the content-addressed store, hash-verified

127 return instr
128
129def _doNumer(instr):
130 """
131 Returns the numerator of a transfer function, or of the Laplace Transform
132 of a detector voltage or current.
133
134 The instr will be stored in the **.numer** attribute of the return object. In
135 cases of parameter stepping, this attribute is a list with numerators.
136
137 :param instr: SLiCAP instruction object that holds instruction data.
138 :type instr: SLiCAPinstruction.instruction
139
140 :return: instr of the execution of the instruction.
141 :rtype: SLiCAPinstruction.instruction
142 """
143 if instr.step:
144 if ini.step_function:
145 if instr.gainType == 'loopgain' or instr.gainType == 'servo':
146 instr = _makeAllMatrices(instr)
147 instr = _doPyLoopGainServo(instr)
148 else:
149 instr = _makeAllMatrices(instr)
150 instr = _doPyNumer(instr,instr)
151 numer = instr.numer[0]
152 instr.numer = _stepFunctions(instr.stepDict, numer)
153 else:
154 stepVars = list(instr.stepDict.keys())
155 numSteps = len(instr.stepDict[stepVars[0]])
156 for i in range(numSteps):
157 for j in range(len(stepVars)):
158 instr.parDefs[stepVars[j]] = instr.stepDict[stepVars[j]][i]
159 if instr.gainType == 'loopgain' or instr.gainType == 'servo':
160 instr = _makeAllMatrices(instr)
161 instr = _doPyLoopGainServo(instr)
162 else:
163 instr = _makeAllMatrices(instr)
164 instr = _doPyNumer(instr)
165 instr.numer[-1] = instr.numer[-1]
166 else:
167 if instr.gainType == 'loopgain' or instr.gainType == 'servo':
168 instr = _makeAllMatrices(instr)
169 instr = _doPyLoopGainServo(instr)
170 else:
171 instr = _makeAllMatrices(instr)
172 instr = _doPyNumer(instr)
173 instr.numer = instr.numer[0]
174 instr = _correctDMcurrentinstr(instr)
175 return instr
176
177def _doDenom(instr):
178 """

Callers 2

_doInstructionFunction · 0.85
_doZerosFunction · 0.85

Calls 5

_makeAllMatricesFunction · 0.85
_doPyLoopGainServoFunction · 0.85
_doPyNumerFunction · 0.85
_stepFunctionsFunction · 0.85
_correctDMcurrentinstrFunction · 0.85

Tested by

no test coverage detected