Commits

Richard Gerkin  committed 843ab80 Merge

Merged

  • Participants
  • Parent commits 5a51511, 729afbd

Comments (0)

Files changed (7)

File Acquisition/Acquisition Wave Functions.ipf

 	return Core#StrPackageSetting(module,"channelConfigs",GetChanName(chan),"label_",default_="ch"+num2str(chan),quiet=1)
 End
 
+function GetLabelChan(labell)
+	string labell
+	
+	variable numChannels = GetNumChannels()
+	wave /t labels = GetChanLabels()
+	variable i
+	for(i=0;i<numpnts(labels);i+=1)
+		if(stringmatch(labell,labels[i]))
+			return i
+		endif
+	endfor
+	return -1
+end
+
 function /wave GetChanLabels()
 	variable numChannels=GetNumChannels()
 	make /free/t/n=(numChannels) labels
 	return dAmpl
 end
 
+function GetEffectiveAmpl(chan[,sweepNum,pulseSet,pulseNum])
+	variable chan,sweepNum,pulseSet,pulseNum
+	
+	wave ampl = GetAmpl(chan,sweepNum=sweepNum)
+	wave dampl = GetdAmpl(chan,sweepNum=sweepNum)
+	wave pulses = GetNumPulses(chan,sweepNum=sweepNum)
+	if(paramisdefault(pulseSet))
+		wave livePulseSets = GetLivePulseSets(chan,sweepNum=sweepNum)
+	else
+		make /free/n=1 livePulseSets = pulseSet
+	endif
+	variable k,result = 0
+	for(k=0;k<numpnts(livePulseSets);k+=1)
+		result +=  (pulseNum<pulses[k]) * (ampl[livePulseSets[k]] +pulseNum*dampl[livePulseSets[k]])
+	endfor
+	return result
+end
+
 function /wave GetLivePulseSets(chan[,sweepNum])
 	variable chan,sweepNum
 	
 	wave divisor = GetChanDivisor(chan,sweepNum=sweepNum)
 	wave remainder = GetChanRemainder(chan,sweepNum=sweepNum)
-	make /free/n=(numpnts(divisor)) pulseSetState = 2^mod(divisor[p],sweepNum) & remainder[p]
+	make /free/n=(numpnts(divisor)) pulseSetState = (divisor[p]==1 || 2^mod(sweepNum,divisor[p]) & remainder[p])
 	extract /free/indx pulseSetState,livePulseSets,pulseSetState>0
 	return livePulseSets
 end

File Acquisition/Acquisition.ipf

 #ifdef Rick
 	//ISI=10+floor(abs(enoise(10)))
 #endif
+#ifdef Aryn
+	//printf "We injected %d pA\r",GetCurrent()
+#endif
 	//endif
 End
 

File Acquisition/Seal Test.ipf

 
 // $Author: rick $
+<<<<<<< local
 // $Rev: 633 $
 // $Date: 2013-03-28 15:53:22 -0700 (Thu, 28 Mar 2013) $
+=======
+// $Rev: 626 $
+// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+>>>>>>> other
 
 #pragma rtGlobals=1		// Use modern global access method.
 
 		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_median-(V_median-V_min)*1.5,V_avg+(V_max-V_median)*1.5
-		endfor
+		string sweepAxis = "chan"+num2str(chan)+"_axis"
+		variable center = v_median
+		ControlInfo $("Range_"+num2str(chan))
+		variable range = v_value
+		variable low = center - range/2
+		variable high = center + range/2
+		SetAxis $sweepAxis,low,high
 	endif
 	Duplicate /o chanDF:InputHistory, chanDF:Threshold /WAVE=Threshold 
 	ControlInfo $("Threshold_"+channel); Variable thresh=V_Value

File Basics/Statistics.ipf

 	return ClusterDispersions
 end
 
-threadsafe Function CV(w)//[,correction,x1,x2])
+threadsafe Function ComputeCV(w)//[,correction,x1,x2])
 	wave w
 	//Variable correction // Correct for slow variations in the signal that artificially increase the standard deviation.  
 	//Variable x1,x2

File Basics/Wave Functions.ipf

 			break
 		case "CV":
 			if(mt)
-				multithread result=CV(GetBeam(w,dim,{p,q,r}))
+				multithread result=ComputeCV(GetBeam(w,dim,{p,q,r}))
 			else
-				result=CV(GetBeam(w,dim,{p,q,r}))
+				result=ComputeCV(GetBeam(w,dim,{p,q,r}))
 			endif
 			break
 		case "Z":

File Other/Batch Plotting.ipf

-// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/Other/Batch%20Plotting.ipf $
+// $URL: svn://churro.cnbc.cmu.edu/igorcode/Recording%20Artist/Other/Batch%20Plotting.ipf $
 // $Author: rick $
+<<<<<<< local
 // $Rev: 633 $
 // $Date: 2013-03-28 15:53:22 -0700 (Thu, 28 Mar 2013) $
