hardwood avatar hardwood committed 729afbd

Changes for Aryn.

Comments (0)

Files changed (2)

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
 	
 	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
 	endif
 	variable k,result = 0
 	for(k=0;k<numpnts(livePulseSets);k+=1)
-		result += ampl[livePulseSets[k]] + pulseSet*dampl[livePulseSets[k]]
+		result +=  (pulseNum<pulses[k]) * (ampl[livePulseSets[k]] +pulseNum*dampl[livePulseSets[k]])
 	endfor
 	return result
 end
 	
 	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
 
 #ifdef Acq
 #include "Spike Functions"
-<<<<<<< local
-=======
-#endif
->>>>>>> other
 #include "Waves Average"
 
 override function MakeLogPanel()
-<<<<<<< local
-	if(WinType("LogPanel"))
-		DoWindow /F LogPanel
-    return 0
-  else
-    NewNotebook/W=(600,570,940,710) /F=0/N=LogPanel
- 	endif
-end
-=======
         if(WinType("LogPanel"))
                 DoWindow /F LogPanel
                 return 0
         else
                 NewNotebook/W=(600,570,940,710) /F=0/N=LogPanel
         endif
-        end
+end
         
->>>>>>> other
-      
-<<<<<<< local
-=======
-
-
-
->>>>>>> other
 function StimulusTable()
 	dowindow /k StimTable
 	edit /k=1/n=StimTable as "Stimulus Table"
 	appendtotable StimulusAmpls_0//,StimulusAmpls_1
 end
 
-
-<<<<<<< local
-=======
-
-#pragma rtGlobals=1		// Use modern global access method.
-
->>>>>>> other
+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
 //values to be preserved, even when Igor is turned off.  See the Igor manual for more information
 	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
 	
-
-<<<<<<< local
 End
 
-#endif=======
-End>>>>>>> other
+#endif
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.