Commits

hardwood  committed 0e0496a

Added range scaling for Seal Test.

  • Participants
  • Parent commits 3c822e1

Comments (0)

Files changed (2)

File Acquisition/ITC Wrappers.ipf

 	wave /sdfr=daqDF InputMultiplex
 	variable boardGain=GetBoardGain()
 	variable duration=GetAcqDuration()
-	nvar /sdfr=df pointsS
+	nvar /sdfr=df points
 	variable i
 	for(i=0;i<4;i+=1)
 		chan=chans[i]

File Acquisition/Seal Test.ipf

 			ValDisplay $valName pos={85,8+count*yJump}, format="%.1f", fsize=18, disable=2
 			ValDisplay $valName bodywidth=70, size={100,30}, title=resistanceTitle, value=#JoinPath({getdatafolder(1,chanDF),"inputRes"})
 			Button $("Baseline_"+channel) title="Baseline", pos={195,10+count*yJump}, proc=SealTestWinButtons
-			SetVariable $("Threshold_"+channel) title="Thresh %", pos={252,12+count*yJump}, size={85,20}, value=_NUM:0, proc=SealTestWinSetVariables
+			SetVariable $("Range_"+channel) title="Range", pos={252,12+count*yJump}, size={85,20}, value=_NUM:1200, limits={200,2000,200}, proc=SealTestWinSetVariables
+			valName="seriesRes_"+channel
+			//SetVariable $("Threshold_"+channel) title="Thresh %", pos={252,12+count*yJump}, size={85,20}, value=_NUM:0, proc=SealTestWinSetVariables
 			valName="seriesRes_"+channel
 			ValDisplay $valName pos={855,8+count*yJump}, format="%.1f", fsize=18, disable=2
 			ValDisplay $valName bodywidth=100, size={100,30}, title=resistanceTitle,value=#JoinPath({getdatafolder(1,chanDF),"seriesRes"})
 		case "Threshold":
 			SealTestTracker(chan,0)
 			break
+		case "Range":
+			dfref chanDF=SealTestChanDF(i)
+			wave /sdfr=chanDF Sweep
+			variable center=statsmedian(Sweep)
+			variable range = info.dval
+			variable high = center + range/2
+			variable low = center - range/2
+			string axes=AxisList("SealTestWin")
+			string sweepaxes=listmatch(axes,"chan*")
+			for(i=0;i<itemsinlist(sweepAxes);i+=1)
+				string sweepAxis=stringfromlist(i,sweepAxes)
+				SetAxis $sweepAxis,low,high
+			endfor
+			break
 	endswitch
 End
 
 	wave /z/sdfr=chanDF Baseline
 	if(updateBaseline || !waveexists(Baseline))
 		Duplicate /o chanDF:InputHistory chanDF:Baseline /WAVE=Baseline
-		WaveStats /Q/R=[0,10] chanDF:InputHistory
+		Wavestats /Q/R=[0,10] chanDF:InputHistory
 		Baseline=V_avg
 		
 		// Rescale response axis.  
 		wave /z/sdfr=chanDF Sweep
-		WaveStats /Q Sweep
+		StatsQuantiles /Q Sweep
 		string axes=AxisList("SealTestWin")
 		string sweepaxes=listmatch(axes,"chan*")
 		variable i
 		for(i=0;i<itemsinlist(sweepAxes);i+=1)
 			string sweepAxis=stringfromlist(i,sweepAxes)
-			SetAxis $sweepAxis,V_avg-(V_avg-V_min)*1.5,V_avg+(V_max-V_avg)*1.5
+			SetAxis $sweepAxis,V_median-(V_median-V_min)*1.5,V_avg+(V_max-V_median)*1.5
 		endfor
 	endif
 	Duplicate /o chanDF:InputHistory, chanDF:Threshold /WAVE=Threshold