Commits

Richard Gerkin  committed 436288f

Bug fixes for Gilberto

  • Participants
  • Parent commits 6688fa2

Comments (0)

Files changed (26)

File Acquisition/Acquisition Settings.ipf

 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 #pragma ModuleName=Acq
 			strswitch(instance)
 				case "_Save_":
 					string winDAQ=GetWinDAQ()
+					wave labels = GetChanLabels()
 					do
 						string targetDAQ = Core#DefaultInstance(module,package)
 						prompt targetDAQ,"Name:"
 							if(strlen(targetDAQ))
 								string win
 								Core#CopyInstance(module,package,winDAQ,targetDAQ)
+								Core#SetWavTPackageSetting(module,"DAQs",targetDAQ,"channelConfigs",labels)
 								if(!Core#SavePackageInstance(module,package,targetDAQ))
 									printf "DAQ instance %s successfully saved.\r",targetDAQ
 								endif

File Acquisition/Acquisition Wave Functions.ipf

 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 static strconstant module="Acq"

File Acquisition/Acquisition Windows.ipf

 // $Author: rick $
-// $Rev: 631 $
-// $Date: 2013-02-20 14:31:38 -0700 (Wed, 20 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 

File Acquisition/Analysis.ipf

 
 // $Author: rick $
-// $Rev: 631 $
-// $Date: 2013-02-20 14:31:38 -0700 (Wed, 20 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 static strconstant module=Acq

File Acquisition/DAQ Interface.ipf

 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 

File Acquisition/Experiment Facts.ipf

 
 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 static strconstant module="Acq"

File Acquisition/ITC Wrappers.ipf

 
 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 #pragma ModuleName=ITC

File Acquisition/Logging.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/Recording%20Artist/Acquisition/Logging.ipf $
+// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/Acquisition/Logging.ipf $
 // $Author: rick $
-// $Rev: 599 $
-// $Date: 2011-12-16 09:25:15 -0500 (Fri, 16 Dec 2011) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 

File Acquisition/NIDAQmx Wrappers.ipf

 
 // $Author: rick $
-// $Rev: 559 $
-// $Date: 2011-06-20 11:54:49 -0400 (Mon, 20 Jun 2011) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 // Test...
 

File Acquisition/Seal Test.ipf

 
 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 

File Basics/Graphing.ipf

 
 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 
 			GetTraceColor(trace,red,green,blue,win=win)
 			if(red==keyRed && green==keyGreen && blue==keyBlue) // Trace of the same color as the key trace.  
 				Wave TraceWave=TraceNameToWaveRef(win,trace)
+				if(!waveexists(TraceWave)) // Not sure how this could happen, but Gilberto had this problem when one channel was not active.  
+					continue
+				endif
 				Wave /z TraceXWave=XWaveRefFromTrace(win,trace)
 				Variable xOffset_=XOffset(trace,win=win)
 				Variable xMulOffset_=XmulOffset(trace,win=win)

File Basics/I-O.ipf

 
 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 #ifndef Acq

File Basics/List Functions.ipf

 
 // $Author: rick $
-// $Rev: 625 $
-// $Date: 2013-02-01 21:51:36 -0700 (Fri, 01 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 

File Basics/Utilities.ipf

 // $Author: rick $
-// $Rev: 626 $
-// $Date: 2013-02-07 09:36:23 -0700 (Thu, 07 Feb 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 

File Core/Settings.ipf

 	if(!generic && !strlen(instances)) // Non-generic package; all instances requested.  
 		string name=Core#CurrProfileName()
 		string path=PackageDiskLocation(module,package,quiet=quiet)
-		NewPath /C/O/Q currPath,path
-		instances=IndexedFile(currPath, -1, ".pxp")
-		instances=replacestring(".pxp;",instances,";")
+		if(strlen(path))
+			NewPath /C/O/Q currPath,path
+			instances=IndexedFile(currPath, -1, ".pxp")
+			instances=replacestring(".pxp;",instances,";")
+		else
+			instances = ""
+		endif
 	endif
 	string loaded=""
 	dfref packageDF=PackageHome(module,package,create=1,quiet=quiet)
 	variable default_ // The location of the default, with the manifest.   
 	variable create,quiet
 	
-	string path=ProfileDiskLocation(default_=default_,quiet=quiet)
+	string path=ProfileDiskLocation(default_=default_,quiet=quiet,create=create)
 	path=joinpath({path,module})
 	if(create)
 		CreatePathLocation(path)	
 			newpath /o/q/z currPath path
 			if(v_flag && !quiet)
 				printf err,package,path
+				path = ""
 			endif
 		endif
 	else
 		getfilefolderinfo /q/z path
 		if(v_flag && !quiet)
 			printf err,package,path
+			path = ""
 		endif
 	endif
 	return path

File Dummy.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/Dummy.ipf $
-// $Author: rick $
-// $Rev: 417 $
-// $Date: 2010-04-14 09:47:45 -0400 (Wed, 14 Apr 2010) $
-
-#pragma rtGlobals=1		// Use modern global access method.
-#pragma IndependentModule=Dummy
-
-Function Dummy()
-	print "This is a dummy function."
-End

File IgorExchange/Neuralynx/Load Neuralynx.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/IgorExchange/Load%20Neuralynx.ipf $
+// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/IgorExchange/Neuralynx/Load%20Neuralynx.ipf $
 // $Author: rick $
-// $Rev: 618 $
-// $Date: 2013-01-24 20:21:19 -0700 (Thu, 24 Jan 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 #pragma ModuleName= Nlx

File IgorExchange/Neuralynx/Neuralynx Analysis.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/IgorExchange/Neuralynx%20Analysis.ipf $
+// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/IgorExchange/Neuralynx/Neuralynx%20Analysis.ipf $
 // $Author: rick $
-// $Rev: 615 $
-// $Date: 2012-09-05 13:14:03 -0700 (Wed, 05 Sep 2012) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 #pragma moduleName=NlxB

File Modules/.DS_Store

Binary file modified.

File Modules/Acq/.DS_Store

Binary file modified.

File Modules/Nlx/.DS_Store

Binary file modified.

File Other/Batch Plotting.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/Recording%20Artist/Other/Batch%20Plotting.ipf $
+// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/Other/Batch%20Plotting.ipf $
 // $Author: rick $
-// $Rev: 566 $
-// $Date: 2011-07-14 09:16:22 -0400 (Thu, 14 Jul 2011) $
+// $Rev: 628 $
+// $Date: 2013-02-11 12:57:08 -0700 (Mon, 11 Feb 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 //#include "Batch Wave Functions"
 	endfor
 End
 
-Function KillTables()
-	KillAll("tables")
+Function KillTables([match])
+	string match
+	if(ParamIsDefault(match))
+		match="*"
+	endif
+	
+	KillAll("tables",match=match)
 End
 
 Function KillGraphs([match])

File Other/Minis.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/Recording%20Artist/Other/Minis.ipf $
+// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/Other/Minis.ipf $
 // $Author: rick $
-// $Rev: 605 $
-// $Date: 2012-04-18 12:37:23 -0400 (Wed, 18 Apr 2012) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma moduleName=Minis
 #pragma rtGlobals=1		// Use modern global access method.
 	endfor
 	
 	// Compute intervals.  
+if(0)
+	TempIndex=x
+	Sort Event_Time,Event_Time,TempIndex
+	Interval=Event_Time[p]-Event_Time[p-1]
+	Sort TempIndex,Event_Time,Interval
+	for(i=0;i<numpnts(MiniNames);i+=1)
+		name=MiniNames[i]
+		sscanf name,"Sweep%d_Mini%d",sweepNum,miniNum
+		Wave Index=root:Minis:$(channel):$("Sweep"+num2str(sweepNum)):Index
+		FindValue /V=(miniNum) Index
+		j=V_Value
+		if(j==0) // First mini of the sweep.  
+			Wave Sweep=root:$(channel):$("Sweep"+num2str(sweepNum))
+			variable lastSweepDuration=rightx(Sweep)
+			variable unrecordedDuration=60*(sweepT[sweepNum]-sweepT[sweepNum-1])-lastSweepDuration
+			Interval[i]+=unrecordedDuration
+		endif
+	endfor	
+	
+	KillWaves /Z TempIndex
+	//SetDataFolder $curr_folder
+else
 	duplicate /o Event_Time,Interval
 	//make /free/n=(numpnts(Interval)) TempInterval,TempIndex=p
 	extract /free/indx Interval,TempIndex,Use[p]==1
 	for(i=0;i<numpnts(TempIndex);i+=1)
 		Interval[TempIndex[i]]=TempInterval[i]
 	endfor
+endif
 End
 
 function /s GetMinisChannel()

File Other/Olfaction.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/Recording%20Artist/Other/Olfaction.ipf $
+// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/Other/Olfaction.ipf $
 // $Author: rick $
-// $Rev: 624 $
-// $Date: 2013-01-30 17:08:26 -0700 (Wed, 30 Jan 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 #pragma ModuleName=Olfaction

File Other/Spike Functions.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/Recording%20Artist/Other/Spike%20Functions.ipf $
+// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/Other/Spike%20Functions.ipf $
 // $Author: rick $
-// $Rev: 622 $
-// $Date: 2013-01-29 14:04:50 -0700 (Tue, 29 Jan 2013) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.
 #include "Stats Plot"
     for(i=0;i<CountObjectsDFR(df,1);i+=1)
         string name=GetIndexedObjNameDFR(df,1,i)
         if(grepstring(name,"sweep[0-9]+"))
+        	if(stringmatch(name,"*_filt"))
+			continue
+		endif
             wave w=df:$name
             string folder=getdatafolder(1,df)+"Spikes_"+name
             Spikes(w=w,folder=folder)
 	finish=ParamIsDefault(finish) ? (cursors ? xcsr(B) : dimoffset(w,0)+dimdelta(w,0)*dimsize(w,0)) : finish // Defaults: the location of the square cursor (cursor B) or the right edge of the wave. 
 	cross_val=ParamIsDefault(cross_val) ? -10 : cross_val // -10 mV.  
 	refract=ParamIsDefault(refract) ? 0.01 : refract // 0.01 s.  
-	thresh_fraction=ParamIsDefault(thresh_fraction) ? 0.02 : thresh_fraction // 1/50 of the maximum value of dV/dt during each spike.  
+	thresh_fraction=ParamIsDefault(thresh_fraction) ? 0.2 : thresh_fraction // 1/50 of the maximum value of dV/dt during each spike.  
 	minHeight=paramisdefault(minHeight) ? 2 : minHeight
 	Variable offset=keepOffset ? dimoffset(w,0) : 0
 	
 	Variable /G spikes_finish=finish+offset
 	String /G spikes_wave=GetWavesDataFolder(w,2) // Store the location of the wave that was analyzed.  
 	
+	//edit /k=1 Peak,Peak_locs,Threshold
 	SetDataFolder $curr_folder // Go back to the original folder.  
 	String /G root:last_spikes_folder=folder // Mark the folder of the last analysis (for debugging purposes).  
 	return num_spikes // Return the number of spikes found.  

File Users/Rick.ipf

-// $URL: svn://churro.cnbc.cmu.edu/igorcode/Users/Rick.ipf $
+// $URL: svn://raptor.cnbc.cmu.edu/rick/recording-artist/Recording%20Artist/Users/Rick.ipf $
 // $Author: rick $
-// $Rev: 607 $
-// $Date: 2012-04-24 22:56:02 -0400 (Tue, 24 Apr 2012) $
+// $Rev: 632 $
+// $Date: 2013-03-15 17:17:39 -0700 (Fri, 15 Mar 2013) $
 
 #pragma rtGlobals=1		// Use modern global access method.