Skip to content

Commit f9a73aa

Browse files
committed
Added operation:pkToPk for windowed readouts.
1 parent 0b0702e commit f9a73aa

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

FindSim-Schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
"endt": {"type": "number"},
171171
"dt": {"type": "number"},
172172
"operation": {"type": "string",
173-
"enum": ["min", "max", "mean", "sdev", "oscPk", "oscVal"] },
173+
"enum": ["min", "max", "mean", "sdev", "oscPk", "oscVal", "pkToPk"] },
174174
"baseline": {
175175
"oneOf": [
176176
{ "type": "number" },

findSim.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ def consolidateWindows( self ):
737737
# condense the ratio and the simData terms as per specified op
738738
if self.window:
739739
w = self.window
740-
assert( w["operation"] in ["min", "max", "mean", "sdev", "oscPk", "oscVal" ] )
740+
assert( w["operation"] in ["min", "max", "mean", "sdev", "oscPk", "oscVal", "pkToPk" ] )
741741
numSamples = int( round( (w["endt"] - w["startt"]) / w["dt"] ) +1 )
742742
sd = []
743743
#print( "numSamples = {}, len = {}, ".format( numSamples, len( self.simData ) ) )
@@ -760,6 +760,8 @@ def consolidateWindows( self ):
760760
sd.append( np.mean( sb ) )
761761
elif op == "sdev":
762762
sd.append( np.sdev( sb ) )
763+
elif op == "pkToPk":
764+
sd.append( max( sb ) - min( sb ) )
763765
bl = w["baseline"]
764766
if w["baselineOp"] == "min":
765767
bl = min( self.simData )
@@ -798,6 +800,8 @@ def consolidateWindows( self ):
798800
rd.append( np.mean( rb ) )
799801
elif op == "sdev":
800802
rd.append( np.sdev( rb ) )
803+
elif op == "pkToPk":
804+
rd.append( max( rb ) - min( rb ) )
801805
bl = w["baseline"] # Use baseline computed above.
802806
rd = [ (x/self.quantityScale - bl) for x in rd ]
803807
self.ratioData = rd
@@ -1306,7 +1310,7 @@ def runDoser( model, stim, readout ):
13061310
responseList = [ [readout.entities['name']], readout.field, readout_ratioReferenceEntities, readout.field ]
13071311
#responseList = [ readout.entities, readout.field, readout.ratioReferenceEntities, readout.field ]
13081312
ret, ref = sw.steadyStateStims( stimList, responseList, isSeries = True, settleTime = readout.settleTime )
1309-
if len( readout.ratioReferenceEntities ) > 0 and readout.ratioReferenceTime < EPS:
1313+
if readout.normMode == 'start' or (readout.normMode == 'presetTime' and readout.ratioReferenceTime < EPS ):
13101314
# Special case where the extra entry is the value at reset time.
13111315
refLast = sw.getObjParam(readout.ratioReferenceEntities[0], "concInit" )
13121316
ret.append( ret[-1] )

simWrapHillTau.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,8 @@ def getObjParam( self, entity, field, isSilent = False ):
726726
raise SimError( "SimWrapHillTau::getObjParam({}): Should only have 1 object, found {} ".format( entity, len( elms ) ) )
727727
if field == "Kd": # Assume mapping to KA.
728728
return self.getField( elms[0], "KA" )
729+
if field == "concInit": # Assume mapping to conc.
730+
return self.getField( elms[0], "conc" )
729731

730732
return self.getField( elms[0], field )
731733

0 commit comments

Comments
 (0)