+=======
+// $Rev: 566 $
+// $Date: 2011-07-14 09:16:22 -0400 (Thu, 14 Jul 2011) $
+>>>>>>> other
 
 #pragma rtGlobals=1		// Use modern global access method.
 #include "Batch Wave Functions"
 	endfor
 End
 
-Function KillTables([match])
-	string match
-	if(ParamIsDefault(match))
-		match="*"
-	endif
-	
-	KillAll("tables",match=match)
+Function KillTables()
+	KillAll("tables")
 End
 
 Function KillGraphs([match])
 End
 
 //// Plot all combinations of list1 against list2 (data pairs with lines connecting them)
-Function PlotPairsWithLinesMany(list1,list2,bad_list)//,suffix)
+//Function PlotPairsWithLinesMany(list1,list2,bad_list)//,suffix)
 	String list1,list2//,suffix
 	String bad_list // Makes sure nothing on the bad list (e.g. current too small) is on the returned list
 	String prefix="time_constants_"
 	endfor
 End
 
-Function KillAllFits() // Removes Fits from every graph there is and then deletes them
+//Function KillAllFits() // Removes Fits from every graph there is and then deletes them
 	String list=WinList("*",";","")
 	Variable i,j
 	String window_name
 End
 
 // A window that can show the waves of a folder, and in which those waves can be browsed.  
-Function BrowseFolder(df[,prefix])
+//Function BrowseFolder(df[,prefix])
 	dfref df // Data folder reference. 
 	String prefix // e.g. "Sweep".   
 	if(ParamIsDefault(prefix))

File Users/Aryn.ipf

 #include "Waves Average"
 
 override function MakeLogPanel()
-	if(WinType("LogPanel"))
-		DoWindow /F LogPanel
-    return 0
-  else
-    NewNotebook/W=(600,570,940,710) /F=0/N=LogPanel
- 	endif
+        if(WinType("LogPanel"))
+                DoWindow /F LogPanel
+                return 0
+        else
+                NewNotebook/W=(600,570,940,710) /F=0/N=LogPanel
+        endif
 end
         
 function StimulusTable()
 	make /o/n=(curr_sweep) StimulusAmpls_1 = StimulusAmplitudes[p][1]
 	appendtotable StimulusAmpls_0//,StimulusAmpls_1
 end
-#endif
+
+function DoIhStuff(chan)
+	variable chan
+	
+	variable i,sweepNum
+	variable first = GetCursorSweepNum("A")
+	variable last = GetCursorSweepNum("B")
+	string list = ""
+	dfref df=Core#InstanceHome("Acq","sweepsWin","win0")
+	wave /sdfr=df SelWave
+	for(sweepNum=first;sweepNum<=last;sweepNum+=1)
+		if(SelWave[sweepNum][chan] & 16)
+			variable ampl = GetEffectiveAmpl(chan,sweepNum=sweepNum)
+			wave w = GetChanSweep(chan,sweepNum)
+			string name = "Ih_average_"+num2str(ampl)
+			wave /z avg = $CleanupName(name,0)
+			if(!waveexists(avg))
+				make /o/n=(numpnts(w)) $CleanupName(name,0) /wave=avg=0
+			endif
+			if(whichlistitem(name,list)<0)
+				avg=0
+				note /k avg, ""
+				list += name+";"
+			endif
+			avg += w[p]
+			note /nocr avg, "X"
+		endif
+	endfor
+	display /k=1
+	for(i=0;i<itemsinlist(list);i+=1)
+		name = stringfromlist(i,list)
+		wave avg = $CleanupName(name,0)
+		string the_note = note(avg)
+		avg /= strlen(the_note)
+		colortab2wave rainbow
+		wave m_colors
+		setscale x,0,1,m_colors
+		variable red = m_colors(i/itemsinlist(list))[0]
+		variable green = m_colors(i/itemsinlist(list))[1]
+		variable blue = m_colors(i/itemsinlist(list))[2]
+		appendtograph /c=(red,green,blue) avg
+	endfor
+end
 
 //This procedure file keeps track of all custom preferences.  In general, these preferences are 
 //user entered parameters in dialog boxes.  Managing preferences this way causes dialog box
 	for(i=0;i<ItemsInList(traces);i+=1)
 		string Trace =  stringfromlist(i,traces)
 		Wave TraceWave=TraceNameToWaveRef(win_name,trace)
+		string labell = getwavesdatafolder(TraceWave,0)
+		variable chan = GetLabelChan(labell)
+		variable sweepNum
+		sscanf nameofwave(traceWave),"sweep%d",sweepNum
+		InputCurrent = GetEffectiveAmpl(chan,sweepNum=sweepNum)
 		variable strLength = strlen(Trace)
 			if (strLength >=12)	
 				 InputValue = Trace[12,strLength]
 			variable extraCellCV = v_avg
 			print "cell attached CV = ", extraCellCV
 	
-
-End
+End
+
+#endif